Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2549 closed defect (worksforme)

Add support for joining in Farsi/Hebrew (right-to-left) labels

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.2 release
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: aboudreault, assefa, woodbri, project10


Ticket #956 added support for right-to-left labels using the FriBidi? library, but that still does not support joining of characters.

This ticket is about adding support for joining of characters. Sounds like FriBidi2 will include joining support and would be the way to go.

There was a thread on mapserver-users around 2008-03-12 with some useful information about this:

and that thread later on moved to mapserver-dev:

Change History (11)

comment:1 Changed 12 years ago by dmorissette

Some useful info from TC Haddad on the mapserver-users list:

The Arabic and Farsi are going to have identical joining issues. So if
your code handles Arabic it *should* cover Farsi no problem.

In general joined letters are used in the middle of a word (like
cursive handwriting in english). Most Arabic words are composed almost
exclusively of joined letters. There is no such thing as "print" vs.
"cursive" - you would never write a multi-letter word using unjoined
letters in Arabic.

Unjoined letters are used when characters stand alone - either because
they are single-letter words, or because certain characters stand
alone by convention when used at the beginning or end of a word (sort
of like bookends).

The joined vs. unjoined version of any letter is stored in the font
just as an English font stores both lower and upper case characters.

Although the Arabic and Farsi look very similar, they do use slightly
different alphabets (some characters (and sounds) exist in Farsi that
don't exist in Arabic - maybe also vice versa).

comment:2 Changed 12 years ago by woodbri

Here is the page with the appropiate links for information and downloads:

fribidi2 has been released as fribidi-0.19.1.tar.gz and can be downloaded from:

google for fribidi2 turns up lots of links, some with reported problems that might be helpful to sort out existing problems verses integration issues.

comment:3 Changed 12 years ago by project10

Cc: project10 added

I can confirm that MapServer works with version 0.19.1 of the FriBiDi? library on win32. FTR, MapServer now uses deprecated functions (as of version 0.19.1).

The arabic joining/shaping looks great!

I needed to make a Visual Studio project to build the .dll/.lib and was then able to link this into MapServer. If anyone has any interest I can try to roll up my VS project files so anyone who's interested could also build on win32.

comment:4 Changed 12 years ago by dmorissette

Resolution: worksforme
Status: newclosed

Closing as worksforme (nohing to do) since Fribidi v0.19.1 supports joining.

comment:5 in reply to:  4 Changed 11 years ago by mohmaher

Replying to dmorissette:

Closing as worksforme (nohing to do) since Fribidi v0.19.1 supports joining.

Project10 would you please send me the .dll/.lib that works with Mapserver.

I'm running Mapserver on Win32 and I need to solve this arabic characters problems without going into Mapserver code and recompilation.

Thanks in Advance

comment:6 Changed 11 years ago by assefa


You can get them from ms4w ( latest version 2.3.1, should have this fix.

comment:7 Changed 11 years ago by mohmaher

Sorry for being pushy..

But, I have the latest Binaries installed , and still the arabic is rendered in a reverse order ..

I'm using the ENCODING 'Windows-1256' in the Label section

Am I missing anything ?!

comment:8 Changed 11 years ago by assefa

I am not sure about the encoding value. The test data I used when testing this had an encoding of: ENCODING "CP1256". Could you try it with this encoding?

comment:9 Changed 11 years ago by mohmaher

Assefa ,

U r wonderful, "CP1256" did it.

Except almost one character which is the "J" or "Shift+j" in arabic keyboard of course.

Any Idea??

comment:10 Changed 11 years ago by assefa

Not really. You might have more luck on the fribidi mailing list or main Mapserver mailing list.

comment:11 Changed 11 years ago by mohmaher


Thanks again and again ..

Note: See TracTickets for help on using tickets.