Ticket #189 (assigned defect)

Opened 20 months ago

Last modified 13 months ago

Text wrapping is wrong for RTL languages

Reported by: tomh Owned by: artem
Priority: normal Milestone: 0.8.0
Component: Core Library Version: 0.5.1
Severity: Normal Keywords:
Cc: a.dapper.dan.man@… Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: no
Design Decision Needed: no

Description

This was originally raised on the OSM trac (http://trac.openstreetmap.org/ticket/1515) and an example of the problem can be seen at http://www.openstreetmap.org/?lat=31.42411&lon=34.33985&zoom=16&layers=B000FTF.

When a label such as "مخيّم دير البلح" which is written in a right-to-left language like Arabic is rendered and has to be split across multiple lines the line splitting is done as if it was a left-to-right language.

So in this case it puts "البلح" on the first line and "مخيّم دير" on the second, but the first word of that name is actually "مخيّم" as this is an RTL language, so it is that which should be on the first line, and the rest of the text on the second line.

Change History

Changed 17 months ago by artem

  • status changed from new to assigned
  • milestone changed from 0.6.0 to 0.7.0

Good catch. Yes, it needs fixing. Jon Burgess pointed me to http://vimgadgets.sourceforge.net/liblinebreak/. It solves different problem but we can adopt some better strategies for text splitting in general. Moving to 0.7.0

Changed 13 months ago by Ldp

#409 has been marked as a duplicate of this ticket.

Changed 13 months ago by adamk

  • cc a.dapper.dan.man@… added

As I mentioned in #409, I'd love to help and fix this problem. All I need is some initial guidance to get me going - e.g which module/source-file seems to be the most relevant - and I'll continue on my own from there. Thanks!

Changed 13 months ago by springmeyer

Hey adamk,

Take a look at: source:trunk/include/mapnik/font_engine_freetype.hpp where much of the text code is. Also, likely a good idea to take a look at http://www.pango.org/ to get a sense of how they solve this problem.

Note: See TracTickets for help on using tickets.