font constants

The font constants (FONT_XTINY, FONT_TINY, FONT_SMALL, FONT_MEDIUM, FONT_LARGE) are useful, but they don't cover all of the available font sizes. If you extend SimpleDataField, you see a huge font used for displaying numeric values. Even the FONT_LARGE font isn't as big as the font used by the provided data field.

I did some testing and it appears that font values map to integer constants with the values FONT_XTINY = 1, FONT_TINY = 2, FONT_SMALL = 3, FONT_MEDIUM = 4, FONT_LARGE = 5. If I use integer values larger than 5 and less than or equal to 13, I get properly rendered results for numeric values (alpha characters render as diamonds).

I'm assuming this is by design, but it would be useful if the fact was documented. It might also be worthwhile to add constants for fonts 5-13.
  • Former Member
    Former Member over 10 years ago
    For the sake of being pedantic :)

    0,1, 2 = Alphanumeric. All the same size. = FONT_XTINY, FONT_TINY, FONT_SMALL.
    3, 6 = Alphanumeric. Both the same size. = FONT_MEDIUM.
    4 = Alphanumeric. = FONT_LARGE.
    5, 9 = Numeric. XL.
    7 = Alphanumeric. XL.
    8 = Numeric. L NARROW.
    10 = Numeric. XXL.
    11 = Numeric. XXXL.
    12 = Numeric. XXXXL.
    13 = Numeric. XXXXXL.
  • We actually pulled the higher constants because it was going to be hard to explain some of the fonts are numeric only (meant for data display, and including the other glyphs would waste flash space), but since so many apps will want large number display I think it makes sense to add support back in. Note that there is no guarentee that using un-defined Font constants will work on all devices.
  • How are the font constants actually used? Can I have some code example? Just learning.

    Gfx.Font_xtiny is the same as Gfx.1?

    Is that how it's used? I want to implement a custom font to have a bigger watch number than why's currently on offer.

    Thanks
  • Gfx.FONT_XTINY is a descriptive name for the constant 0. Using the named constant makes your code much more readable than if you didn't.
  • I get that, but judging from the above where it was stated that there are fonts which are beyond the available descriptions of XTINY/TINY/SMALL etc etc, I was thinking that possibly to use the font constant instead. (but not sure how to get about it)

    Thanks.

    (but it's less of an issue now that I finally figured out how to get the custom fonts to work)