mathiasbynens / emoji-test-regex-pattern

A regular expression pattern for Java/JavaScript to match all emoji in the emoji-test.txt file provided by UTS#51.
MIT License
98 stars 17 forks source link

Output a valid CSS `unicode-range` value #13

Closed mathiasbynens closed 2 years ago

mathiasbynens commented 2 years ago

The generated code contains an entry for every single code point that occurs in any of the emoji sequences.

Issue: #12

mathiasbynens commented 2 years ago

@rsheeter Note that the output includes e.g. U+23 (#) and ASCII digits, even though one wouldn’t want a font to render those as emoji by themselves. Is that desired? I’m imagining an emoji font would only include the “ligatures” for the full emoji sequences, and would ignore/fallback on lone characters otherwise, i.e.

Does this match what you have in mind?

rsheeter commented 2 years ago

the output includes e.g. U+23 (#) and ASCII digits, even though one wouldn’t want a font to render those as emoji by themselves

Unfortunately you have to include U+0023 or else the keycap won't use the emoji font. It's up to the emoji font to decide if it wants to draw naked U+23 or not. Unfortunately the browser will download the emoji font just to try that so ideally one would be somewhat careful about what one assigns the emoji font to.

An abnormally sophisticated user might place a unicode-range with some of the individual things that should not use the emoji font into their css at higher priority than the emoji font.