DOCUMENT:Q192976 04-MAR-2002 [foxpro] TITLE :PRB: VFP 6.0 Application Requires FoxFont In Fonts Directory PRODUCT :Microsoft FoxPro PROD/VER::6.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 6.0 ------------------------------------------------------------------------------- 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 " bytes copied" from status bar WAIT "" TIME 2 && Pause to allow font to be loaded ENDIF STATUS ====== This behavior is by design. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Create a new project called Fonttest and add a program named Main with the following contents: * This uses CREATE OBJECT and a form class, but the same steps * work with a form created with DO FORM. oform1=CREATEOBJECT("form1") oform1.Show READ events DEFINE CLASS form1 AS form Height = 169 Width = 309 AutoCenter = .T. Caption = "Font Test Form" Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 108, ; Left = 108, ; Height = 27, ; Width = 84, ; Cancel = .T., ; Caption = "E\