% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
#include "MagickCore/client.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
+#include "MagickCore/colorspace-private.h"
#include "MagickCore/composite.h"
#include "MagickCore/composite-private.h"
#include "MagickCore/constitute.h"
}
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
+ if (IsGrayColorspace(image->colorspace) != MagickFalse)
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
status=MagickTrue;
for (i=0; textlist[i] != (char *) NULL; i++)
{
(number_lines-1.0)*height)/2.0;
break;
}
- case StaticGravity:
case CenterGravity:
{
offset.x=(geometry.width == 0 ? -1.0 : 1.0)*annotate_info->affine.tx+
type_info=GetTypeInfo(draw_info->font,exception);
if (type_info == (const TypeInfo *) NULL)
(void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
- "UnableToReadFont","`%s'",draw_info->font);
+ "UnableToReadFont","'%s'",draw_info->font);
}
if ((type_info == (const TypeInfo *) NULL) &&
(draw_info->family != (const char *) NULL))
draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
(void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
- "UnableToReadFont","`%s'",draw_info->family);
+ "UnableToReadFont","'%s'",draw_info->family);
}
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily("Arial",draw_info->style,
{
(void) FT_Done_FreeType(library);
(void) ThrowMagickException(exception,GetMagickModule(),TypeError,
- "UnableToReadFont","`%s'",draw_info->font);
+ "UnableToReadFont","'%s'",draw_info->font);
return(RenderPostscript(image,draw_info,offset,metrics,exception));
}
if ((draw_info->metrics != (char *) NULL) &&
draw_info->encoding != (char *) NULL ? draw_info->encoding : "none",
draw_info->pointsize);
flags=FT_LOAD_NO_BITMAP;
- value=GetImageProperty(image,"type:hinting");
+ if (draw_info->text_antialias == MagickFalse)
+ flags|=FT_LOAD_TARGET_MONO;
+ else
+ {
+#if defined(FT_LOAD_TARGET_LIGHT)
+ flags|=FT_LOAD_TARGET_LIGHT;
+#elif defined(FT_LOAD_TARGET_LCD)
+ flags|=FT_LOAD_TARGET_LCD;
+#endif
+ }
+ value=GetImageProperty(image,"type:hinting",exception);
if ((value != (const char *) NULL) && (LocaleCompare(value,"off") == 0))
flags|=FT_LOAD_NO_HINTING;
glyph.id=0;
Rasterize the glyph.
*/
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
p=bitmap->bitmap.buffer;
for (y=0; y < (ssize_t) bitmap->bitmap.rows; y++)
{
MagickRealType
fill_opacity;
- PixelPacket
+ PixelInfo
fill_color;
register Quantum
q+=GetPixelChannels(image);
continue;
}
+ GetPixelInfo(image,&fill_color);
(void) GetFillColor(draw_info,x_offset,y_offset,&fill_color,
exception);
fill_opacity=fill_opacity*fill_color.alpha;
status=FT_Get_Glyph(face->glyph,&glyph.image);
if (status == 0)
{
- status=FT_Outline_Get_BBox(&((FT_OutlineGlyph) glyph.image)->
- outline,&bounds);
+ status=FT_Outline_Get_BBox(&((FT_OutlineGlyph) glyph.image)->outline,
+ &bounds);
if (status == 0)
{
FT_Vector_Transform(&glyph.origin,&affine);
TypeMetric *metrics,ExceptionInfo *exception)
{
(void) ThrowMagickException(exception,GetMagickModule(),
- MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (Freetype)",
+ MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","'%s' (Freetype)",
draw_info->font != (char *) NULL ? draw_info->font : "none");
- return(RenderPostscript(image,draw_info,offset,metrics));
+ return(RenderPostscript(image,draw_info,offset,metrics,exception));
}
#endif
\f
resolution.y=resolution.x;
}
if (identity == MagickFalse)
- (void) TransformImage(&annotate_image,"0x0",(char *) NULL);
+ (void) TransformImage(&annotate_image,"0x0",(char *) NULL,exception);
else
{
RectangleInfo
(void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
crop_info.height,(double) crop_info.x,(double) crop_info.y);
- (void) TransformImage(&annotate_image,geometry,(char *) NULL);
+ (void) TransformImage(&annotate_image,geometry,(char *) NULL,exception);
}
metrics->pixels_per_em.x=(resolution.y/DefaultResolution)*
ExpandAffine(&draw_info->affine)*draw_info->pointsize;
}
if (draw_info->fill.alpha != TransparentAlpha)
{
+ CacheView
+ *annotate_view;
+
MagickBooleanType
sync;
- PixelPacket
+ PixelInfo
fill_color;
- CacheView
- *annotate_view;
-
/*
Render fill color.
*/
(void) SetImageAlphaChannel(annotate_image,OpaqueAlphaChannel,
exception);
fill_color=draw_info->fill;
- annotate_view=AcquireCacheView(annotate_image);
+ annotate_view=AcquireAuthenticCacheView(annotate_image,exception);
for (y=0; y < (ssize_t) annotate_image->rows; y++)
{
register ssize_t
break;
}
annotate_view=DestroyCacheView(annotate_view);
- (void) CompositeImage(image,OverCompositeOp,annotate_image,
+ (void) CompositeImage(image,annotate_image,OverCompositeOp,MagickTrue,
(ssize_t) ceil(offset->x-0.5),(ssize_t) ceil(offset->y-(metrics->ascent+
- metrics->descent)-0.5));
+ metrics->descent)-0.5),exception);
}
annotate_image=DestroyImage(annotate_image);
return(MagickTrue);
image_info=AcquireImageInfo();
client_name=GetClientName();
resource_database=XGetResourceDatabase(display,client_name);
- XGetResourceInfo(image_info,resource_database,client_name,&resource_info);
+ XGetResourceInfo(image_info,resource_database,client_name,
+ &resource_info);
resource_info.close_server=MagickFalse;
resource_info.colormap=PrivateColormap;
resource_info.font=AcquireString(draw_info->font);
pixel.pen_color.red=ScaleQuantumToShort(draw_info->fill.red);
pixel.pen_color.green=ScaleQuantumToShort(draw_info->fill.green);
pixel.pen_color.blue=ScaleQuantumToShort(draw_info->fill.blue);
- status=XAnnotateImage(display,&pixel,&annotate_info,image);
+ status=XAnnotateImage(display,&pixel,&annotate_info,image,exception);
if (status == 0)
{
ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed",
(void) offset;
(void) metrics;
(void) ThrowMagickException(exception,GetMagickModule(),
- MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","`%s' (X11)",
+ MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","'%s' (X11)",
image->filename);
return(MagickFalse);
}