nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
25.99k stars 7.67k forks source link

stb_truetype: Missing glyph lookup wrong when multiple ranges are used with stbtt_PackFontRanges #1508

Open mokafolio opened 11 months ago

mokafolio commented 11 months ago

Describe the bug

Use stbtt_PackFontRanges with more than one range. If the first range generates the missing glyph bitmap (.notdef) and you use a character in the second range that has no glyph and hence should use the .notdef glyph from the first range, it wont.

Expected behavior Undefined glyphs in the second range should use the proper .notdef glyph.

mokafolio commented 11 months ago

Will it be helpful to create a small demo to reproduce the issue? If you look at the code in the pull request, the issue should be relatively obvious though.

rygorous commented 11 months ago

If you have a repro that always helps, but in general bugs in the stb repository will sit around for something like 9-15 months on average because both Sean and I very rarely have time to work on the stb projects and generally do so in "batch mode" for one weekend every year.

mokafolio commented 11 months ago

No rush or worries, I will try to cobble together a small repo soonish!