Results 1 to 5 of 5

Thread: [RESOLVED] Is there a way to check for a specific font?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Resolved [RESOLVED] Is there a way to check for a specific font?

    Let's say I had an app which needed a specific font (which I do, in my case "small fonts") and I want to make it so that the program checks to see if this font is available on the target PC and, if not, bring up a msgbox with details of what font is needed and then terminate on clicking "EXIT" in the msgbox.

    Is there any way of checking for a specific font in the system?
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Is there a way to check for a specific font?

    Why don't you simply install the font along with your application?

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Is there a way to check for a specific font?

    Code:
    Dim i As Long
    
    For i = 0 To Screen.FontCount - 1
        Debug.Print i, Screen.Fonts(i)
    Next

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Is there a way to check for a specific font?

    Use Screen.Fonts

    Code:
    Private Function FontExists(FontName As String) As Boolean
        Dim strC As String, intLoop As Integer
        
        strC = LCase$(FontName)
        
        For intLoop = 0 To Screen.FontCount - 1
            If LCase$(Screen.Fonts(intLoop)) = strC Then
                FontExists = True
                Exit For
            End If
        Next intLoop
        
    End Function

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: Is there a way to check for a specific font?

    That seems to work...thank you both! (rated, of course!)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

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