Another option would be to embed a font (somehow) and load
the font from
this embedded resource, just like we can open jpg and png images
from
memory. Something like that, maybe...
I've been working with Ian's platform specific code and I have demo
code somewhere which loads a font from a ttf or similar file. This
works fine. Embedding a font in binary form in a program would
likely be more involved because the platform specific code Ian
provided does only load from a file. ISTR that e.g. Windows can load
from "font resources" but I don't know how to "build" such a
resource.
Are people still interested in this idea?
I'm still interested but for now I have working code for myself.
We could probably add a public method to load a font from a font
file to hide the platform specific code with what we have already.
If you need to bundle the font in binary form inside
the program you could convert the file to a binary image (e.g. with
xxd), compile it into the program, and write it to a temporary file
to load it.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.