-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Support for Duotone in Pro fonts #223
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@thii any ideas? I added it to one of my projects, but couldn't see the light (i think?) part of the font when displayed. i think it might have to be only used with an UIImage, not sure though |
Just as an update, I've started investigating using the duotone fonts. Note that when using On that same note, is it possible to simply have the library draw the SVGs themselves? This may also relate to #230 when it comes to pro-only fonts |
This library supports drawing SVGs in a UIView or CALayer, although this would need some further finagling. Another enum for SVGs could be generated using the @thii thoughts? |
it's merged #247 |
To clarify: This does not actually add support for rendering duotone fonts. It only fixes an issue when it comes to parsing the metadata. Therefore, it's not actually relevant to this issue, but is relevant to #230 |
I will upload a new PR that I fixed this issue |
It would seem that SVGs are included in both Free and Pro metadata files, which is good news. This may take some further investigation, especially when it comes to rendering In the short term, it's possible to make the SVG paths available as a property of the enum. Since only duotone icons have an array for the SVG path, it can simply be a property like |
@MatrixSenpai check this #250 |
@MoElnaggar14: As @MatrixSenpai said: Your patch might fix the issue with parsing the metadata. But it does not help to render the duotone icons correctly! I agree with @MatrixSenpai that this can only be done for images, as with fonts you can have a different color per letter but not a letter with two colors. To make the SVG part of the enum sounds sensible to me. It will increase the size of the library (and app size) quite a bit though. But this is probably the price we'll have to pay. It looks like at the moment only one path is rendered from the font when selecting the duotone style. If we can managed to render the second part somehow separately, we could then overlay the two renderings. But I have no clue if this is at all possible. |
@ghowen I think it's not possible for SVG part |
My thoughts are to add a new generated plist that has the SVG paths in it. We can load and unload that data from memory at will. There's a price to pay in terms of performance, but we reduce our footprint in memory. If I recall correctly, an enum is loaded in at runtime to memory, but if we're using these only in places that support images (i.e. As for the PR, I've left my comments on that, but I will say here that it doesn't solve the issue, it only adds capability. I tried that method unsuccessfully. It's going to have to be rendered as an SVG because iOS doesn't have the ability to, as @ghowen said, use separate colors for a single char |
No need for SVGs, fortunately. Duotone is accessible to us from the ligature-based font file. Here's a lil taste. That being said, |
I haven't worked with ligatures before, great find! I definitely like the way that's moving. I agree, we may have to move this to a new project entirely though |
Wow, if we can do this with ligatures instead of SVG, this would be great. Re. new repo: Ideally we could do an in place update, so people would not need to touch their apps. Are breaking changes necessary? |
I downloaded #245 and tried to test it with duotone icons, but the demo app for iOS crashes in
It does work with all other pro styles and icons though. I am using the fonts from the "Pro Desktop Download" of FA Pro 5.13, as they supposedly have the ligatures. BTW: Currently the folks from FA do not recommend to use font files for duotone:
@chriszielinski How did you get the screenshot in #223 (comment) rendered? |
Font Awesome 5.10 adds a new font type: Duotone. Be awesome to have that available!
The text was updated successfully, but these errors were encountered: