Skip to content
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

[Bug] There is an issue with text rotation when using text-keep-upright #5404

Open
jklee84 opened this issue Jan 25, 2025 · 6 comments
Open
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed

Comments

@jklee84
Copy link

jklee84 commented Jan 25, 2025

maplibre-gl-js version: 5.0.1

browser: chrome (latest)

Steps to Trigger Behavior

  1. Set symbol-placement in layout to line
  2. Set text-keep-upright in layout to true
  3. Check the map
  4. The text rotates to follow the line, but numbers do not rotate as expected

Link to Demonstration

https://jsbin.com/hucaripeja/

Image

Expected Behavior

  • text-keep-upright should provide a consistent display when symbol-placement is set.
  • It would be ideal if numbers between CJK characters were oriented in the same direction as the CJK characters.

Actual Behavior

  • The behavior differs depending on whether the text is in a CJK language.
Image
@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Jan 25, 2025
@HarelM
Copy link
Collaborator

HarelM commented Jan 25, 2025

Thanks for taking the time to report this issue.
Can you please create a jsbin/codepen to showcase this bug?

@jklee84
Copy link
Author

jklee84 commented Jan 25, 2025

Thanks for taking the time to report this issue. Can you please create a jsbin/codepen to showcase this bug?

@HarelM Thanks for your attention.

I created an example here:
https://jsbin.com/hucaripeja/

I also tried to fix these problems. #5405
Result is here.

Image

@HarelM
Copy link
Collaborator

HarelM commented Jan 25, 2025

Thanks! @1ec5 can you take a look at this?
A PR, even a draft one, would be better to see the code changes, and see if it affects other tests...

@jklee84
Copy link
Author

jklee84 commented Jan 25, 2025

@HarelM Got it. I’ll create a PR. I hope it gets welcomed! :)

jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
@1ec5
Copy link
Contributor

1ec5 commented Jan 25, 2025

This feature is called tate-chu-yoko in Japanese and also occurs in Korean (not sure what it’s called there). I agree that this would be very good to have. Not only digits but also Latin letters should remain upright as long as they aren’t part of a longer run of Latin text.

Example of Latin letters in normal orientation.

In Japanese, it’s possible to combine two or sometimes three Western characters in the same frame as well. Multi-character tate-chu-yoko would be an extra nicety, but probably not as important as single-character tate-chu-yoko.

Example of European numerals in tate-chu-yoko (horizontal-in-vertical setting).

/ref mapbox/mapbox-gl-js#3588

@jklee84
Copy link
Author

jklee84 commented Jan 25, 2025

@1ec5 In korean say, "세로쓰기" (se ro ssu gi)
It means vertical writing. 😄

https://upload.wikimedia.org/wikipedia/ko/d/d8/Sero.png

jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
jklee84 added a commit to jklee84/maplibre-gl-js that referenced this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants