Skip to content
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

fix: handle 2-bytes to 6-bytes unicode characters #58

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

ArTiSTiX
Copy link
Contributor

Fixes #54

Allow 2 to 6 bytes unicode characters to be recognized as glyphs.

Copy link
Owner

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test would be much appreciated here :)

@@ -30,6 +30,10 @@
content: '\f0ce';
}

.custom-content {
content: '\f0'; /* ð */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we assert that the font contains this in our tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to ensure it does not match all "\f0xx" unicodes from font icons.

@ArTiSTiX
Copy link
Contributor Author

@patrickhulce I tried to implement tests with font-awesome 6, but unfortunately, that's the only icon pack i know that uses 2-bytes glyphs, and since version 6, they no longer provide the SVG webfont used in test to check glyphset is correct.

I could add a custom pack generated by icomoon though...

@ArTiSTiX
Copy link
Contributor Author

@patrickhulce Thanks for inciting me to add the test, as i had to fix something.

I added a custom-font generated from icomoon.
Unfortunately, Icomoon does not put names on the TTF glyphs, so i had to convert the svg font back to ttf in FontForge (so it's not the original output from icomoon, even though it should work fine with the original ttf icomoon provides).

@patrickhulce patrickhulce merged commit 174cd6f into patrickhulce:master Mar 18, 2022
Copy link
Owner

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@ArTiSTiX
Copy link
Contributor Author

@patrickhulce Thanks for all the merges.

Are you planning to publish as 4.0.0 ?

@patrickhulce
Copy link
Owner

yep it's published @ArTiSTiX thanks for all your help!

@ArTiSTiX
Copy link
Contributor Author

Thanks a lot @patrickhulce !

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

Successfully merging this pull request may close these issues.

UNICODE_REGEX only finds 4 or 6-bytes glyphs
2 participants