Article ID: 192976
Article Last Modified on 2/22/2005
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
* 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\<xit", ;
TabIndex = 2, ;
Name = "Command1"
ADD OBJECT text1 AS textbox WITH ;
FontName = "FoxFont", ;
FontSize = 9, ;
Value = (chr(227)), ;
Height = 25, ;
Left = 84, ;
Top = 36, ;
Width = 144, ;
Name = "Text1"
PROCEDURE Destroy
Clear events
ENDPROC
PROCEDURE command1.Click
Release thisform
ENDPROC
ENDDEFINE
?HOME()
Q186722 HOWTO: Programmatically Install a True Type Font
Additional query words: kbAppSetup kbVFp600
Keywords: kbprb KB192976