Last active
February 15, 2016 10:42
-
-
Save sthewissen/0105914b4c63fd532fd2 to your computer and use it in GitHub Desktop.
Loop through the fonts on iOS to find the internal name as described @ http://bit.ly/20yzZ7i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Foundation; | |
using UIKit; | |
namespace CustomXamFormsFont.iOS | |
{ | |
[Register("AppDelegate")] | |
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate | |
{ | |
public override bool FinishedLaunching(UIApplication app, NSDictionary options) | |
{ | |
global::Xamarin.Forms.Forms.Init(); | |
LoadApplication(new App()); | |
// Lets log them to our output window. | |
LogFonts(); | |
return base.FinishedLaunching(app, options); | |
} | |
/// <summary> | |
/// Logs the installed fonts to the debug window. | |
/// </summary> | |
private void LogFonts() | |
{ | |
foreach (NSString family in UIFont.FamilyNames) | |
{ | |
foreach (NSString font in UIFont.FontNamesForFamilyName(family)) | |
{ | |
Console.WriteLine(@"{0}", font); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment