[mapserver-commits] r13245 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Mar 14 06:55:57 EDT 2012


Author: tbonfort
Date: 2012-03-14 03:55:57 -0700 (Wed, 14 Mar 2012)
New Revision: 13245

Modified:
   trunk/mapserver/mapagg.cpp
   trunk/mapserver/mapcairo.c
   trunk/mapserver/mapdraw.c
Log:
stop adjusting the baseline, position labels ignoring characters that descend below the baseline (#1425 #1449 #3784)


Modified: trunk/mapserver/mapagg.cpp
===================================================================
--- trunk/mapserver/mapagg.cpp	2012-03-14 10:18:24 UTC (rev 13244)
+++ trunk/mapserver/mapagg.cpp	2012-03-14 10:55:57 UTC (rev 13245)
@@ -874,7 +874,7 @@
       rect->minx = glyph->bounds.x1;
       rect->maxx = glyph->bounds.x2;
       rect->miny = glyph->bounds.y1;
-      rect->maxy = glyph->bounds.y2;
+      rect->maxy = 1;
    } else
       return MS_FAILURE;
    if (advances) {
@@ -922,7 +922,7 @@
          rect->minx = MS_MIN(rect->minx, fx+glyph->bounds.x1);
          rect->miny = MS_MIN(rect->miny, fy+glyph->bounds.y1);
          rect->maxx = MS_MAX(rect->maxx, fx+glyph->bounds.x2);
-         rect->maxy = MS_MAX(rect->maxy, fy+glyph->bounds.y2);
+         rect->maxy = MS_MAX(rect->maxy, fy+1);
 
          fx += glyph->advance_x;
          fy += glyph->advance_y;

Modified: trunk/mapserver/mapcairo.c
===================================================================
--- trunk/mapserver/mapcairo.c	2012-03-14 10:18:24 UTC (rev 13244)
+++ trunk/mapserver/mapcairo.c	2012-03-14 10:55:57 UTC (rev 13245)
@@ -492,26 +492,26 @@
             continue;
         }
 
-	if(curfontidx != 0) {
-	    face = getFontFace(cache,fonts[0]);
-    	    cairo_set_font_face(cache->dummycr,face->face);
-            curfontidx = 0;
+        if (curfontidx != 0) {
+           face = getFontFace(cache, fonts[0]);
+           cairo_set_font_face(cache->dummycr, face->face);
+           curfontidx = 0;
         }
 
         glyph.index = FT_Get_Char_Index(face->ftface, unicode);
 
-	if(glyph.index == 0) {
-	     int j;
-	     for(j=1;j<numfonts;j++) {
-		    curfontidx = j;
-	    	    face = getFontFace(cache,fonts[j]);
-        	    glyph.index = FT_Get_Char_Index(face->ftface, unicode);
-		    if(glyph.index != 0) {
-    	    	       cairo_set_font_face(cache->dummycr,face->face);
-		       break;
-		    }
-	     }
-	}
+        if (glyph.index == 0) {
+           int j;
+           for (j = 1; j < numfonts; j++) {
+              curfontidx = j;
+              face = getFontFace(cache, fonts[j]);
+              glyph.index = FT_Get_Char_Index(face->ftface, unicode);
+              if (glyph.index != 0) {
+                 cairo_set_font_face(cache->dummycr, face->face);
+                 break;
+              }
+           }
+        }
 
         if( FT_HAS_KERNING((prevface->ftface)) && previdx ) {
             FT_Vector delta;
@@ -524,18 +524,18 @@
             rect->minx = px+extents.x_bearing;
             rect->miny = py+extents.y_bearing;
             rect->maxx = px+extents.x_bearing+extents.width;
-            rect->maxy = py+extents.y_bearing+extents.height;
+            rect->maxy = py+1;
         } else {
             rect->minx = MS_MIN(rect->minx,px+extents.x_bearing);
             rect->miny = MS_MIN(rect->miny,py+extents.y_bearing);
-            rect->maxy = MS_MAX(rect->maxy,py+extents.y_bearing+extents.height);
+            rect->maxy = MS_MAX(rect->maxy,py+1);
             rect->maxx = MS_MAX(rect->maxx,px+extents.x_bearing+extents.width);
         }
         if(advances!=NULL)
             (*advances)[i]=extents.x_advance;
         px += extents.x_advance;
         previdx=glyph.index;
-	prevface = face;
+	     prevface = face;
     }
     /*
     rect->minx = 0;

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2012-03-14 10:18:24 UTC (rev 13244)
+++ trunk/mapserver/mapdraw.c	2012-03-14 10:55:57 UTC (rev 13245)
@@ -2884,6 +2884,7 @@
                  label_buffer = (labelPtr->buffer*image->resolutionfactor);
                  label_mindistance = (labelPtr->mindistance*image->resolutionfactor);
                  
+#ifdef oldcode
                  /* adjust the baseline (see #1449) */
                  if(labelPtr->type == MS_TRUETYPE) {
                     char *lastline = strrchr(labelPtr->annotext,'\n');
@@ -2895,6 +2896,7 @@
                        label_offset_y += ((rect2.miny+rect2.maxy) + size) / 2.0;
                     }
                  }
+#endif
 
                  
                  /* compute the label annopoly  if we need to render the background billboard */



More information about the mapserver-commits mailing list