Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Break lines on com­mon­ly un­spaced punc­tu­a­tion #2598

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Oct 12, 2015

This PR breaks lines in labels on commonly unspaced punctuation, par­ti­cu­lar­ly hy­phens (important in French-speaking regions) and soft hy­phens (important in Welsh, Thai, and Māori-speaking regions).

Before:
montreal-before

After:
montreal-after

Stress test:

taumata­whakatangi­hanga­koauau­o­tamatea­turi­pukaka­piki­maunga­horo­nuku­pokai­when­ua­ki­tana­tahu

Fixes #2595.

/cc @ansis @nickidlugash @mikemorris @peterqliu

@1ec5 1ec5 self-assigned this Oct 12, 2015
@friedbunny
Copy link
Contributor

Love everything about this.

@nickidlugash
Copy link
Contributor

Awesome 👍

@mikemorris
Copy link
Contributor

This is great @1ec5 👍

@peterqliu
Copy link
Contributor

👏

Par­ti­cu­lar­ly hy­phens and soft hy­phens.

Fixes #2595.
@1ec5 1ec5 force-pushed the 1ec5-taumata­whakatangi­hanga­koauau­o­tamatea­turi­pukaka­piki­maunga­horo­nuku­pokai­when­ua­ki­tana­tahu-2595 branch from 488a220 to 5979994 Compare October 13, 2015 16:54
@1ec5 1ec5 merged commit 5979994 into master Oct 13, 2015
@1ec5 1ec5 removed the in progress label Oct 13, 2015
@1ec5 1ec5 deleted the 1ec5-taumata­whakatangi­hanga­koauau­o­tamatea­turi­pukaka­piki­maunga­horo­nuku­pokai­when­ua­ki­tana­tahu-2595 branch October 13, 2015 17:12
@ajashton
Copy link
Member

Flagging a minor issue with this - different languages have different conventions for wrapping on a hyphen. This came up previously in the Mapnik project. I'm not sure what's needed to support multiple wrapping styles - seems like it would have to be an option & implemented in the gl-style-spec?

@mikemorris
Copy link
Contributor

@ajashton Eventually line-breaking should be handled by Harfbuzz.

@1ec5
Copy link
Contributor Author

1ec5 commented Oct 13, 2015

Yes, this PR is but a stopgap for a very common case. Languages have different conventions for wrapping on spaces, too, but we currently ignore those conventions for simplicity’s sake. Employing Harbuzz would address a number of other text wrapping issues like #1223 that we aren’t prepared to think about quite yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants