Modify

Opened 10 years ago

Closed 8 years ago

#3122 closed defect (fixed)

Mixed arabic/european text

Reported by: fidoez Owned by: team
Priority: minor Milestone:
Component: Core Version: tested
Keywords: arabic font Cc:

Description

JOSM has problems with mixed arabic/european text with brackets. see nodes id=297115870 and id=316791019. Furthermore the property list shows these values differently to the value editor. (JOSM version: 1788). The Renderers have this problem also. I will post that again at an adequate site. Browsers (IE and Firefox) do not have this problem, see http://www.openstreetmap.org/browse/node/297115870.

Attachments (0)

Change History (9)

comment:1 Changed 10 years ago by stoecker

Owner: changed from team to fidoez
Status: newneedinfo

You should describe what's wrong and how it would be right.

comment:2 Changed 10 years ago by fidoez

Owner: changed from fidoez to team
Status: needinfonew

I am not really an expert for arabic, but let's try - lock at the value of key=name:

node 297115870

correct would be: سقطرى (Suquṭra)
the properties-window shows: (Suquṭra) سقطرى
the change-value-dialog shows: سقطرى (Suquṭra) --- correct
the current-selection-window splits european and arabic part before and after the coords and id and mixes up all brackets chaotically

node 316791019

correct would be: حاديبو‎ (Ḥādībū)
the properties-window shows: ((Ḥādībūحاديبو‎ --- other representation as node 297115870
the change-value-dialog shows: حاديبو‎ (Ḥādībū) --- correct
the current-selection-window: like node 297115870

Summary

The Command Stack window shows a correct represenation if you change this nodes
The Relation Editor mixes the text up like the current-selection-window

comment:3 Changed 10 years ago by anonymous

same here with 2466

comment:4 Changed 9 years ago by stoecker

I fear the issue is related to the left/right right/left difference of Arabic. It works when texts are alone and fails when they are joined with other texts (probably also other reasons depending on the GUi element used to display). I have no idea how to solave that issue (dad the same problem in JOSM Wiki). Suggestions welcome.

comment:5 Changed 9 years ago by jttt

Have a look here - http://wiki.forum.nokia.com/index.php/KIJ000790_-_Inconsistency_in_displaying_the_text_which_contains_mixed_Latin_and_Arabic_characters

Difference between properties window and command stack window is that in command stack are enough latin characters - so Java don't try to right align them.

The issue can be fixed by adding \u200E (left-to-right mark) to string before displaying.

comment:6 Changed 9 years ago by stoecker

It seems that would need a detection if mixed text is used or plain right-to-left or we will turn around plain texts also which would be wrong as well.

comment:7 Changed 9 years ago by stoecker

Ticket #4886 has been marked as a duplicate of this ticket.

comment:8 in reply to:  6 Changed 8 years ago by xeen

Replying to stoecker:

It seems that would need a detection if mixed text is used

It appears this can be avoided rather easily by adding \U200E in front of the appended coordinates in DefaultNameFormatter. This issue is quite strange, I found that adding a "no direction" character, like an x makes most of the text display correctly as well. It appears there's some magic involved in the display of left/right parentheses.

Also for some reason everything that is input via the properties editor just displays fine without any patches.

Long story short, this simple patch fixes the issues described for me. If no concerns are raised, I will commit it in the next few days.

Index: DefaultNameFormatter.java
===================================================================
--- DefaultNameFormatter.java	(revision 4320)
+++ DefaultNameFormatter.java	(working copy)
@@ -165,7 +165,7 @@
             if (name == null) {
                 name = node.isNew() ? tr("node") : ""+ node.getId();
             }
-            name += " (" + node.getCoor().latToString(CoordinateFormat.getDefaultFormat()) + ", " + node.getCoor().lonToString(CoordinateFormat.getDefaultFormat()) + ")";
+            name += " \u200E(" + node.getCoor().latToString(CoordinateFormat.getDefaultFormat()) + ", " + node.getCoor().lonToString(CoordinateFormat.getDefaultFormat()) + ")";
         }
         name = decorateNameWithId(name, node);

comment:9 Changed 8 years ago by xeen

Resolution: fixed
Status: newclosed

In [4324/josm]:

(probably) fix #3122

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.