-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Support for Displaying Japanese Long Vowel Mark (ー) in Vertical Layout #5259
Comments
The underlying issue is that GL JS incorrectly assumes a one-for-one correspondence between Unicode codepoints and glyphs. The font above has two different glyphs for the same codepoint: one horizontal, one vertical. This assumption is closely tied to the glyph PBF format. Eliminating glyph PBFs in favor of client-side text segmentation (as in #4550) would get us closer to a solution, though TinySDF would still need to render the text segment as vertical text. For TinySDF, the Canvas API supports right-to-left text, but I don’t see an option related to vertical text corresponding to the As a workaround, GL JS can currently substitute a vertical glyph for a number of punctuation marks. However, this relies on a limited set of CJK Compatibility Forms that Unicode includes for backwards compatibility with legacy encodings. Unfortunately, chōonpu doesn’t appear to have a compatibility form in Unicode. There is a somewhat similar-looking ︱ character, technically a vertical em dash. Would this be less confusing than the current ー in vertical text? |
The following is a conversation about this, to some extent: |
@chizutodesign you could make a MapLibre font PBF file based on Noto Sans with the OpenType vert feature enabled using maplibre/font-maker. You could call this MapLibre font someting like If you want to read more about text limitations in MapLibre you can have a look at https://oliverwipfli.ch/about-text-rendering-in-maplibre-2023-10-17/ |
@wipfli Thank you for the advice. |
@chizutodesign I made a font with top-to-bottom text direction using a modified version of font-maker that uses HarfBuzz for glyph lookup. Please have a look at the demo at https://jsbin.com/xebasetibi/edit?html,output and let me know if the font looks correct to you. If everything looks correct I can share the modified version of font-maker. |
Ellipses ... and parenthesis () apparently also get rotated by 90 degrees: |
MapLibre already does this automatically using the compatibility codepoints I mentioned earlier. So you might be looking at the compatibility glyphs rather than the ones rotated on the server side. By the way, I forgot to mention that that existing functionality also makes some replacements beyond what the OpenType feature would probably provide, such as “ to ﹁. If there is a codepoint that reliably looks like the desired vertical mark, even if it’s semantically unrelated, we could implement a similar replacement. |
@chizutodesign what is your preferred solution, do you want to change the replacement behavior of MapLibre GL JS or do you want to use a modified font? |
User Story
Rationale
Why is this feature needed?
What are some example use cases?
Can it be done today? Is there a workaround?
Impact
Additional Context
Japanese fonts typically include vertical-specific glyphs to handle vertical typesetting properly. For example:
Supporting the vert feature in MapLibre GL JS would enable proper vertical text rendering without requiring manual adjustments or workarounds. This improvement aligns with the goal of providing high-quality map rendering for diverse languages and regions.
The text was updated successfully, but these errors were encountered: