[mapserver-commits] r13073 - trunk/mapserver/renderers/agg/src

svn at osgeo.org svn at osgeo.org
Mon Feb 6 17:06:15 EST 2012


Author: tbonfort
Date: 2012-02-06 14:06:14 -0800 (Mon, 06 Feb 2012)
New Revision: 13073

Modified:
   trunk/mapserver/renderers/agg/src/agg_font_freetype.cpp
Log:
use ms_symbol charmap if available (#3924)


Modified: trunk/mapserver/renderers/agg/src/agg_font_freetype.cpp
===================================================================
--- trunk/mapserver/renderers/agg/src/agg_font_freetype.cpp	2012-02-06 22:05:38 UTC (rev 13072)
+++ trunk/mapserver/renderers/agg/src/agg_font_freetype.cpp	2012-02-06 22:06:14 UTC (rev 13073)
@@ -664,10 +664,14 @@
                     m_name = 0;
                 }
                 if( FT_Select_Charmap(m_cur_face, FT_ENCODING_UNICODE) ) {
-                    if( FT_Select_Charmap(m_cur_face, FT_ENCODING_APPLE_ROMAN) ) {
-                        m_char_map = FT_ENCODING_NONE;
+                    if( FT_Select_Charmap(m_cur_face, FT_ENCODING_MS_SYMBOL) ) {
+                        if( FT_Select_Charmap(m_cur_face, FT_ENCODING_APPLE_ROMAN) ) {
+                            m_char_map = FT_ENCODING_NONE;
+                        } else {
+                            m_char_map = FT_ENCODING_APPLE_ROMAN;
+                        }
                     } else {
-                        m_char_map = FT_ENCODING_APPLE_ROMAN;
+                        m_char_map = FT_ENCODING_MS_SYMBOL;
                     }
                 } else {
                     m_char_map = FT_ENCODING_UNICODE;
@@ -909,6 +913,14 @@
     //------------------------------------------------------------------------
     bool font_engine_freetype_base::prepare_glyph(unsigned glyph_code)
     {
+        /* FT_ENCODING_MS_SYMBOL hack inspired from GD's gdft.c:  */
+        /* I do not know the significance of the constant 0xf000. */
+        /* It was determined by inspection of the character codes */
+        /* stored in Microsoft font symbol.ttf                    */
+        if (m_cur_face->charmap &&
+            m_cur_face->charmap->encoding == FT_ENCODING_MS_SYMBOL)
+            glyph_code |= 0xf000;
+
         m_glyph_index = FT_Get_Char_Index(m_cur_face, glyph_code);
         m_last_error = FT_Load_Glyph(m_cur_face, 
                                      m_glyph_index, 



More information about the mapserver-commits mailing list