Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created March 14, 2018 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/69359f8c47479df947d2a66d076020c6 to your computer and use it in GitHub Desktop.
Save jfversluis/69359f8c47479df947d2a66d076020c6 to your computer and use it in GitHub Desktop.
Enumerating all the fonts in an iOS app
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
// Nifty helper to get all fonts with the right names in your console
#if DEBUG
var fontList = new StringBuilder();
var familyNames = UIFont.FamilyNames;
foreach (var familyName in familyNames)
{
fontList.Append(String.Format("Family: {0}\n", familyName));
Console.WriteLine("Family: {0}\n", familyName);
var fontNames = UIFont.FontNamesForFamilyName(familyName);
foreach (var fontName in fontNames)
{
Console.WriteLine("\tFont: {0}\n", fontName);
fontList.Append(String.Format("\tFont: {0}\n", fontName));
}
};
#endif
// ... Rest of the initialisation code here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment