FLTK logo

Re: [fltk.general] Bundling TTF fonts with an FLTK application

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Bundling TTF fonts with an FLTK application Albrecht Schlosser Aug 05, 2021  
 
On 8/5/21 8:05 AM Webb Hinton wrote:
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.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/36f6bf9d-7751-eb55-de58-ddc4df064871%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.