Retrieve font size from a text drawable.

If you define a text drawable in a layout file, e.g.

<label id="value" x="center" y="center" color="Gfx.COLOR_WHITE" justification="Gfx.TEXT_JUSTIFY_CENTER" font="Gfx.FONT_NUMBER_MEDIUM" />


is there any way to get the font from that drawable once you've retrieved it in code:

aLabel = View.findDrawableById("some_text_field");

In other words, how can you get the font from aLabel?
  • No, there is no public method to access the font of the built-in Ui.Text class. You can easily create your own class that inherits from Ui.Drawable (or Ui.Text) and does provide the access you need.

    If you do that you'd need to change the XML a little bit, but how to do custom drawables is covered in the Programmers Guide, so you should be able to do it pretty easily.

    Travis