SDL_ttf: "Couldn't find glyph" with libfreetype 2.11, works fine with 2.10.4
I’m getting “Couldn’t find glyph” with libfreetype 2.11. The same executable works fine when I dynamically link it with libfreetype 2.10.4.
This is for last release of SDL_ttf (2.0.15). Apparently Windows’ pacman, Homebrew, probably Nix and possibly many more package SDL_ttf with libfreetype 2.11, so this is a disaster.
The full error is
LambdaHack --dbgMsgSer --logPriority 1
INFO: OpenGL shaders: ENABLED
INFO: Created renderer: opengl
DEBUG: Couldn't find glyph
LambdaHack: SDLCallFailed {sdlExceptionCaller = "SDL.Font.shadedGlyph", sdlFunction = "TTF_RenderGlyph_Solid", sdlExceptionError = "Couldn't find glyph"}
and it happens always and right after opening a window in this application
https://github.com/LambdaHack/LambdaHack
e.g., you can always see this in this executable built on Windows
and probably with this executable on Linux, if you run it in a system with libfreetype 2.11
https://github.com/LambdaHack/LambdaHack/suites/4095162996/artifacts/104398309
It looks similar to the error in #119, but I can’t fix it by using a newer SDL_ttf, because my Homebrew, Debian, Nix and other users use whatever version package managers give them (and whichever libfreetype version). Also, for package containing SDL_ttf and related libraries, CIs that I use to build packages decide which versions of the libraries to provide.
What to do?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (6 by maintainers)
Hello, at Solarus Games we are facing the same issue since June 2021, but after reading this issue I managed to narrow it down to a specific font and size used in one of our games.
First and foremost, I can confirm that the issue is in the combination (FreeType 2.11 + SDL2_ttf 2.0.15) and works fine with (FreeType 2.11 + SDL2_ttf
main). This on a standard MSYS2 installation in Windows 10.The font in question is a very common font used for Chinese languages and is in here (get the
.tar.gzfile): https://sourceforge.net/projects/wqy/files/wqy-zenhei/0.8.38 (Pangu)/After unpacking the tar archive, the font is in the
wqy-zenhei.ttcfile.The test code is based on the snippet in https://github.com/libsdl-org/SDL_ttf/issues/152#issuecomment-948522751 :
@1bsyl given that this works as expected in SDL2_ttf
main, we are looking very forward for a release of SDL_ttf 2.0.16 😃It’s been fixed on master a couple of months ago and still no release, so the only hope is that (some) distros apply the patch by hand, but we are probably not in that age any more — many packages, many users, few volunteers.
I think I will just leave it be and create a workaround for now. @NickMcConnell: if Angband SDL frontend users start complaining at some point, just ask them to downgrade (or upgrate, if available at that point) freefont (or SDL_ttf, if available at that point). There is now 16x16xw.woff in Angband, so at least one font should still work. 😃