LiveUI / Awesome

FontAwesome 6 Swift & SwiftUI implementation for iOS, tvOS & macOS
MIT License
97 stars 27 forks source link

Could not register the CGFont #22

Closed beamercola closed 5 years ago

beamercola commented 5 years ago

I'm getting this error, but only with Brands. only: [.regular] works fine. I've dropped and linked all the files to targets. I'm using latest font files from fontawesome (webfont ttfs).

have you seen this before?

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'The operation couldn’t be completed. (com.apple.CoreText.CTFontManagerErrorDomain error 105 - Could not register the CGFont '<CGFont (0x600002b71500): FontAwesome5BrandsRegular>')'
rafiki270 commented 5 years ago

You need otf or ttf files for ios

beamercola commented 5 years ago

@rafiki270 Oh cool. Ok I dropped OTF files and they worked. Good to know. Something not working with Brands TTF.

syky27 commented 5 years ago

For future reference I was getting this error, because I was using icon from the Pro pack inside statically initialized variable, which evaluates before .didFinishLaunching... where I register the pro font

This was hard to find especially when you have wrapper around AwesomeEnum such as Image.userFriendlyIconName(). So you forget when you are are using AwesomePro

And I was a pig and the diff was larger than should be...

Cost me good 15 minutes to find it... So this might help someone...