currently i am trying to load some custom TTF font files and as far as i know there is quite a number of possibilities to do that.
In the API DOCU i read:
If what you want to do is to embed a font into your exe, then your best plan is probably to embed your TTF/OTF font file into your binary using the Introjucer, and then call Typeface::createSystemTypefaceFor() to load it from memory.
I know that there is a "Resource" tab in the introjucer if your .cpp/.h file is a "GUI Component".
For each added resource the Introjucer extends your header file with variables to access them.
In my case i want to access these fonts from a class which is not a "GUI Component".
So i copied the font files to the Project Directory, added them with "Add Existing Files...." and used the "Add to Binary Resources" checkbox.
Now the question is:
How can these embedded resources be accessed?
Thanks for you help,
The file data will be automatically added to your BinaryData class. Just pass that block of data to the createSystemTypefaceFor method.
Thanks, that helped me a lot, because the BinaryData class does not seem to be part of the API documentation.
I also started to embed some images, which are loaded via "ImageCache::getFromMemory".
This lead me to the question, whether the embedded resources are loaded into RAM together with the rest of the program or not?
Wouldn't that mean, that every single image is duplicated by the ImageCache, which itself caches the images in RAM?
I just sent off my app to some people and noticed the font I used didn’t show up correctly. I didn’t even think about embedding it at the time. My app has about 24-30 labels that I placed directly on the GUI with a visual editor (GUI component). I used a font from the label editor (CalistoMT). Is there a way to embed the font I used into my application in a way that I can call it from within the visual GUI editor? If possible, I don’t want to have to redo all the labels by hand to pass the embedded font, but Im assuming I’ll have to?