Kerning - or not!

Discussions related to mouse, keyboard, fonts and Graphical User Interface
Hated Moron

Kerning - or not!

Post by Hated Moron »

The observant among you may have noticed that the kerning.bbc example program supplied with BBC BASIC for SDL 2.0 has, for some while now, stopped showing any difference between the 'without kerning' and 'with kerning' strings. This failure has nothing to do with BBC BASIC, but rather seems to result from a bug (or feature) in recent releases of SDL2_ttf.

I have reported this at the SDL forum and await a response, but since their efforts are now directed towards developing SDL3 (which BBC BASIC cannot use because support for OpenGL ES 1.0 has been dropped) this may not be forthcoming in the short term. A workaround is available, but it is messier than the current kerning.bbc program.
Hated Moron

Re: Kerning - or not!

Post by Hated Moron »

Hated Moron wrote: Thu 06 Apr 2023, 22:36 I have reported this at the SDL forum and await a response
Curiouser and curiouser. It turns out that kerning does still work with some fonts (for example FreeSerif.ttf) but not with others (e.g. DejaVuSans.ttf). It doesn't make a lot of sense, because you can tell there are kerning tables in the fonts that don't work by calling the TTF_GetFontKerningSizeGlyphs32() API function. I can use that function to work around the issue, but it makes the program more complicated and slower.