Skip to content
This repository

Wrong right-to-left rendering if string contains numbers #519

Closed
artemp opened this Issue October 11, 2011 · 5 comments

4 participants

Artem Pavlenko Hermann Kraus Dane Springmeyer Claudius
Artem Pavlenko
Owner

If the string for a label contains any numbers besides right-to-left text (arabic, farsi, hebrew...) the whole string gets rendered on a character by character basis.
So instead of "نامجو 17" you will get "ن ا م ج و 17". See this example in Mapnik openstreetmap: http://www.openstreetmap.org/?lat=36.27183&lon=59.57726&zoom=17

The weird thing is that the right-to-left text direction stays intact for the letters, but they are not concatenated correctly within the charset.

Artem Pavlenko
Owner

[grille_chompa] The detection of writing direction for strings seems to break once a number occurs in the string.
If you look at http://osm.org/go/zY1pNe@v0-- where the square label "میدان 17 شهریور" has a number in middle, you see that pre-number (looking from right to left) word alphabets are separated but the post-number word is OK.

Hermann Kraus
Collaborator
herm commented June 24, 2012

Mapnik current doesn't perform the unicode bidirectional algorithm correctly. So it can't handle labels with both right-to-left and left-to-right character correctly. I'm rewriting the relevant part of mapnik and this problem should be gone in a few months.

Dane Springmeyer
Owner

/cc @grillechompa so he sees @herm's comment on the plan for this issue.

Claudius

Thanks for the heads up, Dane.

FYI: The problem does not occur any more on the OpenStreetMap.org mapnik rendering any more. Not sure if it has been fixed by any preprocessing from OSM or via OSM. The examples mentioned before all render okay now.

Hermann Kraus herm referenced this issue from a commit July 20, 2012
Hermann Kraus Update itemizer to allow operation on text ranges (for line breaking).
Fix handling of reordered text runs (refs #519).
a8cf131
Hermann Kraus herm closed this August 21, 2012
Hermann Kraus
Collaborator
herm commented August 21, 2012

Closing this ticket as the issue is solved in the harfbuzz branch. Refs #1428.

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.