Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to pass custom font added in xcode #335

Open
poonamdhomane opened this issue Apr 20, 2018 · 1 comment
Open

Not able to pass custom font added in xcode #335

poonamdhomane opened this issue Apr 20, 2018 · 1 comment

Comments

@poonamdhomane
Copy link

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)

@ZevEisenberg
Copy link
Collaborator

ZevEisenberg commented Apr 20, 2018

@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"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants