Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode rendering problem on waterways labels. #56

Closed
rdunklau opened this issue Aug 14, 2012 · 5 comments
Closed

Unicode rendering problem on waterways labels. #56

rdunklau opened this issue Aug 14, 2012 · 5 comments

Comments

@rdunklau
Copy link

There seeems to be a bug in the waterways labels, with unicode.

I don't really know if this bug should be reported to you, or to mapnik.

The following label definition implicitly convert from unicode to "something-else", resulting in accented letters being replaced by the infamous interrogation mark:

[type='stream'][zoom=18] {
    text-name: "[name].replace('([\S\ ])','$1 ')";
}

This could be fixed on your side by not doubling the spaces, or by performing the work in-db, which doesn't lose the encoding.
This is the solution I implemented (by manually editing the mapnik xml export).

The following code demonstrates how this could be done in your json format:

 {
      "Datasource": {
        "dbname": "osm",
        "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34",
        "geometry_field": "way",
        "id": "waterway_label",
        "key_field": "",
        "project": "foss4g-2011",
        "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
        "table": "( SELECT way, waterway AS type, regexp_replace(name,  '(\s)', '\1 ', 'g')
 \n FROM planet_osm_line\n WHERE waterway IN ('canal', 'river', 'stream') \n AND name IS NOT NULL\n) AS data",
        "type": "postgis"
}
@Bear4
Copy link

Bear4 commented Sep 26, 2014

I have the same problem too.
At labels.mss [line 350 to 352]
When
#waterway_label[type='river'][zoom>=13], - it;s ok.
#waterway_label[type='canal'][zoom>=15], - not ok. ( missing some polish letter )
#waterway_label[type='stream'][zoom>=17] - not ok. ( missing some polish letter )

I have trying at palette.mss update line 27

@sans_italic: from: "Open Sans Semibold Italic","DejaVu Sans Italic","unifont Medium";
to: "Vivaldi Kursywa", "Unifont Średnia"

without success. Still missing characters.

How I can update fonts at file styles?

@springmeyer
Copy link

@Bear4 can you post an image of what you are seeing? It may be that your Mapnik installation's boost_regex lib is not properly linked to ICU. Can you say how you built boost and mapnik?

@Bear4
Copy link

Bear4 commented Sep 29, 2014

Zoom 13 with watherway_label everything it's ok.
level_13
Zoom 14 it's not ok.
level_14
And this error occurs olny at wather_label zoom >= 14, everything else it's ok.
So I think it's not problem with Mapnik instalation.

Problem is with polish fonts, polish characters.

@Bear4
Copy link

Bear4 commented Sep 29, 2014

When replace:
labels.mss line 364, 369, 374:
form: text-name: "[name].replace('([\S\ ])','$1 ')"; to: text-name: '[name]';

the problem disappears...

@ajashton
Copy link
Member

That line is a workaround to for an old Mapnik bug where text-character-spacing did not work for text along a line. That bug is now fixed. I just removed that hack to keep the style simpler and fix this issue.

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

No branches or pull requests

4 participants