This is a really basic stuff that alot of developers tend to forget(just like me :D)
[C# VERSION]
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Text;
using System.Drawing;
namespace KeithRull.MachineFonts
{
class Program
{
static void Main(string[] args)
{
// all the fonts in your machine
InstalledFontCollection installedFonts = new InstalledFontCollection();
//iterate thru eachy font
foreach (FontFamily fontFamily in installedFonts.Families)
{
//display the font in the screen
Console.WriteLine(fontFamily.Name);
}
//stop and wait for the user to press a key to exit
Console.ReadLine();
}
}
}
[VB.NET VERSION]
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Drawing.Text
Imports System.Drawing
Namespace KeithRull.MachineFonts
Class Program
Shared Sub Main(ByVal args() As String)
' all the fonts in your machine
Dim installedFonts As InstalledFontCollection = New InstalledFontCollection()
'iterate thru eachy font
Dim fontFamily As FontFamily
For Each fontFamily In installedFonts.Families
'display the font in the screen
Console.WriteLine(fontFamily.Name)
Next
'stop and wait for the user to press a key to exit
Console.ReadLine()
End Sub
End Class
End Namespace
basic yet useful :)
Posted
Oct 11 2006, 01:28 PM
by
keithrull