In this blog we are going to see, How to list all the
available fonts from Fonts path using System.IO
Step 1:
Use namespaces
System.IO
Step 2:
Fonts Path
C:\Windows\Fonts
Step 3:
Gets the Special Folder
Environment.SpecialFolder specialFolder = Environment.SpecialFolder.Fonts;
Step 4:
Gets the path of the special folder.
string
path = Environment.GetFolderPath(specialFolder);
Step 5:
Creating directory path for fonts path.
DirectoryInfo
directoryInfo = new DirectoryInfo(path);
Step 6:
Collect Font file as collection
FileInfo[]
fontFiles = directoryInfo.GetFiles();
Step 7:
Displays all the fonts from the path
C:\Windows\Fonts
foreach
(var fontFile in
fontFiles)
{
Response.Write(fontFile.FullName + "<br/>");
}
Step 8:
Path of Fonts

Join the conversation! Your thoughts help the community grow.