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 SystemImports System.Collections.GenericImports System.TextImports System.Drawing.TextImports System.DrawingNamespace 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 ClassEnd Namespace
basic yet useful :)
Powered by: newtelligence dasBlog 2.3.9074.18820
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts