BonMot icon indicating copy to clipboard operation
BonMot copied to clipboard

Not able to pass custom font added in xcode

Open poonamdhomane opened this issue 7 years ago • 1 comments

I have added open sans in plist , and asset bundle I can access that font in storyboard font dropdown, but using BonMot , app getting crash on font name (OpenSans-Bold)

poonamdhomane avatar Apr 20 '18 10:04 poonamdhomane

@iOSUser110 thanks for taking the time to write in! Would you mind posting the stack trace or error message of the crash? That will help us to debug it.

My guess is that the problem is not with BonMot, but with loading the font itself. Can you please try making a font like this? It will help us determine whether the issue is with BonMot, or with font loading in your project.

let font = UIFont(name: "OpenSans-Bold", size: 12)

If your app isn't able to load the font, the name could be incorrect. You can see all the fonts available on your system like this:

print(UIFont.familyNames)

And if you see OpenSans in the list, you can see available font faces (bold, italic, etc) like this:

print(UIFont.fontNames(forFamilyName: "OpenSans"))

ZevEisenberg avatar Apr 20 '18 13:04 ZevEisenberg