font.fnt

hi mates,

i'm trying to do a very simple analogic wf with squared hands (2 colors)

since i'm not "good/smart" enought to use python tilemap method

(this one: https://forums.garmin.com/developer/connect-iq/f/discussion/195648/tilemapper-tool-for-tile-mapped-anti-aliased-graphics/972060#972060)

i'm trying to do it manually,

so i've created my font with Font Forge and export it with BMfont

so far it is good,

but my hands are not well aligned, so i think i have to edit the .fnt but i don't understand it:

here is an exmple:

char id=65   x=180   y=43    width=16    height=40    xoffset=17    yoffset=2     xadvance=50    page=0  chnl=15

char id=65 : i get it it is "A"

x / y: are the position on the .png, width / height: the size in the .png

but xoffset / yoffset and xadvance, i don't get it at all, offset from what?

pretty sure if i correct them i will be able to get what i need but i would like to understand.

Many thanks!

My best wishes for those hard time, that is kind of chaos in my country...

  • xoffset = how many pixels to shift the character right (= extra blank pixels to left of character)

    yoffset = how many pixels to shift the character down (= extra blank pixels above character)

    xadvance = total width of character in pixels (so adds xadvance-xoffset-width extra blank pixels to the right of character)

    You can also adjust "lineHeight" and "base" on the very top line of the file. lineHeight should be at least as big as the biggest height of any individual character (so this can also add extra pixels on the top I think). And base determines where the bottom of the characters is drawn relative to the top lineheight. So with my icon fonts I generally make sure that lineheight and base are the same, and match the tallest height in the font.

    And it seems chaos everywhere!

  • There is also a cool app you could try too - Screeny font viewer: forums.garmin.com/.../900705

  • many thanks for this accurate answer,

    I guess so for my hands it is better to "Force xoffset and yoffset to 0" to have thme well aligned

    many thanks

  • Yep that should work well - then you will know exactly where your hands will be drawn