Detect the Font Name

Joined
May 31, 2007
Messages
7
Programming Experience
1-3
Hi All,

I am trying to copy the font files (.otf type only) to font folder of windows directory . I dont want to install those fonts which are already installed. I can check which font family is already installed but not able to find the name of the font which i am uploading.

Please suggest me some way to find it. Or some other way to install the fonts without repeating it.



Regards

Abhi
 
I have been tinkering this morning looking for the proper method to use the find method of InstalledFontCollection but could not so this was the closest for determining if a font was installed.

VB.NET:
[COLOR="Blue"]Public Function [/COLOR]IsFontInstalled([COLOR="blue"]ByRef [/COLOR]fontName [COLOR="blue"]As String[/COLOR]) [COLOR="blue"]As Boolean[/COLOR]
         [COLOR="Blue"]Dim [/COLOR]installedFonts [COLOR="blue"]As [/COLOR]System.Drawing.Text.InstalledFontCollection = [COLOR="blue"]New [/COLOR]System.Drawing.Text.InstalledFontCollection()

         [COLOR="blue"]For Each[/COLOR] family [COLOR="blue"]As [/COLOR]FontFamily [COLOR="blue"]In [/COLOR]installedFonts.Families
            [COLOR="blue"]If [/COLOR]fontName = family.Name [COLOR="blue"]Then[/COLOR]
               [COLOR="blue"]Return True
               Exit Function[/COLOR]            
            [COLOR="blue"]End If[/COLOR]
         [COLOR="blue"]Next [/COLOR]family

         [COLOR="blue"]Return False[/COLOR]
      [COLOR="blue"]End Function[/COLOR]
 
Back
Top