-
-
Notifications
You must be signed in to change notification settings - Fork 306
Description
As of maplibre/maplibre-gl-js#6640, MapLibre GL JS v5.13.0 and above is capable of rendering characters beyond Unicode codepoint U+FFFF (65,535), up to the last codepoint in the Unicode standard at U+10FFFF. However, Martin only serves up ranges through U+FFFF:
martin/martin-core/src/resources/fonts/mod.rs
Lines 35 to 36 in 6fa528d
| /// Maximum Unicode codepoint supported (U+FFFF - Basic Multilingual Plane). | |
| const MAX_UNICODE_CP: usize = 0xFFFF; |
Support for non-BMP characters is important for supporting CJKV place names, historic writing systems, and place names in indigenous languages. If the range is unavailable from the server, GL JS falls back to a font from the local environment, such as a system font or a Web font pulled into the webpage using CSS. However, many devices lack the fonts necessary for these codepoints, or the operating system disables these fonts to save memory, or the only available fonts are low-quality pan-Unicode fonts.
If a designer has decided to use server-renderer fonts, Martin could serve any requested range rather than limiting it to the BMP. This should be compatible with other clients, which simply wouldn’t request non-BMP ranges. Eventually, I anticipate that support for alternative font technologies would improve so that this use case would no longer require font resources from Martin, but as long as Martin serves up fonts, it might as well serve them up in full.