Under Review
over 1 year ago

FR645 and others since fw 7.20: major issues with custom fonts

Parents
  • I've been told the difference between the base height and the character height is supposed to be the area for accents to be drawn. Based on what I'm seeing with some generated fonts, I'm not sure that is actually correct.

    If you're using a custom font just for an easy way to do bitmap coloring for status icons, there should be no issue making base equal to the height of 0. If you are actually drawing text with it, there may be implications.

    That said, I have reproduced the issue using a font that is not hand edited using DejaVuSansCondenced.ttf as suggested above. 

Comment
  • I've been told the difference between the base height and the character height is supposed to be the area for accents to be drawn. Based on what I'm seeing with some generated fonts, I'm not sure that is actually correct.

    If you're using a custom font just for an easy way to do bitmap coloring for status icons, there should be no issue making base equal to the height of 0. If you are actually drawing text with it, there may be implications.

    That said, I have reproduced the issue using a font that is not hand edited using DejaVuSansCondenced.ttf as suggested above. 

Children
  • Yes, there will be implications. It will break code that relies on correct reporting of the font ascent and descent, using Toybox.Graphics getFontAscent() and getFontDescent(). Back to my earlier example, the font height == 17, ascent == 13, descent == 4. After setting the base to 17, ascent == 17, descent == 0.