Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Spacing of some text with TextSymbolizer is odd #1532

Closed
herm opened this Issue · 4 comments

3 participants

@herm
Collaborator

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

@herm herm was assigned
@kayD

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
Collaborator

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

@herm herm referenced this issue from a commit
@herm herm Fix glyph widths after line breaking.
Fixes #1532.
74d72b9
@herm
Collaborator

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

@herm herm closed this
@springmeyer
Owner

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

@springmeyer springmeyer referenced this issue from a commit
@springmeyer 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
64d5153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.