Click to See Complete Forum and Search --> : Accessing font files??
Devious
May 10th, 2001, 06:08 AM
OK, does anyone know how i can access font files instead of font names? By that i mean; say i have a custom made font, eg "c:\something\fontfont.ttf", and i want to use it in a game or proggie, how do i use that file as a font w/o having to have to install it into the windows\fonts folder??
please help!
urgent for a school project!!
thanx,
andy
plenderj
May 10th, 2001, 10:08 AM
Well what you could do right, is stick the font into the same dir as the app, and then when the app runs, it checks if the particular font exists, and if it doesnt, it registers the font that is in the dir with it.
plenderj
May 14th, 2001, 02:08 AM
Well you could check if yours is registered yet. If not, then im sure you can either shell out to something to register it for you, or just copy it into the fonts folder. (I havent tested the latter ...)
Quote from MSDN :
Checking Available Fonts
Your program can easily determine whether matching fonts are available on both the user’s system and printer. The Fonts property applies to the Printer and Screen objects. An array returned by the Fonts property is a list of all of the fonts available to a printer or screen. You can iterate through the property array, and then search for matching name strings. This code example determines whether the system has a printer font that matches the font of the selected form:
Private Sub Form_Click ()
Dim I As Integer, Flag As Boolean
For I = 0 To Printer.FontCount - 1
Flag = StrComp (Font.Name,Printer.Fonts(I), 1)
If Flag = True Then
Debug.Print "There is a matching font."
Exit For
End If
Next I
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.