san francisco font

I'm relatively new to mobile app development and right now I'm trying to change the current font for a label in my xaml to iOS's relatively new San Francisco font. I've tried using FontFamily="SF" and FontFamily="San Francisco" on my labels to see if it would work but no so far nothing has changed. If someone could post a quick example of using the font it would be greatly appreciated.

Tagged:

Best Answer

Answers

  • WindermereWindermere CAMember

    I was under the impression that it was a font that was already built-in. I didn't realize that I should've been treating it as a custom font.

    Thank you!

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    @Windermere It is the default system font on iOS 9+. Which version of iOS are you testing with?

  • StermsSterms Member
    edited February 2018

    If anyone stumbles upon this, I was able to get San Francisco to work via Xaml like so:

    <OnPlatform x:TypeArguments="x:String" x:Key="BoldFontFamily" Android="sans-serif" iOS=".SFUIText-Bold"/>
    <OnPlatform x:TypeArguments="x:String" x:Key="ThinFontFamily" Android="sans-serif-thin" iOS=".SFUIText-Light"/>
    <OnPlatform x:TypeArguments="x:String" x:Key="DefaultFontFamily" Android="sans-serif" iOS=".SFUIText"/>
    

    I looked at the meta-data returned by UIFont.SystemFontOfSize() for what the application refers to SF as.

Sign In or Register to comment.