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…