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

Extend local ideographic font rendering to all East Asian wide characters #9362

Open
1ec5 opened this issue Mar 1, 2020 · 0 comments
Open
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@1ec5
Copy link
Contributor

1ec5 commented Mar 1, 2020

GL JS currently uses a locally installed font to render a limited set of CJK Unicode blocks, with the expectation that these blocks are fixed-width and thus compatible with TinySDF:

(isChar['CJK Unified Ideographs'](id) ||
isChar['Hangul Syllables'](id) ||
isChar['Hiragana'](id) ||
isChar['Katakana'](id));

(Same goes for gl-native.)

There are a number of other blocks that would be similarly compatible with TinySDF, such as CJK Symbols and Punctuation, CJK Compatibility Ideographs, and Enclosed CJK Letters and Months (including the current Japanese era name, ㋿).

Rather than curate our own list of compatible Unicode blocks, we should rely on Unicode Standard Annex #11, which defines an “East Asian Width” property for every Unicode codepoint. _doesCharSupportLocalGlyph() should return true for any character listed as East Asian Fullwidth (F) or East Asian Wide (W) in the latest Unicode release’s EastAsianWidth data file. As of Unicode 12.1, 34 ranges are fullwidth and 237 ranges are wide, but the addition of these ranges won’t bloat the codebase by much, because most of the ranges consist of individual, adjacent characters and can be combined into fewer, larger ranges.

As precedent, charHasUprightVerticalOrientation() is already derived from another Unicode data file.

/cc @mapbox/gl-js @mapbox/language @chloekraw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant