Get True Type Fonts

  • Thread starter Thread starter Roger
  • Start date Start date
R

Roger

Hi,
I'm trying to populate a dropdownlist with all the available True-Type Fonts
on the webserver. Anyone know how to do this?
 
Hi Roger,

Not sure if this gets just the Truetype.....

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
' Gets the collection of installed fonts and
' adds them to a dropdownlist
' Ken Cox Jan. 25/2004
Dim fntFonts() As FontFamily
Dim colInstalledFonts As New _
System.Drawing.Text.InstalledFontCollection
Dim intCounter As Integer
Dim liItem As ListItem
fntFonts = colInstalledFonts.Families
DropDownList1.Items.Clear()
For intCounter = 0 To fntFonts.Length - 1
liItem = New ListItem
liItem.Text = fntFonts(intCounter).Name
liItem.Value = fntFonts(intCounter).Name
DropDownList1.Items.Add(liItem)
Next
End Sub

Does this help?

Ken
MVP [ASP.NET]
 
Back
Top