I have a console program which gets a font name by command line and should build some pre text as image with that font. The problem is that LoadFont() loads a font if it is really there or not (this should work on ms windows). So i am searching for a possibility to check if a given font name real exists. PureBasic supports the fine font requester which knows all real fonts. So it should be possible to know if a font name exists. But i can not find the point to check that. And i did not found a PureBasic command to get that. Maybe i have tomatoes on my eyes and need some wipe up. It should be possible to check a font name although on a gui program silently, i think. Has someone a idea or a little help for me? Thanks.
Have a look at the EnumFontFamiliesEx_() function on Windows. This can be used to examine a particular facename or to enumerate all fonts etc. You should be able to find some code in these forums somewhere.
I may look like a mule, but I'm not a complete ass.
MyTrial wrote:The problem is that LoadFont() loads a font if it is really there or not
This undesirable (to me) and unexpected replacement font auto loading behavior also manifests in Linux.
The IsFontName() workaround procedure that eJan kindly posted above only works for Windows®.
Does any member know the equivalent Linux method to determine if a font exists on the system?
Best solution: The LoadFont() command needs a switch to turn on/off the automatic font matching behaviour
so the IsFont() command will make sense again. Right now it's useless. Although technically not a bug.