[mapserver-commits] r10267 - sandbox/mapserver6

svn at osgeo.org svn at osgeo.org
Wed Jun 30 10:50:16 EDT 2010


Author: tbonfort
Date: 2010-06-30 14:50:15 +0000 (Wed, 30 Jun 2010)
New Revision: 10267

Modified:
   sandbox/mapserver6/mapdraw.c
   sandbox/mapserver6/maplabel.c
   sandbox/mapserver6/mapserver.h
Log:
remove unused prototypes

re-enable adjustment of text baseline when drawing labelcache



Modified: sandbox/mapserver6/mapdraw.c
===================================================================
--- sandbox/mapserver6/mapdraw.c	2010-06-30 10:02:42 UTC (rev 10266)
+++ sandbox/mapserver6/mapdraw.c	2010-06-30 14:50:15 UTC (rev 10267)
@@ -2388,6 +2388,23 @@
              }
              if(msGetLabelSize(map,labelPtr,cachePtr->text,size,&r,NULL) != MS_SUCCESS)
                return(-1);
+             
+             //adjust the baseline (see #1449)
+            if(labelPtr->type == MS_TRUETYPE) {
+               int nNewlines = msCountChars(cachePtr->text,'\n');
+               if(!nNewlines) {
+                 labelPtr->offsety += (MS_NINT(((r.miny + r.maxy) + size) / 2))/scalefactor;
+                 labelPtr->offsetx += (MS_NINT(r.minx / 2))/scalefactor;
+               }
+               else {
+                 rectObj rect2; /*bbox of first line only*/
+                 char* firstLine = msGetFirstLine(cachePtr->text);
+                 msGetLabelSize(map,labelPtr,firstLine,size,&rect2,NULL);
+                 labelPtr->offsety += (MS_NINT(((rect2.miny+rect2.maxy) + size) / 2))/scalefactor;
+                 labelPtr->offsetx += (MS_NINT(rect2.minx / 2))/scalefactor;
+                 free(firstLine);
+               }
+            }
    
              needBillboard = MS_FALSE;
              if(MS_VALID_COLOR(labelPtr->backgroundcolor)) needBillboard = MS_TRUE;

Modified: sandbox/mapserver6/maplabel.c
===================================================================
--- sandbox/mapserver6/maplabel.c	2010-06-30 10:02:42 UTC (rev 10266)
+++ sandbox/mapserver6/maplabel.c	2010-06-30 14:50:15 UTC (rev 10267)
@@ -788,27 +788,6 @@
     	return MS_FAILURE;
     }
     return msGetTruetypeTextBBox(renderer,font,size,string,rect,advances);
-
-    
-#ifdef TBT
-    /* bug 1449 fix (adjust baseline) */
-    if(adjustBaseline) {
-      int nNewlines = msCountChars(string,'\n');
-      if(!nNewlines) {
-        label->offsety += (MS_NINT(((rect->miny + rect->maxy) + size) / 2))/scalefactor;
-        label->offsetx += (MS_NINT(rect->minx / 2))/scalefactor;
-      }
-      else {
-        rectObj rect2; /*bbox of first line only*/
-        char* firstLine = msGetFirstLine(string);
-        msGetTruetypeTextBBox(renderer,font,size,firstLine,&rect2,NULL);
-        label->offsety += (MS_NINT(((rect2.miny+rect2.maxy) + size) / 2))/scalefactor;
-        label->offsetx += (MS_NINT(rect2.minx / 2))/scalefactor;
-        free(firstLine);
-      }
-    }
-#endif
-    
   } else if(label->type == MS_BITMAP){
 	  rendererVTableObj *renderer = MS_MAP_RENDERER(map);
 	  if(renderer->supports_bitmap_fonts)

Modified: sandbox/mapserver6/mapserver.h
===================================================================
--- sandbox/mapserver6/mapserver.h	2010-06-30 10:02:42 UTC (rev 10266)
+++ sandbox/mapserver6/mapserver.h	2010-06-30 14:50:15 UTC (rev 10267)
@@ -2131,77 +2131,6 @@
 #define RESOLVE_PEN_GD(img,color) { if( (color).pen == MS_PEN_UNSET ) msImageSetPenGD( img, &(color) ); }
 MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
 
-#ifdef TBT
-/* ==================================================================== */
-/*      Prototypes for functions in mapgd.c                             */
-/* ==================================================================== */
-MS_DLL_EXPORT imageObj *msImageLoadGDCtx(gdIOCtx* ctx, const char *driver);
-MS_DLL_EXPORT int msCompareColors(colorObj *c1, colorObj *c2);
-MS_DLL_EXPORT void msPreAllocateColorsGD(imageObj *image, mapObj *map);
-MS_DLL_EXPORT imageObj *msImageCreateGD(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
-MS_DLL_EXPORT imageObj *msImageLoadGD( const char *filename );
-MS_DLL_EXPORT void msImageInitGD( imageObj *image, colorObj *background );
-MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
-
-#define RESOLVE_PEN_GD(img,color) { if( (color).pen == MS_PEN_UNSET ) msImageSetPenGD( img, &(color) ); }
-
-MS_DLL_EXPORT gdIOCtx *msNewGDFileCtx(FILE *file);
-MS_DLL_EXPORT int msSaveImageGD(imageObj *img, char *filename, outputFormatObj *format);
-MS_DLL_EXPORT unsigned char *msSaveImageBufferGD(imageObj *img, int *bufsize, outputFormatObj *format);
-MS_DLL_EXPORT int msSaveImageGDCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
-MS_DLL_EXPORT int msSaveImageGD_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
-MS_DLL_EXPORT void msFreeImageGD(imageObj *img);
-
-MS_DLL_EXPORT void msCircleDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msCircleDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, double r, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawMarkerSymbolGD(symbolSetObj *symbolset, imageObj *img, pointObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawLineSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawShadeSymbolGD(symbolSetObj *symbolset, imageObj *img, shapeObj *p, styleObj *style, double scalefactor);
-
-MS_DLL_EXPORT int msDrawTextGD(imageObj *img, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
-MS_DLL_EXPORT int msDrawTextLineGD(imageObj *img, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
-
-MS_DLL_EXPORT void msImageCopyMerge (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct);
-MS_DLL_EXPORT void msImageCopyMergeNoAlpha (imageObj *dst, imageObj *src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct, colorObj *transparent);
-
-#ifdef USE_AGG
-/* ==================================================================== */
-/*      Prototypes for functions in mapagg.cpp                          */
-/* ==================================================================== */
-
-MS_DLL_EXPORT imageObj *msImageCreateAGG(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, double resolution, double defresolution);
-MS_DLL_EXPORT void msImageInitAGG( imageObj *image, colorObj *background );
-
-MS_DLL_EXPORT int msSaveImageAGG(imageObj *img, char *filename, outputFormatObj *format);
-MS_DLL_EXPORT unsigned char *msSaveImageBufferAGG(imageObj *img, int *bufsize, outputFormatObj *format);
-MS_DLL_EXPORT int msSaveImageAGGCtx(imageObj *img, gdIOCtx* ctx, outputFormatObj *format);
-MS_DLL_EXPORT int msSaveImageAGG_LL(imageObj *img, char *filename, int type, int transparent, int interlace, int quality);
-MS_DLL_EXPORT void msFreeImageAGG(imageObj *img);
-
-MS_DLL_EXPORT void msPieSliceAGG(imageObj *image, styleObj *style, double center_x, double center_y, double diameter, double start, double end);
-MS_DLL_EXPORT void msFilledRectangleAGG (imageObj *image, styleObj *style, double c1_x, double c1_y, double c2_x, double c2_y );
-MS_DLL_EXPORT void msCircleDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msCircleDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, double r, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawMarkerSymbolAGG(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawLineSymbolAGG(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawShadeSymbolAGG(symbolSetObj *symbolset, imageObj *image,shapeObj *p, styleObj *style, double scalefactor);
-int msGetTruetypeTextBBoxAGG(imageObj *img, char *font, double size, char *string, rectObj *rect, double **advances);
-int msGetRasterTextBBoxAGG(imageObj *img, int size, char *string, rectObj *rect);
-MS_DLL_EXPORT int msDrawTextAGG(imageObj *imgage, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
-
-MS_DLL_EXPORT int msDrawTextLineAGG(imageObj *image, char *string, labelObj *label, labelPathObj *labelpath, fontSetObj *fontset, double scalefactor);
-
-MS_DLL_EXPORT void msTransformShapeAGG(shapeObj *shape, rectObj extent, double cellsize);
-
-MS_DLL_EXPORT void msFreeSymbolCacheAGG(void *buffer);
-
-MS_DLL_EXPORT void msAlphaGD2AGG(imageObj *im);
-MS_DLL_EXPORT void msAlphaAGG2GD(imageObj *im);
-MS_DLL_EXPORT void msImageCopyMergeAGG (imageObj *dst, imageObj *src, int pct);
-#endif  /* USE_AGG  */
-
-#endif  //TBT
-
 /* various JOIN functions (in mapjoin.c) */
 MS_DLL_EXPORT int msJoinConnect(layerObj *layer, joinObj *join);
 MS_DLL_EXPORT int msJoinPrepare(joinObj *join, shapeObj *shape);
@@ -2299,51 +2228,6 @@
 
 
 /* ==================================================================== */
-/*      End of prototypes for functions in mapswf.c                     */
-/* ==================================================================== */
-
-/* ==================================================================== */
-
-
-#ifdef TBT
-/* ==================================================================== */
-/*      prototypes for functions in mapsvg.c                            */
-/* ==================================================================== */
-
-MS_DLL_EXPORT imageObj *msImageCreateSVG(int width, int height, 
-                                         outputFormatObj *format, char *imagepath, 
-                                         char *imageurl, mapObj *map);
-
-MS_DLL_EXPORT void msImageStartLayerSVG(mapObj *map, layerObj *layer, 
-                                          imageObj *image);
-
-MS_DLL_EXPORT void msDrawLineSymbolSVG(symbolSetObj *symbolset, imageObj *image, 
-                                       shapeObj *p, styleObj *style, 
-                                       double scalefactor);
-MS_DLL_EXPORT void msTransformShapeSVG(shapeObj *shape, rectObj extent, double cellsize,
-                                       imageObj *image);
-MS_DLL_EXPORT int msSaveImageSVG(imageObj *image, char *filename);
-MS_DLL_EXPORT int msSaveImagetoFpSVG(imageObj *image, FILE *fp);
-MS_DLL_EXPORT void msFreeImageSVG(imageObj *image);
-
-MS_DLL_EXPORT void msDrawMarkerSymbolSVG(symbolSetObj *symbolset, 
-                                         imageObj *image, 
-                                         pointObj *p, styleObj *style, 
-                                         double scalefactor);
-
-MS_DLL_EXPORT int msDrawTextSVG(imageObj *image, pointObj labelPnt, char *string, 
-                                labelObj *label, fontSetObj *fontset, 
-                                double scalefactor);
-MS_DLL_EXPORT int msDrawLabelCacheSVG(imageObj *image, mapObj *map);
-
-MS_DLL_EXPORT int msDrawRasterLayerSVG(mapObj *map, layerObj *layer, 
-                                       imageObj *image);
-MS_DLL_EXPORT void msDrawShadeSymbolSVG(symbolSetObj *symbolset, 
-                                        imageObj *image, shapeObj *p, 
-                                        styleObj *style, double scalefactor);
-
-#endif //TBT
-/* ==================================================================== */
 /*      prototypes for functions in mapoutput.c                         */
 /* ==================================================================== */
 
@@ -2499,41 +2383,11 @@
 MS_DLL_EXPORT void msDrawStartShapeSWF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
 #endif /* USE_MING_FLASH */
 
-
-#ifdef TBT
 /* ==================================================================== */
-/*      prototypes for functions in mappdf.c                            */
+/*      End of prototypes for functions in mapswf.c                     */
 /* ==================================================================== */
-#ifdef USE_PDF
-MS_DLL_EXPORT PDF *msDrawMapPDF(mapObj *map, PDF *pdf, hashTableObj fontHash);
-MS_DLL_EXPORT imageObj *msImageCreatePDF(int width, int height, outputFormatObj *format, char *imagepath, char *imageurl, mapObj *map);
-MS_DLL_EXPORT void msImageStartLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
-MS_DLL_EXPORT int msDrawLabelPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
-MS_DLL_EXPORT int msDrawLabelCachePDF(imageObj *image, mapObj *map);
-MS_DLL_EXPORT void msDrawLineSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawShadeSymbolPDF(symbolSetObj *symbolset, imageObj *image, shapeObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT void msDrawMarkerSymbolPDF(symbolSetObj *symbolset, imageObj *image, pointObj *p, styleObj *style, double scalefactor);
-MS_DLL_EXPORT int msDrawRasterLayerPDF(mapObj *map, layerObj *layer, imageObj *image);
-MS_DLL_EXPORT int msDrawVectorLayerAsRasterPDF(mapObj *map, layerObj *layer, imageObj*image);
-MS_DLL_EXPORT void msTransformShapePDF(shapeObj *shape, rectObj extent, double cellsize);
-MS_DLL_EXPORT int msSaveImagePDF(imageObj *image, char *filename);
-MS_DLL_EXPORT void msFreeImagePDF(imageObj *image);
-MS_DLL_EXPORT int msDrawTextPDF(imageObj *image, pointObj labelPnt, char *string, labelObj *label, fontSetObj *fontset, double scalefactor);
-MS_DLL_EXPORT void msDrawStartShapePDF(mapObj *map, layerObj *layer, imageObj *image, shapeObj *shape);
-#ifdef USE_WMS_LYR 
-MS_DLL_EXPORT int msDrawWMSLayerPDF(int nLayerId, httpRequestObj *pasReqInfo, 
-                      int numRequests, mapObj *map, layerObj *layer, imageObj *image);
-#endif
 
-#endif /* USE_PDF */
-
-#endif //TBT
-
 /* ==================================================================== */
-/*      End of prototypes for functions in mappdf.c                     */
-/* ==================================================================== */
-
-/* ==================================================================== */
 /*      prototypes for functions in mapgeomtransform.c                  */
 /* ==================================================================== */
 enum MS_GEOMTRANSFORM_TYPE {



More information about the mapserver-commits mailing list