Giter Club home page Giter Club logo

Comments (11)

salisbbn avatar salisbbn commented on May 16, 2024 1

I'm not. Though I did try it that way too, just for kicks :)

from iconic.

salisbbn avatar salisbbn commented on May 16, 2024 1

Ok - I figured out what was going on. If the font file is part of the Copy Bundle Resources build phase then Iconic can't register the font because it gets automatically registered by the OS just by being part of that build phase - even if the font is not declared as an app provided font in the plist.

Removing the font file from the Copy Bundle Resources phase fixed the issue. Perhaps, as a future enhancement, Iconic could check if the font has already been registered, and, if so, ignore the error and continue with its initialization.

from iconic.

dzenbot avatar dzenbot commented on May 16, 2024

So this error is triggered as soon as you call Iconic.registerIconFont() then?
Would you mind sharing your icon font file? I have not seen this on the ones I use.

from iconic.

salisbbn avatar salisbbn commented on May 16, 2024

That's right, I think the error is triggered around line 192 causing configure(withURL: url, name: fontName, map: map) to never get called.

Here's the font file I use:

Linearicons-Free.ttf.zip

from iconic.

dzenbot avatar dzenbot commented on May 16, 2024

I just tried the font file in the sample project, and all works as expected:
image

I pushed this into a branch, so you can test it out and compare it with your setup.
https://github.com/dzenbot/Iconic/tree/linearicon-sample

(I love the icons btw, very cool! Specially the 💩)

from iconic.

salisbbn avatar salisbbn commented on May 16, 2024

Thanks - I tested the sample project - it's working as expected just like mine used to. I did a line-by-line comparison of the generated files and everything is the same. I checked the size of the binary and there is a difference there, but it seems a little crazy to think that a build setting somewhere is causing hiccup, especially when I swapped in a different icon file (Fontawesome) and everything worked. Changing back to Linearicons still produces the "already registered" error though.

Will keep digging.

from iconic.

dzenbot avatar dzenbot commented on May 16, 2024

Let me know if you find anything.
I ran the pod installation a few times, plus added new dependencies, just for testing, and it still worked.

By any chance, are you also adding the Linearicons to your plist?

from iconic.

dzenbot avatar dzenbot commented on May 16, 2024

That is so strange! I will def. put something on the README about this, and will see if there's a way Iconic could skip registering but continue with its initialisation to mitigate this error. Thanks for the headsup!

from iconic.

dzenbot avatar dzenbot commented on May 16, 2024

@salisbbn: I've been trying to reproduce your error without success. Would you mind providing a sample project with it? So I can know if there is an error code Iconic could observe and handle it correctly.

from iconic.

salisbbn avatar salisbbn commented on May 16, 2024

@dzenbot Here's the sample project that exhibits the behavior.

A couple of notes - it looks like that in addition to the font file being part of the Copy Bundle Resources build phase, the font also needs to be used somewhere in the IB (I added a quick label to Main.storyboard -> ThirdViewController). If either of those two conditions aren't met, no failure will occur. The font needed to installed on my machine for it to pop up in the IB's font selector (screen shot below).

One other note - I had to move Iconic.registerIconFont() to func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?)... when it was part of init() it fell into a semaphore wait trap. Odd.

Iconic.zip
screen shot 2016-08-23 at 8 00 52 am

from iconic.

salisbbn avatar salisbbn commented on May 16, 2024

Yep, this seems to have done the trick. Thanks!

from iconic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.