From: cristy Date: Sat, 20 Aug 2011 22:54:14 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2c81adf02cbe4bb92991389437a2a1daf8ed313;p=imagemagick --- diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 9a2bfb3e3..ec428bdf8 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -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; diff --git a/MagickCore/profile.c b/MagickCore/profile.c index f287e0e9a..44f173b40 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -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 diff --git a/coders/label.c b/coders/label.c index b557aea85..2a746a437 100644 --- a/coders/label.c +++ b/coders/label.c @@ -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;