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
Text wrapping is wrong for RTL languages #189
Comments
[artem] 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. |
[Ldp] #409 has been marked as a duplicate of this ticket. |
[adamk] 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! |
[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. |
[Esperanza36] No news about this bug ? |
[dimka] I propose a quick and dirty patch. The patch is against http://svn.mapnik.org/tags/release-0.7.1 |
[springmeyer] dimka, great that you are taking a look at this! I think the most critical thing is to have good, ultra simple, testcases. So that we can easily ensure there are no regressions, and troubleshoot the various inter-related RTL/Unicode issues at http://trac.mapnik.org/wiki/InternationalText. By simple I mean just a ~30 line XML file that reads from a file (like a shapefile or geojson) with just one feature with the text in question along with an image displaying how the text should look. Can you draft up something like that to go along with your patch, and then attach the before and after images? |
[dimka] Please see attached archive.
Is that what you had in mind? |
[dimka] Any chance the patch gets promoted? |
[springmeyer] Hey. Test case looks right. I will try to take a look ASAP. I've assigned to 2.0 milestone to remind us to take a closer look in the next two weeks, but most likely this will take more time because of the need to test it's relationship to other patches in conflict. |
[springmeyer] #364 breaks this patch according to reporter there. Needs review if the two can be integrated. |
[springmeyer] #364 got applied, so I'm assuming this is now broken, so it needs either updating or just someone to review it. Dmika? for now pushing off till next release as mapnik2 is getting cut anytime now :) |
[dimka] Replying to [comment:16 springmeyer]: The new patch works against the current trunk, with the patch from [ticket:364] applied. The test case works. I've also checked that the OSM stylesheet renders correctly. Please consider adding to the upcoming release. |
[artem] Replying to [comment:17 dimka]:
Applied in r3365. Thanks! |
[artem] Replying to [comment:20 artem]: |
It seems that the effect of the patch was neutralized in this commit: |
re-opening. sorry about that. @herm - can you restore? |
@herm - if you need, see @dimkab 's original testcase attached to http://173.255.217.246:8000/mapnik_trac/ticket/189 |
The way RTL is currently handled is very ugly. I'm working on a better solution which should avoid this problem even in mixed RTL LTR cases. |
Any updates, as HarfBuzz released v1.0 |
Sorry, I forgot to update this bug report as it was already closed. RTL text should work in all circumstance now (in mapnik's harfbuzz branch). |
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.
The text was updated successfully, but these errors were encountered: