tangrams / tangram

WebGL map rendering engine for creative cartography
https://tangram.city
MIT License
2.22k stars 290 forks source link

Right paren enclosing right-to-left translated names wrapping to the left of the name #621

Open drewwilliams opened 7 years ago

drewwilliams commented 7 years ago

TANGRAM VERSION:

0.14.2

ENVIRONMENT:

macOS 10.13.1 (17B48) Safari 11.0.1 (13604.3.5) Chrome 62.0.3202.94 (Official Build) (64-bit)

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

RESULT:

For right-to-left languages, the right paren enclosing the translated name appears to be wrapping to the left of the name:

screen shot 2017-11-16 at 07 23 52

EXPECTED RESULT:

Would expect the enclosing right paren to remain on the right side of the name:

screen shot 2017-11-16 at 07 24 05

Here’s a sample section of my .yaml file that’s calling the translated name:

ux_language_text_source: | function() { if (typeof feature['name:'+global.selected_language] === "undefined") { return feature['name']; } else { return feature['name'] + '\n(' + feature['name:'+global.selected_language] + ')'; } }

Possibly related to https://github.com/tangrams/tangram/issues/541 “RTL curved label text flips order of punctuation/spaces” (closed)?

bcamper commented 7 years ago

Thanks for the report, will check it out. Not sure yet but I suspect the issue may be related to mixed LTR/RTL text in the same label. I think that some of the RTL handling may currently only work properly for labels that are all RTL.

matteblair commented 7 years ago

Curiously, these labels are presented correctly in Firefox 57 on macOS. screenshot-2017-11-16 true toponyms

bcamper commented 7 years ago

That is an interesting clue! And should help with debugging for sure.

drewwilliams commented 7 years ago

Firefox 57 does look better, which is interesting.

Still seeing this issue when the translated name splits to two lines:

screen shot 2017-11-16 at 11 29 25