Custom Fonts Files

Hi,

I can’t use a font via a file.
I copy the ttf file on the device via a step builder, I have a plist file that works well with Xcode, when I check the ttf file is well present on the device.
Nevertheless I always have the same error: invalid argument
If someone had a clue or a source

Thanks

Erwan

What code are you using to use the font?

You need to reference it through its’ postscript name, not the filename.

Hello,

I am not sure what you mean by the postscript name in this context
The file has the name SFProRoundedBold.ttf.
I refer to SFProRoundedBold in my code as a string.
example:
Var myFile As FolderItem = SpecialFolder.Resource("/Fonts/SFProRoundedBold.ttf")

If myFile.Exists Then
System.DebugLog(“EXIST”)
//print EXIST so file is present
End If

var myPolice As New Font(“SFProRoundedBold”, 12)
//return error

Erwan

More details here on getting the font’s postscript name

1 Like

Thank you

It should be noted that according to Apple’s license agreement for the SFPro fonts, you’re not allowed to load those fonts and use them in your app. They’re for design only.

All I’m saying is that Apple may use this as an excuse to reject your app.

Not sure how they relate to each other, but according to iOSFonts.com, SanFranciscoRounded-Bold is already present on iOS devices.

Thanks for the info