[mapserver-commits] r10408 - sandbox/mapserver6

svn at osgeo.org svn at osgeo.org
Wed Jul 28 13:15:10 EDT 2010


Author: tbonfort
Date: 2010-07-28 17:15:10 +0000 (Wed, 28 Jul 2010)
New Revision: 10408

Modified:
   sandbox/mapserver6/mapagg.cpp
   sandbox/mapserver6/mapcairo.c
   sandbox/mapserver6/mapgd.c
   sandbox/mapserver6/mapkml.cpp
Log:
larger outlines for text rendering (cairo/agg)
fix placement of gd marker symbols


Modified: sandbox/mapserver6/mapagg.cpp
===================================================================
--- sandbox/mapserver6/mapagg.cpp	2010-07-28 17:14:16 UTC (rev 10407)
+++ sandbox/mapserver6/mapagg.cpp	2010-07-28 17:15:10 UTC (rev 10408)
@@ -279,7 +279,7 @@
       r->m_rasterizer_aa.reset();
       r->m_rasterizer_aa.filling_rule(mapserver::fill_non_zero);
       mapserver::conv_contour<mapserver::path_storage> cc(glyphs);
-      cc.width(style->outlinewidth);
+      cc.width(style->outlinewidth + 1);
       r->m_rasterizer_aa.add_path(cc);
       r->m_renderer_scanline.color(aggColor(style->outlinecolor));
       mapserver::render_scanlines(r->m_rasterizer_aa, r->sl_line, r->m_renderer_scanline);
@@ -549,7 +549,8 @@
       r->m_rasterizer_aa.reset();
       r->m_rasterizer_aa.filling_rule(mapserver::fill_non_zero);
       mapserver::conv_contour<mapserver::path_storage> cc(glyphs);
-      cc.width(style->outlinewidth);
+      cc.auto_detect_orientation(true);
+      cc.width(style->outlinewidth + 1);
       r->m_rasterizer_aa.add_path(cc);
       r->m_renderer_scanline.color(aggColor(style->outlinecolor));
       mapserver::render_scanlines(r->m_rasterizer_aa, r->sl_line, r->m_renderer_scanline);

Modified: sandbox/mapserver6/mapcairo.c
===================================================================
--- sandbox/mapserver6/mapcairo.c	2010-07-28 17:14:16 UTC (rev 10407)
+++ sandbox/mapserver6/mapcairo.c	2010-07-28 17:15:10 UTC (rev 10408)
@@ -358,12 +358,14 @@
 
    if (s->outlinewidth) {
       msCairoSetSourceColor(r->cr, s->outlinecolor);
-      cairo_set_line_width(r->cr, s->outlinewidth);
+      cairo_set_line_width(r->cr, s->outlinewidth + 1);
       cairo_stroke_preserve(r->cr);
    }
-   assert(s->color);
-   msCairoSetSourceColor(r->cr, s->color);
-   cairo_fill(r->cr);
+   if(s->color) {
+	   msCairoSetSourceColor(r->cr, s->color);
+	   cairo_fill_preserve(r->cr);
+   }
+   cairo_new_path(r->cr);
    cairo_restore(r->cr);
    return MS_SUCCESS;
 }
@@ -503,7 +505,7 @@
     if (style->outlinewidth > 0) {
         cairo_save(r->cr);
         msCairoSetSourceColor(r->cr, style->outlinecolor);
-        cairo_set_line_width(r->cr, style->outlinewidth);
+        cairo_set_line_width(r->cr, style->outlinewidth + 1);
         cairo_stroke_preserve(r->cr);
         cairo_restore(r->cr);
     }

Modified: sandbox/mapserver6/mapgd.c
===================================================================
--- sandbox/mapserver6/mapgd.c	2010-07-28 17:14:16 UTC (rev 10407)
+++ sandbox/mapserver6/mapgd.c	2010-07-28 17:15:10 UTC (rev 10408)
@@ -615,8 +615,8 @@
    SETPEN(ip, s->outlinecolor);
    gdImageStringFT(NULL, bbox, s->color->pen, symbol->full_font_path, s->scale, s->rotation, 0,0, symbol->character);
    
-   x -=  (bbox[2] - bbox[0])/2;
-   y +=  (bbox[1] - bbox[5])/2;
+   x -=  (bbox[2] - bbox[0])/2 + bbox[0];
+   y +=  (bbox[1] - bbox[5])/2 - bbox[1];
 
    if( s->outlinecolor ) {
       error = gdImageStringFT(ip, bbox, s->outlinecolor->pen, symbol->full_font_path, s->scale, s->rotation, x, y-1, symbol->character);
@@ -633,8 +633,8 @@
       gdImageStringFT(ip, bbox, s->outlinecolor->pen, symbol->full_font_path, s->scale, s->rotation, x-1, y+1, symbol->character);
       gdImageStringFT(ip, bbox, s->outlinecolor->pen, symbol->full_font_path, s->scale, s->rotation, x-1, y-1, symbol->character);
    }
-
-   gdImageStringFT(ip, bbox, s->color->pen, symbol->full_font_path, s->scale, s->rotation, x, y, symbol->character);
+   if(s->color)
+	   gdImageStringFT(ip, bbox, s->color->pen, symbol->full_font_path, s->scale, s->rotation, x, y, symbol->character);
   return MS_SUCCESS;
 }
 

Modified: sandbox/mapserver6/mapkml.cpp
===================================================================
--- sandbox/mapserver6/mapkml.cpp	2010-07-28 17:14:16 UTC (rev 10407)
+++ sandbox/mapserver6/mapkml.cpp	2010-07-28 17:15:10 UTC (rev 10408)
@@ -237,6 +237,7 @@
    renderer->renderPixmapSymbol = &msRenderPixmapSymbolKml;
    renderer->renderTruetypeSymbol = &msRenderTruetypeSymbolKml;
    renderer->mergeRasterBuffer = &msMergeRasterBufferKml;
+   renderer->loadImageFromFile = msLoadMSRasterBufferFromFile;
    renderer->initializeRasterBuffer = aggInitializeRasterBuffer;
    renderer->getTruetypeTextBBox = &msGetTruetypeTextBBoxKml;
    renderer->renderTile = &msRenderTileKml;



More information about the mapserver-commits mailing list