Extend local ideographic font rendering to all East Asian wide characters
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
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:
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/render/glyph_manager.js at _doesCharSupportLocalGlyph(), then compare its current block list with the Unicode Standard Annex #11 EastAsianWidth.txt data and the existing charHasUprightVerticalOrientation() precedent. Done means local glyph support returns true for every latest-release East Asian Fullwidth (F) or Wide (W) character without maintaining the limited curated list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, internationalization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100