Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created March 14, 2018 10:59
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/ceed81b2f28dc238261ee1ac699b6227 to your computer and use it in GitHub Desktop.
Save jfversluis/ceed81b2f28dc238261ee1ac699b6227 to your computer and use it in GitHub Desktop.
Custom font for iOS and Android in XAML
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:CustomFontsSample"
x:Class="CustomFontsSample.CustomFontsSamplePage"
Title="Custom Fonts">
<Label Text="Welcome to Xamarin Forms!" VerticalOptions="Center" HorizontalOptions="Center">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="ComicSansMS" />
<On Platform="Android" Value="ComicSaaaans.ttf#ComicSansMS" />
</OnPlatform>
</Label.FontFamily>
</Label>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment