How to preserve the leading/tailing spaces in text?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
mapbox-gl-js version: v0.42.2
Question
The leading/tailing spaces look not rendered on the map.
In my test, there are some text like " 15 " was rendered as "15", with anchor at left, the text is kind of offset left a bit, and if the text has rotation, the offset is in another rotated direction as well.
So, the question is, is there any way to render the leading/trailing spaces in a text in MapBox GL JS?
I did some search, didn't find a way to render the leading spaces to make the text location better.
Any suggestion would be much appreciated!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported rendering of " 15 " in Mapbox GL JS v0.42.2 with a left anchor and text rotation. Trace the existing text-rendering behavior to determine whether leading and trailing spaces can be preserved; done means establishing supported behavior or a clearly documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- computer-graphics, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100