Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an icon
Message
 
To
25/01/2002 06:41:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00609533
Message ID:
00610408
Views:
21
>George, many thanks. It's amazing.
>
>I have one more similar question. How can I in install procedure install some fonts in smooth way without
>
>copy xxx.ttf to c:\windows\fonts
>
>directory?
>
>Post exe is OK. I wanna automatize install procedure as match as possible.
>
>Thanks again.

First of the Fonts directory is one of the Windows special folders collection. On this machine it's C:\WINNT\Fonts. Since, however, it is part of the special folders collection, I wouldn't recommend relying on it being beneath the main windows directory. While it may be the case that it is there on a consistent basis, it does not mean that it will always be there.

My dll doesn't contain a function to return this path. The Windows Script Host's WScript.Shell object has a method (SpecialFolders) that will return the current font path
oShell = CREATEOBJECT("WScript.Shell")
? oShell.SpecialFolders("Fonts")
While copying font files to the font folder does make the font available, it does not properly install it in accordance with the guidelines specified in the Platform SDK. In order to do so, one would have to call EnumFontFamilies(). Unfortunately, this function cannot be called from VFP since it requires the use of a callback function.

You can, however, temporary add a font (from any location on any drive) by call AddFontResouce(), followed by a SendMessage() call to alert the active applications to re-load the font table (this would include VFP) and RemoveFontResource (and another SendMessage call. I think there might be examples of this in the API section.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform