Initializing font picker in Firemonkey

  

I have a font picker in the app that I am developing – it is a third party component that will be filled at run time with a list of the fonts that are present on the end user’s computer.

How do I initialize the font picker when I I have no knowledge at time of programming my app of the end user’s system?

Is there some technique similar to that used on a website, where you can specify a list of preferred fonts, and if none are found, fall back on something generic?

I know that Windows and Mac both have a default font but hardly understand the concept. Is the default font (e.g. Segoe on recent Windows systems, San Francisco on recent Mac systems) guaranteed to be present? Can the user remove the default? If so, does the default font redefine itself as some font actually present?

I’m struggling to even phrase my question clearly. What I want to do is to initialize the font picker to something sensible. I can’t set it to some arbitrary index in the user’s font list because it might be something ridiculous. But if I set it to something reasonable like Arial or Helvetica, how can I be sure it will actually be there?

Perhaps the ideal would be to initialize the font picker to the operating system’s default font but how would I do that? It seems particularly mysterious on Mac where the default is known as .AppleSystemUIFont and I haven’t found any way to convert that to a real font name!

Maybe I’m trying to ask how other people initialize their font pickers?

Apologies for my badly formed question. I’ve searched for many hours and can’t find anything helpful.

PS My question is broader than Firemonkey but my app is being developed in Firemonkey so I’m posting it here.

Comments are closed.