Results 1 to 9 of 9

Thread: how to get a list of all FôNtZ ???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146

    Question

    i want to list all fonts of the system in list1

    but i dont't know, how to get them

    where are they stored...???


  2. #2
    Guest

    Wink

    Try This.

    Code:
    Dim I As Integer
    
    For I = 0 Printer.FontCount -1
      List1.AddItem Printer.Fonts(i)
    Next

  3. #3
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    That will work, but you will only get a list of printable fonts. To get all known fonts (doesn't include GDI synthesized fonts) on the system use the Screen object instead, like this:
    Code:
    Private Sub ListFonts()
       Dim idx As Long
       Dim sFont As String
       
       
       Screen.MousePointer = vbHourglass
       List1.Visible = False
       Call List1.Clear
       
       For idx = 1 To Screen.FontCount Step 1
          sFont = Screen.Fonts(idx)
          
          If sFont <> vbNullString Then
             Call List1.AddItem(sFont)
          End If
          
       Next idx
       
       List1.Visible = True
       Screen.MousePointer = vbDefault
       
       'Just so you can see the comparison.
       Call MsgBox("Number of Screen Fonts = " & Screen.FontCount & vbCrLf & _
                   "Number of Printer Fonts = " & Printer.FontCount)
    End Sub
    I just wanted to point that out
    Dan PM
    Analyst Programmer

    VB6 SP3 (also VB4 16-bit sometimes )

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    this way is also simple:
    Code:
    For i = 0 To Screen.FontCount - 1
    List1.AddItem Screen.Fonts(i)
    Next
    good luck

  5. #5

    Cool

    Do not forget to set the the "Sorted" property of your Combo box to true



    keetsh

  6. #6
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Thumbs up

    Originally posted by keetsh
    Do not forget to set the the "Sorted" property of your Combo box to true



    keetsh

    Don't forget this, or your fonts will come out in a wacked up order!!!!!!!!!!!!!!!!!!

  7. #7
    Hummm yes that is actually the primary meaning of 'sorted'

    See you,

    keetsh®

  8. #8
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Originally posted by keetsh
    Hummm yes that is actually the primary meaning of 'sorted'

    See you,

    keetsh®
    yeah, sorry

  9. #9
    Hehey no prob da_silvy )

    See you,

    keetsh

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