Hi there,
I was a bit frustrated that I get no feedback from the engine if a font exists or not. So I searched a bit and wrote a little DLL. With this tiny DLL you can check if a specific font is available on the user's system.
The DLL works
both for Lite-C -and- C-Script. There are two functions:
int fontInstalled (char* fontName); // Lite-C only
var fontInstalledStr (STRING* fontName); // C-Script compat.
Use the first one in your Lite-C app, the second one if you use C-Script. To define the DLL-function in your C-Script app, use
dllfunction fontInstalledStr (fontName);
In both cases make sure that the fontExists.dll has been found and loaded by the engine. The function returns 1 or 0, indicating if the font has been found or not.
EXAMPLES
Lite-C:
char* fontName = "Calibri";
int result_calibri = fontInstalled(fontName);
int result_tahoma = fontInstalled("Tahoma");C-Script:
string fontName = "Cambria";
var result_cambria = fontInstalledStr(fontName);
var result_times = fontInstalledStr("Times New Roman");You can use the DLL without permission for anything you want. DLL source and testcases included. If it blows up your machine, it is not my fault! DLL has been built with Visual Studio 2005.
DOWNLOAD:
http://www.christian-behrenberg.de/download/fontExistsDll/fontExistsDll.zipDonations are welcome! PayPal -> christian[ät]behrenberg[.]de
Bye bye,
Christian