]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 20 Aug 2011 22:54:14 +0000 (22:54 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 20 Aug 2011 22:54:14 +0000 (22:54 +0000)
MagickCore/annotate.c
MagickCore/profile.c
coders/label.c

index 9a2bfb3e34c1e6bcb598b624cb08d074ed5bae8a..ec428bdf835a989840ab94aa734ed6287a086d96 100644 (file)
@@ -559,6 +559,8 @@ MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info,
   {
     if (IsUTFSpace(GetUTFCode(p)) != MagickFalse)
       s=p;
+    if (*p == '\n')
+      q=draw_info->text;
     for (i=0; i < (ssize_t) GetUTFOctets(p); i++)
       *q++=(*(p+i));
     *q='\0';
@@ -700,8 +702,8 @@ MagickExport MagickBooleanType GetMultilineTypeMetrics(Image *image,
     if (extent.width > metrics->width)
       *metrics=extent;
   }
-  metrics->height=(double) (i*(size_t) (metrics->ascent-
-    metrics->descent+0.5)+(i-1)*draw_info->interline_spacing);
+  metrics->height=(double) (i*(size_t) (metrics->ascent-metrics->descent+0.5)+
+    (i-1)*draw_info->interline_spacing);
   /*
     Relinquish resources.
   */
@@ -1432,15 +1434,13 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
       origin.x+=direction*face->glyph->advance.x;
     metrics->origin.x=origin.x;
     metrics->origin.y=origin.y;
-    if (last_glyph.id != 0)
-      FT_Done_Glyph(last_glyph.image);
+    FT_Done_Glyph(last_glyph.image);
     last_glyph=glyph;
     code=GetUTFCode(p);
   }
   if (utf8 != (unsigned char *) NULL)
     utf8=(unsigned char *) RelinquishMagickMemory(utf8);
-  if (last_glyph.id != 0)
-    FT_Done_Glyph(last_glyph.image);
+  FT_Done_Glyph(last_glyph.image);
   if ((draw_info->stroke.alpha != TransparentAlpha) ||
       (draw_info->stroke_pattern != (Image *) NULL))
     {
@@ -1480,8 +1480,7 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
                 metrics->width=bitmap->left;
             }
         }
-      if (glyph.id != 0)
-        FT_Done_Glyph(glyph.image);
+      FT_Done_Glyph(glyph.image);
     }
   metrics->width-=metrics->bounds.x1/64.0;
   metrics->bounds.x1/=64.0;
index f287e0e9a65fa8ac6b55426c369db7531234cceb..44f173b40b8a715e92f3d2b20599317a37937778 100644 (file)
@@ -932,9 +932,9 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name,
           return(MagickTrue);
         }
 #if !defined(MAGICKCORE_LCMS_DELEGATE)
-      (void) ThrowMagickException(&image->exception,
-        GetMagickModule(),MissingDelegateWarning,
-        "DelegateLibrarySupportNotBuiltIn","`%s' (LCMS)",image->filename);
+      (void) ThrowMagickException(&image->exception,GetMagickModule(),
+        MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn",
+        "`%s' (LCMS)",image->filename);
 #else
       {
         cmsHPROFILE
index b557aea8564743dbe282e42ff0cf7c7fb270be12..2a746a437429435204536c48592cabf98c06b316 100644 (file)
@@ -140,20 +140,21 @@ static Image *ReadLABELImage(const ImageInfo *image_info,
       {
         width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
         height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
-        if (((image->columns != 0) && (width > (image->columns+1))) ||
-            ((image->rows != 0) && (height > (image->rows+1))))
+        if (((image->columns != 0) && (width >= image->columns)) ||
+            ((image->rows != 0) && (height >= image->rows)))
           break;
         status=GetMultilineTypeMetrics(image,draw_info,&metrics);
       }
+      draw_info->pointsize/=2.0;
       for ( ; status != MagickFalse; draw_info->pointsize--)
       {
         width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
         height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
-        if ((image->columns != 0) && (width <= (image->columns+1)) &&
-           ((image->rows == 0) || (height <= (image->rows+1))))
+        if ((image->columns != 0) && (width < image->columns) &&
+           ((image->rows == 0) || (height < image->rows)))
           break;
-        if ((image->rows != 0) && (height <= (image->rows+1)) &&
-           ((image->columns == 0) || (width <= (image->columns+1))))
+        if ((image->rows != 0) && (height < image->rows) &&
+           ((image->columns == 0) || (width < image->columns)))
           break;
         if (draw_info->pointsize < 2.0)
           break;