-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Better line breaking #188
Comments
Note that we have to do this on the server when we calculate the shaping with pango. Pango accepts a maximum width and wraps according to writing direction. |
If the server added an indication of where breaking is allowed, and the direction of the text, could we do the rest on the client? |
Just curious where we are on this. POI labels are particularly troublesome without line-wrapping: tracking for Outdoors style: https://github.com/mapbox/gl-ported-maps/issues/2 |
@springmeyer What do you think of @ansis' suggestion? I've seen how |
Yes, @ansis's suggestion sounds reasonable to me. Variable |
Opened mapbox/node-fontnik#28 |
we might be able to do this in the browser. https://github.com/devongovett/linebreaker The table could probably be compressed and/or simplified well enough for our needs. The algorithm itself is pretty simple |
This will eventually need to break on more than just spaces, using the Unicode line breaking algorithm referenced by @ansis. http://www.unicode.org/Public/7.0.0/ucd/LineBreak.txt |
I think what we have after 53b81da is good enough for now. |
It should be possible to set a max label width and then line-wrap.
The text was updated successfully, but these errors were encountered: