Get True Type Fonts

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?
 
K

Ken Cox [Microsoft MVP]

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top