wrap-character improvements #1467

Closed
springmeyer opened this Issue Sep 4, 2012 · 10 comments

Comments

Projects
None yet
3 participants
Owner

springmeyer commented Sep 4, 2012

In usage:

In code:

  • currently it is a char, and should really be a string, so we can support unicode wrapping

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

springmeyer added this to the Mapnik 3.x milestone Jul 29, 2014

artemp was assigned by springmeyer Jul 30, 2014

Owner

artemp commented Aug 4, 2014

@springmeyer

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

Owner

springmeyer commented Aug 4, 2014

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

Owner

artemp commented Aug 4, 2014

@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!

"This-is-a-test"
"This-
is-
a-
test"

What do you mean by 'dash' in this context?:)

/cc @ajashton

Owner

springmeyer commented Aug 4, 2014

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

springmeyer closed this Aug 4, 2014

@artemp

Btw, hyphened text works!

"This-is-a-test"
"This-
is-
a-
test"

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

This-
-is-
-a-
-test

form instead of

This-
is-
a-
test
Owner

springmeyer commented Aug 5, 2014

@Andrey-VI can you explain in more detail?

springmeyer reopened this Aug 5, 2014

Owner

artemp commented Aug 5, 2014

@Andrey-VI - we need more details! Could you provide some visual examples, please

Okay.
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
Великий
Новгород

Санкт-
Петербург

Солт-Лейк-
Сити

Новый
Орлеан
.
Right?

This
Санкт-
Петербург

Солт-Лейк-
Сити

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.

Owner

springmeyer commented Aug 12, 2014

@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.

springmeyer referenced this issue in mapnik/mapnik-reference Sep 4, 2014

Closed

Document wrap-char changes in Mapnik 3.x #70

Owner

springmeyer commented Sep 14, 2014

note: discussed moved over to #2333 (comment)

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