Extend local ideographic font rendering to all East Asian wide characters #9362
Labels
cross-platform 📺
Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
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:
mapbox-gl-js/src/render/glyph_manager.js
Lines 127 to 130 in 3a293bd
(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 returntrue
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
The text was updated successfully, but these errors were encountered: