font list problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ciary
    Recognized Expert New Member
    • Apr 2009
    • 247

    font list problem

    hi all,

    i have a problem with a webservice written in VB.NET. my intensions are to display a fontlist in a website. since the code i found only works in IE (look in HTML forum for the script) i was thinking of a webservice (since i already worked with this. look in PHP forum for more details).
    while coding i got this code:
    Code:
        Public Function getFonts() As String Implements IService1.getFonts
            Dim strFont As String = ""
            Dim fonts As New InstalledFontCollection
            Dim families() As FontFamily = fonts.Families()
            Dim i As Integer = 0
    
            For Each nfont As FontFamily In families
                i = i + 1
                strFont &= i.ToString & ") " & nfont.Name & vbNewLine
            Next nfont
    
            Return strFont
        End Function
    problem is: my IE page returns 189 fonts and my webservice only shows 163. does anyone know where my other 26 fonts go? (i'm currently working on the server so it should be the same amount.)
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Perhaps there are some fonts that belong to the same family? Did you check which fonts don't show and what the relation between those fonts are?

    Steven

    Comment

    • Ciary
      Recognized Expert New Member
      • Apr 2009
      • 247

      #3
      Originally posted by MrMancunian
      Perhaps there are some fonts that belong to the same family? Did you check which fonts don't show and what the relation between those fonts are?

      Steven
      i thought that too, at first. but when i listed fonts instead of families i get the same amount. the only relationship i can find between the fonts is that they dont show in ms office either. maybe microsoft uses the same technique.

      Comment

      • MrMancunian
        Recognized Expert Contributor
        • Jul 2008
        • 569

        #4
        This might be a long shot, but MS Word only shows the fonts that the current default printer supports. Perhaps this is something to look into...

        Steven

        Comment

        • Ciary
          Recognized Expert New Member
          • Apr 2009
          • 247

          #5
          i guess vb.net also gets the printer fonts :) i just found 4 more fonts after restarting my server. fonts i just installed and already saw in my IE page (with a code in which i'm doing the same but it only works in IE)

          Comment

          • Ciary
            Recognized Expert New Member
            • Apr 2009
            • 247

            #6
            i just found the reason why it doesn't find a few fonts. vb.net will only read the .ttf fonts. while some fonts are stored in .fon files. i dont know how to solve this though. also, vb.net will only find all fonts if you restarted your system when you installed a new font, although you can already use it in other windows apps.

            Comment

            • manhit
              New Member
              • May 2009
              • 1

              #7
              ok

              thanks guys

              hiiiiiiiiiiiiii iiiiiiiiiiiiiii iiii

              Comment

              Working...