These are called ligatures, and you can disable them in your DrawOptions
with gl::TextureFont::DrawOptions{}.ligate ( false );
They can look much better when enabled though, so if you want them in there, they’ll need to be added to the supportedChars
list when you create the TextureFont
.
auto chars = gl::TextureFont::defaultChars();
chars.append ( ... the ligature codepoints here ... )
auto font = gl::TextureFont::create ( chars );
Edit: Been doing some digging, it seems that toggling ligatures isn’t supported on windows at all, but it will correctly apply ligatures as long as the codepoints are in the supplied glyphset.
The problem with your case is the ligature for ti (named glyph00415
) is actually composed of a few smaller glyphs, glyph00424
and glyph00549
), which, in turn, are composed of further smaller bits, so there’s not a direct codepoint you can include for this to work with the current API, unless somehow supplying all the parts allows it to resolve correctly. Text is the worst.
Edit 2: You’ve sent me down a real Sunday arvo rabbit hole here. I found article after article of people having trouble with calibri and ligatures on windows, although I was able to replicate the issue on mac too, so a lot of that turned out to be a red herring.
As far a I can tell, the issue lies with the font atlas in gl::TextureFont
. The glyph measurement functions appear to do the right thing, and when passing the results into the OS level text rendering functions called by TextBox
, you’ll get the correct output, but the ligated glyph isn’t being rendered correctly in the font atlas (or the codepoint is getting corrupted) so when it comes time to draw the ligated glyph from the atlas, it’s blank. That’s a lot of words with roughly zero useful information for you, but there you have it
In short, bake your textures with TextBox
in advance if you can, or as you knew from the jump, use a different font.