Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Loosen matching criteria for font icon characters #19

Closed
wants to merge 1 commit into from

Conversation

danielrearden
Copy link

Certain fonts, like material design icons, use characters whose encoding currently isn't recognized by the regex inside the cleanValue function. This change would allow the content property to include any character, even if the encoding doesn't start with f. It would also optionally allow a u to precede the encoding.

As an example, the css file included with the nativescript-material-icons library is compatible with nativescript-ngx-fonticon but not with nativescript-fonticon. There may be other icon fonts that this applies to as well.

@nameszian
Copy link

I need this merge to be done.

@farfromrefug
Copy link

I need this one too. In my case 'f' is replaced by 'e' (font from icomoon).
@danielrearden can you add this?
I might create a fork plugin as this does not seem to be updated or maintained

@danielrearden
Copy link
Author

@farfromrefug the proposed change should accommodate any single character in place of an f. I don't have the bandwidth to create and maintain a fork at the moment, but feel free to use this PR in it. If you do end up creating a fork, it'd be great if you could share it on here.

@farfromrefug
Copy link

@danielrearden you are right. Indeed that should work too! Will try and report

@farfromrefug
Copy link

@danielrearden decided to fork and publish. The new package is nativescript-akylas-fonticon.
Might need to get a better name if it is getting used :s
The fork has kind of your fix. I actually tried to make it much faster:

  • dont use regexp anymore, faster parsing
  • allow to use required css. That way the css can be bundle and snapshoted! No more need for asset and readTextSync!!!

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

Successfully merging this pull request may close these issues.

None yet

3 participants