Spacing of some text with TextSymbolizer is odd #1532

Closed
herm opened this Issue Oct 13, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@herm
Member

herm commented Oct 13, 2012

Reported at https://groups.google.com/d/topic/mapnik/HUFGgRHiSy8/discussion

Hi,

I am using the harfbuzz branch of mapnik 2.1.x from Sept 23
(how do I find a version number?)

# git status
# On branch harfbuzz

and have a problem with spacing of texts: a few texts
are printed very "wide", see the picture here:
http://crite.net/fr/mapniktextsymbolizer1.png
It is the bold text stating the "maximum stay time" for
parking on the side of the streets in OSM.
The "60 min" text appears to be written like this:
"6 0 m i n", but no spaces are in the source text.

The command to create those text is:

<TextSymbolizer face-name="DejaVu Sans Bold" size="12"
  dy="15" placement="line" upright="auto"
  wrap-width="35" allow-overlap="1" fill="#50a100">
  [maxstay]
</TextSymbolizer>

All other texts look very nice (e.g. road names)
Can this be explained?

Kind regards,
Kay

@ghost ghost assigned herm Oct 13, 2012

@kayD

This comment has been minimized.

Show comment Hide comment
@kayD

kayD Oct 13, 2012

Hi,

I tried with the current version of mapnik-harfbuzz. Same problem.

Please find two screenshots here: http://crite.net/fr/60min.png

But I looked at a different area (see image top half), and found that the text (blue "60 min") is running out of the bounds of the actual way.

The top image is rendered with

<TextSymbolizer face-name="DejaVu Sans Bold" size="12"
 dy="15" placement="line" upright="auto"
 wrap-width="35"
 allow-overlap="1" fill="#50a100">[maxstay]</TextSymbolizer>

I guess it is a problem of this attribute: wrap-width="35". So I did
a second test without that attribute:

<TextSymbolizer face-name="DejaVu Sans Bold" size="12"
 dy="15" placement="line" upright="auto"
 allow-overlap="1" fill="#50a100">[maxstay]</TextSymbolizer>

Result: see bottom image, where the texts appear correct.

Hope this serves as a hint for the bug hunt.

Kind regards,
Kay

kayD commented Oct 13, 2012

Hi,

I tried with the current version of mapnik-harfbuzz. Same problem.

Please find two screenshots here: http://crite.net/fr/60min.png

But I looked at a different area (see image top half), and found that the text (blue "60 min") is running out of the bounds of the actual way.

The top image is rendered with

<TextSymbolizer face-name="DejaVu Sans Bold" size="12"
 dy="15" placement="line" upright="auto"
 wrap-width="35"
 allow-overlap="1" fill="#50a100">[maxstay]</TextSymbolizer>

I guess it is a problem of this attribute: wrap-width="35". So I did
a second test without that attribute:

<TextSymbolizer face-name="DejaVu Sans Bold" size="12"
 dy="15" placement="line" upright="auto"
 allow-overlap="1" fill="#50a100">[maxstay]</TextSymbolizer>

Result: see bottom image, where the texts appear correct.

Hope this serves as a hint for the bug hunt.

Kind regards,
Kay

@herm

This comment has been minimized.

Show comment Hide comment
@herm

herm Mar 27, 2013

Member

I can reproduce the problem now and will try to fix it. Sorry for the long wait.

Member

herm commented Mar 27, 2013

I can reproduce the problem now and will try to fix it. Sorry for the long wait.

herm added a commit that referenced this issue Apr 1, 2013

@herm

This comment has been minimized.

Show comment Hide comment
@herm

herm Apr 1, 2013

Member

Thank you for your detailed description. It helped me a lot to find the problem.

Member

herm commented Apr 1, 2013

Thank you for your detailed description. It helped me a lot to find the problem.

@herm herm closed this Apr 1, 2013

@springmeyer

This comment has been minimized.

Show comment Hide comment
@springmeyer

springmeyer Apr 1, 2013

Owner

Awesome work @herm. Fantastic to fix issues along with testcases!

Owner

springmeyer commented Apr 1, 2013

Awesome work @herm. Fantastic to fix issues along with testcases!

springmeyer pushed a commit that referenced this issue Nov 22, 2013

Dane Springmeyer
Improved support for international text
 - Implementation by @herm for GSOC 2012 (http://mapnik.org/news/2012/10/06/gsoc2012-status9/)
 - C++11 port, improvements, optimizations by @artemp
 - Testing and integration with master by @springmeyer
 - Thank you to all the support from @behdad along the way
 - Thanks for help testing @toton6868, @stephankn, @nirvn, @mfrasca, @simonsonc and many others

Refs: #2073,#2070,#2038,#2037,#1953,#1820,#1819,#1714,#1634,#1547,#1532,#1319,#1208,#1154,#1146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment