Introduction
In this article we are going to see how to retrieve
the System fonts at runtime and add them as a List collection.
Useful
Tips
- It helps to check whether a required font is
available or not.
- If a font does not exist then we can adapt and use
a different font.
CODE SNIPPET
public static List<string> GetSystemInstalledFonts()
{
List<string> lst = new
List<string>();
InstalledFontCollection fonts = new InstalledFontCollection();
for (int i = 0; i
< fonts.Families.Length; i++)
{
lst.Add(fonts.Families[i].Name);
}
return
lst;
}
Output
Location
of System Installed Fonts
Step
1: Type "Fonts" in the Run command and Click OK.
Step
2: You will get the Path of the Installed Fonts.
Conclusion
So
in this article you have learned how to get the System fonts and add them to a
Collection. Thanks for reading.