There are MANY threads about fonts and embedding.
But the information is pretty scattered around the forum.
Few notes regarding fonts and cross-platform:
Fonts by themselves aren’t assured to be available between OSes. also sometimes an OS would replace the default font or fallbacks. so a UI design with standard fonts might show up differently not only for different platforms but also for different OS versions.
Pretty sure that your 2nd example is going to call Typeface::createSystemTypefaceFor every time you getCustomFont() (and that’s probably a costly operation), whereas the static version should only do it once.
Ah, right, that makes sense, if you repeatedly call getCustomFont() throughout your LookAndFeel class.
I was taking the approach of the LookAndFeel class having several Font class members, and was just calling a variant of getCustomFont()once for each typeface at construction, and assigning its returned value to those Font members. And so I was trying to think when I might need that static Typeface again later, and the answer seemed to be never…
hey
How can I change the font size using this method? How can I provide the typeface with a font size and a font family and return it in the getCustomFont () function?
I can’t enter g.setFont(juce::Font(20.f), getCustomFont());
What is BinaryData::CustomFont ? Is it downloaded TIFF font in binary file representation?
and where is setDefaultSansSerifTypeface?
And so on… Can you provide exact info what is inherited, what overwritten, and where a font is loaded. Otherwise it is just list of methods and I don’t know how to apply your instructions.