<div class="gmail_quote"><div><div class="Wj3C7c"><div class="gmail_quote">Hello All,<br> I have been trying unsuccessfully to login to <a href="http://trac.osgeo.org/mapserver" target="_blank">trac.osgeo.org/mapserver</a> using my OSGeo userid (dreamil). After trying for last 2 days, I am posting here the bug report which I wanted to post there. Please go through this and let me know your opinion on the same:<br>
<br>********************************************************************************************<br>Title: Indic Support (using OpenType fonts) in Mapserver<br><br>The current version of Mapserver can render labels on map using LABEL directive in a map file.For labels, you can use truetype fonts which is achieved using freetype.Due to this map labels can be displayed in various non-English languages such as europian and some Asian scripts.<br>
<br>However, for rendering some CTL (Complex Text Layout) scripts, truetype fonts are not sufficient.Indic Scripts, for example, require much more than mere juxtaposition of glyphs from a font.Rendering Indic scripts such as Devanagari, Gujarati, Tamil, Telugu, Bengali etc. is much more complex than others.To handle this, "intelligent" fonts were designed which contain embedded rules to help rendering.These were called OpenType fonts (see <a href="http://www.microsoft.com/typography/otfntdev/indicot/default.htm" target="_blank">http://www.microsoft.com/typography/otfntdev/indicot/default.htm</a>). Though initiated by M$, OpenType fonts are are now Industry standard for rendering these complex scripts on Computer using script and language rules. All major Linux desktops such as GNOME and KDE support OpenType font rendering.To handle OpenType fonts, various rendering engines have been developed and have become part of rendering libraries such as Pango(<a href="http://www.pango.org/%29/ICU%28http://www.icu-project.org/" target="_blank">http://www.pango.org/)/ICU(http://www.icu-project.org/</a>), Qt etc.It should be noted that, in absence of such a rendering engine, OpenType fonts act as Truetype fonts i.e. the embedded rendering rules are not used while doing the glyph formation.<br>
<br>There are numerous OpenType fonts available free/proprietory for Indic scripts. We have ourselves developed gargi, the first GPLed OpenType font for Devanagari(<a href="http://savannah.nongnu.org/projects/gargi" target="_blank">http://savannah.nongnu.org/projects/gargi</a>).<br>
<br>Current Mapserver supports truetype fonts using freetype routines, but there is no support for OpenType fonts. As a result, a text label in any of the indic scripts is rendered using justaposition of glyphs from the font provided, without using rendering rules.The result is incorrect rendering. To show you the difference, here is the snapshot of a map with labels in Devanagari script (which is a indic script), rendered in correct fashion(<a href="http://indictrans.in/%7Eswapnil/mapserver/required_result.png" target="_blank">http://indictrans.in/~swapnil/mapserver/required_result.png</a>) and here is the snapshot as rendered by Mapserver(<a href="http://indictrans.in/%7Eswapnil/mapserver/mapserv_no_render_support_for_ttf.png" target="_blank">http://indictrans.in/~swapnil/mapserver/mapserv_no_render_support_for_ttf.png</a>) You may not be able to make out much if you are not familiar with the script, but for someone who knows the script, its an incorrect or broken representation of the text.<br>
<br>To solve this, we should add support for OpenType font rendering in Mapserver.This can be done by embedding some indic rendering routines from Pango or ICU into the label rendering engine of mapserver. I don't know the details of how labels are rendered in Mapserver, so somebody knowledgable should guide. I am prepared to take up the task on behalf of my team (<a href="http://www.indictrans.in" target="_blank">www.indictrans.in</a>) if I get some guidance about internal working of Mapserver.As far as performance is concerned, this will hit the speed badly, but then this can be encoded as a configure options (--with-pango similar to Firefox implementation <a href="http://developer.spikesource.com/wiki/index.php/Firefox_Indic_Build" target="_blank">http://developer.spikesource.com/wiki/index.php/Firefox_Indic_Build</a>) so that it becomes optional.<br>
<br>You may have look at the temporary solution which we are using for the time being to show indic text on maps using Mapserver here: <a href="http://www.indictrans.in/old/doublebyte/English/doublebyte_l10n_25march_4PM.html" target="_blank">http://www.indictrans.in/old/doublebyte/English/doublebyte_l10n_25march_4PM.html</a> We have numerous localized GIS demo on our website using this approach.<br>
********************************************************************************************<br></div><br clear="all"></div></div></div>regards,<br>-- <br>Swapnil Hajare<br><a href="http://dreamil.indictrans.in">dreamil.indictrans.in</a>