libsdl-org/SDL_ttf

Fallback fonts on SDL2

laurence-flwls opened this issue · 4 comments

Hi, I'm creating a terminal emulator in SDL2 and finding a lot of characters aren't present in a particular type-face (examples below).

I'd like to be able to define fallback fonts to cover instances were glyphs aren't available in the default type face.

After a bit of searching online, the only reference to this issue I could find was a Github issue from 2019 which sounded like a fix was soon to be merged. However, unless I've missed something obvious in the docs, I cannot find how implement that.

eg:
my terminal emulator (SDL2) vs iTerm2 -- under the DEC Special graphics and line drawing heading:

image
image

Could you link the GitHub issue you found? I'm not seeing it.

@slouken my apologies, it wasn't an official SDL repo: grimfang4/SDL_FontCache#29

So if we ignore the unrelated project, what would be the recommended way to solve my problem here? Because it's a text heavy application, a performant way to validate the glyphs would be preferable.

There is another curveball here though, I'm writing this terminal emulator in Go (golang). I do have some experience in C and older versions of C++ too so I can work my way through a C solution and port it to Go if needed. The only reason I favour Go these days is because it's faster (for me at least) to prototype code.