And perhaps we could remove the option at mapnik 3.x and replace with wrap-characters which would be a list of unicode characters of which to wrap on.
More details on how confusing this parameter can be: http://support.mapbox.com/discussions/tilemill/3290-wrap-character-syntax
wrap-character is ignored in harfbuzz shaper. According to our Wiki:
wrap-character -- Use this character instead of a space to wrap long names. (Harfbuzz branch ignores this and uses Unicode rules for line breaks.)
It wraps hyphenated names correctly based on those rules.
I'm inclined to remove this parameter all together as harfbuzz is a default shaper in 3.x.x
What if you want to wrap on a hyphen or dash? My sense it that is the case where a custom 'wrap-char' is needed. /cc @ajashton
@springmeyer - In 3.x.x we're using ICU::BreakIterator - it works well splitting unicode text. The only way to influence its behaviour is to pass custom word boundary rules to RuleBasedBreakIterator which can be complex.
Btw, hyphened text works!
What do you mean by 'dash' in this context?:)
As per chat with @artemp I'm on board with 1) the new in master/3.x ICU::BreakIterator behavior being a major improvement and basically solving this ticket automatically, and 2) therefore we should remove the wrap-character option. Tracking the latter task in #2333
Btw, hyphened text works!
This is a real nightmare for Russian cartography, because here we are using a dash instead of space for splitting words in almost all geographic names of the world (with 2 and more words).
And for hyphenated names we are using this
form instead of
@Andrey-VI can you explain in more detail?
@Andrey-VI - we need more details! Could you provide some visual examples, please
We are using wrap-width property in our styles. This is useful in most situations.
In Russian cartography there are special rules and exceptions to them. So here we have (note the dash):
Великий Новгород (Velikiy Novgorod) and Санкт-Петербург (Saint Petersburg),
Солт-Лейк-Сити (Salt Lake City) and Новый Орлеан (New Orleans).
With small wrap-width values in Mapnik < 3.x these names looks like
Not looks good for names with dash, but at least looks right.
In Mapnik 3.x these becomes
is not right and must be
- in front of Петербург and Сити indicates that these words are parts of a complex names and not are separate names. Such rules.
If I'm wrong about Mapnik 3.x behaviour, please correct me.
@Andrey-VI - I just merged master into layer-opacity so you can test yourself. Please create a new issue to track improvements you see as needed.
note: discussed moved over to #2333 (comment)