PRB: VFP 6.0 Application Requires FoxFont In Fonts Directory (192976)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q192976 SYMPTOMS
If you install a run-time application that uses the FoxFont font, the
install places the FoxFont.fon file in the directory with your
application's executable file. When you run the executable, it does not use
FoxFont, instead it substitutes another font, such as Courier New.
CAUSE
Visual FoxPro 6.0 run-time applications no longer use the FoxFont when it
is in the application directory. In order to use the FoxFont, it must be
installed in the Fonts directory.
RESOLUTION
Place a copy of the FoxFont.fon font file in the Windows\Fonts directory.
You can do this automatically by distributing the FoxFont.fon with your
application and adding the following code to the initialization code of
your application. This copies the font to the Windows/Fonts directory if it
does not yet exist there. You would need to place this code before any
other objects or code that use FoxFont, such as forms, reports,
_SCREEN.FONTNAME="foxfont" commands, and so forth.
Sample Code
LOCAL lcAppDir, lcWinFontDir
* Get current App directory from SYS(16).
lcAppDir = SUBSTR(SYS(16), 1, RAT('\',SYS(16),1)-1)
* Get WinDir environment and find the Fonts directory.
lcWinFontDir = GETENV('windir')+'\Fonts'
* Check that FoxFon.fon is in App directory and not in Fonts directory.
IF FILE(lcAppDir+'\foxfont.fon') AND !FILE(lcWinFontDir+'\foxfont.fon')
* Copy the file
COPY file (lcAppDir+'\foxfont.fon') ;
TO (lcWinFontDir+'\foxfont.fon')
SET MESSAGE TO && Clears "<nnnnn> bytes copied" from status bar
WAIT "" TIME 2 && Pause to allow font to be loaded
ENDIF
STATUS
This behavior is by design.
REFERENCES
For more information on True Type fonts, please refer to the following article in the Microsoft Knowledge Base:
Q186722 HOWTO: Programmatically Install a True Type Font
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Jim Saunders, Microsoft Corporation.
Modification Type: | Minor | Last Reviewed: | 2/22/2005 |
---|
Keywords: | kbprb KB192976 |
---|
|