简体   繁体   中英

Cross-platform method to obtain list of FreeType font paths in C

I've written a simple C wrapper for SDL_ttf which in turn uses FreeType 1.2.

Although I use my own (non-system) fonts for most applications, it would be useful to have access to more fonts available on the system.

Is there any method or perhaps library on its own which can provide me with a list of font paths to glob for files (or a similar mechanism)? At this time I'm doing something heretical like having a hard-coded list of paths to try - which often fails as I don't know which platform I'm running on.

Am I missing something obvious?

Thanks for any responders.

Crossplatform solution I don't know. You use SDL, check it docs.

For Windows you can read http://msdn.microsoft.com/en-us/library/dd162615%28v=vs.85%29.aspx (Enumerating the Installed Fonts).

Also check How to get a list of installed True Type Fonts on Linux using C or C++?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM