Skip to content


Subversion checkout URL

You can clone with
Download ZIP


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

artemp opened this Issue · 5 comments

4 participants


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:

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.


[grille_chompa] The detection of writing direction for strings seems to break once a number occurs in the string.
If you look at 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.

@herm herm was assigned

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.


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


Thanks for the heads up, Dane.

FYI: The problem does not occur any more on the 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.

@herm herm referenced this issue from a commit
@herm herm Update itemizer to allow operation on text ranges (for line breaking).
Fix handling of reordered text runs (refs #519).

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

@herm herm closed this
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.