Clipped rendering of negative kerning custom fonts

I'm experimenting with custom fonts that have negative kerning, i.e. glyph bounding boxes may overlap one another. The example I'll use in this post is https://fonts.google.com/specimen/Griffy

When a letter like Y is rendered in the simulator, the edges of the letter are cropped:

Is there any way to convince the renderer to render the entire character beyond the negative xoffset and short xadvance values that support negative kerning?

Here's myfont.fnt file:

info face="Custom" size=120 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
common lineHeight=207 base=147 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=1 greenChnl=1 blueChnl=1
page id=0 file="myfont.png"
chars count=3
char id=32 x=122 y=79 width=0 height=0 xoffset=0 yoffset=147 xadvance=53 page=0 chnl=15
char id=89 x=0 y=0 width=121 height=119 xoffset=-23 yoffset=33 xadvance=65 page=0 chnl=15
char id=111 x=122 y=0 width=65 height=78 xoffset=4 yoffset=69 xadvance=72 page=0 chnl=15

And the corresponding myfont.png file:

And the XML:

<fonts>
  <font id="CustomFont" filename="myfont.fnt" filter="" antialias="true" />
</fonts>

Top Replies

All Replies

  • To me it seems like a flaw in the implementation, which for some reason performs unnecessary clipping when drawing the glyph in what's seemingly the correct position.

    Maybe, not a “flaw”.  It’s some-sort of limitation. There are a lot of them in IQ. IQ is certainly not an “anything goes” kind of environment (there might be reasons for the limitations).

    I suspect that padding might be a usable hack here

    Do you mean adding space to the character to eliminate the overhang?

    but I first wondered if anyone had a silver bullet to share.

    It might be safer to adapt to the limitations.

  • probably they didn't think or care about negative kerning

  • They probably shouldn’t.

    It’s a rather fringy concern/interest.

    (“Flaw” suggests something that should be fixed.)

  • Fringy it may be, but that assumes that usually you're just dealing with nice block letters without any dynamism. I started going down this rabbit hole in the first place because I wanted a way of presenting some text in the way you see on movie subtitles; a thin highly-contrasting outline that ensures readability with any background colour/texture. That failed to work in the same way as the example I used in this post.

  • Fringy it may be, but that assumes that usually you're just dealing with nice block letters without any dynamism.

    It’s not an assumption. It’s a fact. An obvious one.

    It’s not exactly realistic to expect what you want to be supported (calling it a “flaw”).

    I started going down this rabbit hole in the first place because I wanted a way of presenting some text in the way you see on movie subtitles

    Most people come to IQ development from programming in places where “the sky is the limit”.

    IQ is a very limited development environment. Some of the limitations are by design. Some of them result from the devices being slow computers with limited memory and restricted displays. That you went “down this rabbit hole in the first place” suggests you might not realize that.

  • Err, sure mate :) We all know it's limited; legacy technologies and company values made it what it is. Although it's worth asking what's possible in the context of evolving technologies and competitors and user expectations. And in this case the issue seems like an implementation oversight or perhaps an over-optimisation.

  • Although it's worth asking what's possible...

    Sure, it’s worth asking.

    ...in the context of evolving technologies and competitors and user expectations.

    The most important "context" is what is possible now with what you have to work with.

    The answer is very likely “you can’t do what you want and have to work within the limitations provided”.

    And in this case the issue seems like an implementation oversight or perhaps an over-optimisation.

    It more appears to be unrealistic expectations about how the devices work.

  • We all know it's limited; legacy technologies and company values made it what it is. Although it's worth asking what's possible in the context of evolving technologies and competitors and user expectations.

    You are implying that Garmin isn't considering the "contexts" you list.

    I don't think Garmin has any real chance (anytime soon) of competing one-on-one with Apple (the "competitor" I suppose you are talking about).

    While there's some overlap of functionality between the Garmin devices and the Apple watch, it seems fairly clear that Garmin is targeting an audience that isn't currently well supported by the Apple watch.

    Abandoning "legacy technologies" might not be practical. It would take years to create an alternative and the "competitors" would still be evolving (so, it's a moving target). Garmin likely would have to keep improving devices that use "legacy technologies" to still be able to have things to sell while they developed the replacement.

    The big advantage Garmin has is battery life. This is actually possible due to the ""legacy technologies" they are using. (Garmin supports activities better but that's something other companies could possibly match.)

  • Many things I disagree with:

    1. Apple Watches become gradually better (more fitness features, more battery life), so the gap is probably closing (at least for the 80-90% of the users. Maybe there's a very small percentage of users that do ultras and other very niche things that they won't do with AW). Also it does seem like Garmin is also adding functionalities of AW or other sart watches gradually (voice + assistants for example)

    2. Garmin already abandoned "legacy" technologies. I'm not talking about the watches from 4+ years ago. That's OK and understandable and alway has been the case. I'm talking about the previous generation, that until recently had a few more years of support, but now since they only put effort into the new unified platform they virtually abandoned fr965, fenix7, epix2, etc.

    3. Battery life: it was once a big advantage, but it's not that much any more. Even the advertised battery life is smaller in some of the newest devices than in the previous generation and the actual battery life is about 1/3 for me in my fr965 from day 1. Garmin doesn't really care, it looks like as long their battery lasts at least 3 times longer than an AW they're OK with it, even if it's decreasing from generation to generation (not to talk about from FW version to FW version...)

  • 1. Apple Watches become gradually better

    ??? The battery life for Apple watches is 1 day (maybe, a bit longer). The battery life for Garmins is much longer.

    This not likely this is going to change any time soon.

    I said Apple is/can add more fitness stuff. Sure, Garmin is adding Apple features but, given other issues, it's not likely they will ever match the level of integration Apple provides (and Apple is not standing still either).

    so the gap is probably closing (at least for the 80-90% of the users. Maybe there's a very small percentage of users that do ultras and other very niche things that they won't do with AW). A

    Apple (almost certainly) sells many more watches than Garmin does. So, arguably, the "80-90%" may have already been attained.

    Garmin already abandoned "legacy" technologies.

    ??? The new devices (e.g., Fenix 8) are based on legacy code/architecture. I'm not talking about old devices.

    Battery life: it was once a big advantage, but it's not that much any more. Even the advertised battery life is smaller in some of the newest devices than in the previous generation and the actual battery life is about 1/3 for me in my fr965 from day 1.

    ??? Sure, the battery life for some devices is shorter but it's still much. much larger than what the Apple watch provides.

    Something has to give (everything is a compromise): "Garmin is also adding functionalities" likely means having a reduced battery life. The big hit appears to be the use of AMOLED.

    Garmin doesn't really care, it looks like as long their battery lasts at least 3 times longer than an AW they're OK with it, even if it's decreasing from generation to generation (not to talk about from FW version to FW version...)

    They certainly care. (Though not as much as you'd like.) They (probably) can't compete on the other stuff (in the long term).