Skip to content

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

Open

Description

@1ec5

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-platform 📺Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions