这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mapmeld
Copy link
Contributor

@mapmeld mapmeld commented Aug 2, 2025

In Unicode, codepoints such as 化 may appear as , , or depending on the lang tag of the element or page.
While testing the new vector tile layer on OSM, I noticed that switching the UI language between Simplified Chinese, Traditional Chinese, and Japanese updates the map labels in Firefox but not in Chrome. After some testing, I noticed that tiny-sdf has a similar issue in Chrome.

After setting ctx.lang = "zh-Hant" or relevant language, Chrome will respect the language tag.
This PR would add lang as an option in the constructor as in: new TinySDF({ lang: 'zh' })

Testing: I proposed a test, but the issue might exist in Node-Canvas too? I'm getting the same data from the two canvases.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants