home-assistant / Iconic

:art: Auto-generated icon font library for iOS, watchOS and tvOS
Apache License 2.0
1.58k stars 86 forks source link

Iconic methods are not accessible. #34

Closed shshalom closed 8 years ago

shshalom commented 8 years ago

It seems you've forgot to set access control in Iconic class.

dzenbot commented 8 years ago

Which APIs are you trying to access? You should only use the APIs from the auto-generated class.

shshalom commented 8 years ago

This one in particular: Iconic.registerFont("FontAwesome", map: FontAwesomeIconMap) But in general I've notice that I can't even extend using extension because the entire class is set as internal by default.

dzenbot commented 8 years ago

Isn't this related to https://github.com/dzenbot/Iconic/issues/33?

shshalom commented 8 years ago

No, that's an unrelated to #33. The ReadMe file shows this:

You can also register the font with its family name and unicode mapping:

Iconic.registerFont("FontAwesome", map: FontAwesomeIconMap)

But registerFont method is not exposed as public.

dzenbot commented 8 years ago

Totally forgot to update the docs. Sorry about that!

dzenbot commented 8 years ago

In theory, you should not need to call Iconic.registerFont("FontAwesome", map: FontAwesomeIconMap) anymore since registerIconFont() does it for you internally.

shshalom commented 8 years ago

Got it. while we're at it, if I provide a font that is a custom font which was built over another FontAwesome file, with different name and different icons... the generated class creates this: Iconic.registerFont("FontAwesome", map: MyFontIconMap) Notice that it sets the "FontAwesome" instead of "MyFont".

That's another reason for asking to expose registerFont as public.

dzenbot commented 8 years ago

That is because it grabs the font's postscript name to create the class and specially, to register to the font manager.

shshalom commented 8 years ago

I figure that much, I guess I could edit the file and change the postscript name to solve this.

dzenbot commented 8 years ago

I generally use Glyph app for editing font files.