Inconsistencies in font rendering

I use a manually created custom font for displaying time in my watchface.

This font renders perfectly in the simulator for all supported watches - VA, epix and 920xt, it also renders perfectly on VA (and I believe epix) hardware. However, I have users reporting a rendering glitch on the 920xt!

This is a screenshot of the rendering on 920xt in the simulator


And this is what one user is seeing
Photo courtesy of splittingfield
You'll notice that there are extra white lines drawn at the top of the text.

Any suggestions would be appreciated because I'm not sure how to handle this since the simulator and other hardware platforms all render the font without issue.

Thanks,
Dan
  • Are you building with 1.2.2? There were changes to how custom fonts are compiled with it, so it may be something in your .fnt where the height is a bit wrong, and sometimes catches a few pixels from the character above the one you're displaying in the .png, but for some reason only impacts only one of the devices...

    Just a thought.


    from the 1.2.2 announcement:

    "The compiler is processing custom fonts in a way that allows for more data to be specified, but hand-made font files may display slightly different."
  • I am building with v1.2.2 of the SDK.

    My font PNG is a single row with no border (so the largest glyphs start at a Y coordinate of 0).
    All but 3 of my glyphs have yoffset=0 but there does not appear to be a relationship between the characters that do have a yoffset and those that are rendering incorrectly on the 920xt.

    CORRECTION: I was looking at an older font file, in fact all of my glyphs start at a Y of 0 and all of them have yoffset=0.
  • The plot thickens...

    From a user of my watchface with a 920xt:

    When a horizontal line is drawn at the top of the time box, it adds an additional horizontal line above this. This later line
    stays as the time changes. For example, if there time were 1:31, there would be a bar above the three. At 1:32, the line would be added above the 2. At 2:00
    there would be lines above all three. Then sometimes, a small line appears above the :, which I cannot yet understand or explain.


    So it seems the watch is rendering extra pixels outside of the time box which then persist.
    The rendering glitch is weird, but I also perform a dc.clear() at the start of my onUpdate function so why are these glitches persisting and not being cleared away?

    It looks like an issue with the firmware since the simulator for the 920xt does not exhibit this behaviour. Another user has also confirmed that it renders perfectly on the epix.

    [table="width: 500"]
    [tr]
    [td][/td]
    [td]Simulator[/td]
    [td]Hardware[/td]
    [/tr]
    [tr]
    [td][RIGHT]vivoactive[/RIGHT][/td]
    [td]✓[/td]
    [td]✓[/td]
    [/tr]
    [tr]
    [td][RIGHT]epix[/RIGHT][/td]
    [td]✓[/td]
    [td]✓[/td]
    [/tr]
    [tr]
    [td][RIGHT]920xt[/RIGHT][/td]
    [td]✓[/td]
    [td]x[/td]
    [/tr]
    [/table]
  • Garmin, could you please undo the change you made in 1.2.2 so that custom fonts behave correctly again?

    Or give us detailed, step by step instructions on how to resolve our now broken custom fonts?

    Thanks.
  • This worked for me. It took a few minutes per font, and was not difficult.

    https://forums.garmin.com/showthread.php?340050-Connect-IQ-1-2-2-SDK-Available!&p=785157#post785157

    the 1.2.2 changes aren't a bug, it's actually a fix to a bug, where things in the .fnt weren't being used properly, causing problems with some characters to be used.
  • Except this doesn't appear to be the cause of the issue I'm describing in this thread since I am successfully using appropriate xadvance values and the font is rendered correctly in all cases except on the 920xt.
  • This worked for me. It took a few minutes per font, and was not difficult.

    https://forums.garmin.com/showthread.php?340050-Connect-IQ-1-2-2-SDK-Available!&p=785157#post785157

    the 1.2.2 changes aren't a bug, it's actually a fix to a bug, where things in the .fnt weren't being used properly, causing problems with some characters to be used.


    Nope that didn't fix it :-(

    info face="GRATIS" size=120 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,2,0,2 spacing=3,0 outline=0
    common lineHeight=120 base=94 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
    page id=0 file="watch0.png"
    chars count=11
    char id=48 x=0 y=0 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=49 x=0 y=136 width=45 height=68 xoffset=9 yoffset=26 xadvance=45 page=0 chnl=15
    char id=50 x=48 y=0 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=51 x=96 y=0 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=52 x=144 y=0 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=53 x=192 y=0 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=54 x=0 y=68 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=55 x=48 y=68 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=56 x=96 y=68 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=57 x=144 y=68 width=45 height=68 xoffset=2 yoffset=26 xadvance=45 page=0 chnl=15
    char id=58 x=224 y=68 width=17 height=68 xoffset=2 yoffset=26 xadvance=17 page=0 chnl=15

    Still looks too spaced out - damn!
  • Sorry, my last post was meant for rupert! :)
  • @Rupert. Maybe try reducing width and xadvance to 40 and see if that helps? I had some more things I had to adjust in a font that I did by hand, that was no longer close to what I got from BMfont.
  • Another font problem.

    My font has the 1234567890: characters in it. I format the hour part of the time like this

    hour = Lang.format("$1$", [hour.format("%02d")]);

    and draw like this

    dc.drawText(dc.getWidth()/2 -18,-8,fnt_time, hour, Gfx.TEXT_JUSTIFY_RIGHT);

    But with 1.2.2 I get a weird box rendered as the hour string is actually

    " 4" and there is no space character in the font

    Short of re doing all my fonts in bmpfont and re editing them in photoshop and adjsuting the fnt file is there a way round this?