Results 1 to 3 of 3

Thread: Accessing font files??

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    2

    Question Accessing font files??

    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

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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 :
    Code:
    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
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width