[OSM-talk] Fwd: [OSM-dev] arabic shaping support in Mapnik

Alilo 3alilo at gmail.com
Thu Oct 25 16:47:17 BST 2007


something is wrong with the list?? or with me?? I didn't push reply to all :(
anyway here is the email again
---------- Forwarded message ----------
From: Alilo <3alilo at gmail.com>
Date: Oct 20, 2007 10:15 AM
Subject: Re: [OSM-dev] arabic shaping support in Mapnik
To: Artem Pavlenko <artem.mapnik at googlemail.com>


Hi,

I have checked the picture of arabic shaping.

For the city name it is very good the letter are ordered from right to
left and the letters are correcty connected, there is only an error on
the first two letter that swithched (it should be read as AL , but I
read it as LA) , the correct rending is like this one on osmarender.
http://www.openstreetmap.org/?lat=34.00593991914768&lon=-6.837487833763365&zoom=13&layers=0BF

For the street names, the letters are not connected one to each other,
and there is the same problem with the AL and  LA.
here is the same area in osmarender:
http://www.openstreetmap.org/?lat=33.99970500733642&lon=-6.841081993064849&zoom=16&layers=0BF

The LA is special because in arabic LA is written in one shape and is
not written as L shape followed by the A shape, and in your test it
shows up correctly as LA in one shape.

give it a try: http://www.muftah-alhuruf.com/ g=L h=A

(btw LA means No in english and AL means The in english)


Many Arabic letters have 3 shapes, one if it is situated at the
begining of the word the others in the middle and the at the end, in
the street names all letters have the shape as of the begining, which
is good! because the default shape is the one at the end, and mapnik
detects the begining of a word, whereas on the actual slippy map all
letters have the end shape. Is it possible that this happens because
mapnik renders letters one by one?




Other languages that require shaping apart from Arabic, I can think of
Farsi from Iran, and iurdu from Pakistan, they are very similar to
arabic, they have aditional letters in their alphabet to the arabic
letters, the system is similar.

Alilo

On 10/19/07, Artem Pavlenko <artem.mapnik at googlemail.com> wrote:
> Hi Alilo,
>
>
> On 15/10/2007, Alilo <3alilo at gmail.com> wrote:
> > Hi,
> >
> > I would like to know to situation of the arabic support on the slippy
> > map. and if Artem's patch was applied.
> >
> It's not installed on tile.openstreetmap.org but works well for me locally.
> > As I am arabic and interested in having the slippy map in arabic,
> > please let me know if I can do something to help or to test.
>
> Could you verify everything looks OK on :
> http://artem.dev.openstreetmap.org/files/shaping.png
>
> Are there any other languages apart from Arabic that require shaping ?
>
> Cheers
> Artem
>
>
> >
> > Alilo
> >
> > On 10/8/07, Artem Pavlenko <artem.mapnik at googlemail.com> wrote:
> > > Hello list,
> > >
> > > I was looking into solving 'shaping' support for right-to-left
> > > languages (arabic) and I found - PostArabic
> > > (http://dcmms.sourceforge.net/postarabic.php). It is a postgresql
> > > module which provides shape_arabic(text) and couple other methods I
> > > extended it with 'is_arabic (text)' and now it's possible to do:
> > >
> > > (select place,case when is_arabic(name) then
> > > shape_arabic(str_reverse(name)) else name end as name,
> > > leisure,amenity,"natural",tourism, way from planet_osm_point) as
> > > places;
> > >
> > > The above SQL conditionally reverses and shapes arabic text in
> > > planet_osm_point table. 'is_arabic' check is simply testing for first
> > > 2 bytes (UTF-8) expand to be in 0x0600 - 0x6ff range (arabic unicode).
> > >
> > > There are two ways we can integrate this :
> > > 1. Modify osm.xml sql as above
> > > 2. Modify osm2psql to do 'inserts' with conditional shaping.
> > >
> > > Second approach is better, IMHO.
> > >
> > > Also, mapnik dosn't need to be built with BIDI anymore. This is a
> > > great news , because libfribidi is not threadsafe.
> > >
> > > Attaches is the patch against postarabic-1.0.5.
> > >
> > > Thought?
> > > Cheers,
> > > Artem
> > >
> > > _______________________________________________
> > > dev mailing list
> > > dev at openstreetmap.org
> > > http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
> > >
> > >
> > >
> >
>




More information about the talk mailing list