% %
% %
% %
+% D r a w G e t T y p e M e t r i c s %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DrawGetTypeMetrics() returns the following information for the specified
+% font and text:
+%
+% character width
+% character height
+% ascender
+% descender
+% text width
+% text height
+% maximum horizontal advance
+% bounds: x1
+% bounds: y1
+% bounds: x2
+% bounds: y2
+% origin: x
+% origin: y
+% underline position
+% underline thickness
+%
+% The format of the DrawGetTypeMetrics method is:
+%
+% MagickBooleanType DrawGetTypeMetrics(const DrawingWand *wand,
+% const char *text,MagickBooleanType ignore_newlines,
+$ TypeMetric *metrics)
+%
+% A description of each parameter follows:
+%
+% o wand: the drawing wand.
+%
+% o text: text to draw.
+%
+% o metrics: Return the font metrics in this structure.
+%
+% o ignore_newlines: indicates whether newlines should be ignored.
+%
+% o metrics: Return the font metrics in this structure.
+%
+*/
+WandExport MagickBooleanType DrawGetTypeMetrics(const DrawingWand *wand,
+ const char *text,MagickBooleanType ignore_newlines,TypeMetric *metrics)
+{
+ DrawInfo
+ *draw_info;
+
+ MagickBooleanType
+ status;
+
+ assert(wand != (const DrawingWand *) NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ draw_info=PeekDrawingWand(wand);
+ if (draw_info == (DrawInfo *) NULL)
+ return(MagickFalse);
+ (void) CloneString(&draw_info->text,text);
+ if (ignore_newlines != MagickFalse)
+ status=GetTypeMetrics(wand->image,draw_info,metrics,wand->exception);
+ else
+ status=GetMultilineTypeMetrics(wand->image,draw_info,metrics,
+ wand->exception);
+ draw_info=DestroyDrawInfo(draw_info);
+ return(status);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% D r a w G e t V e c t o r G r a p h i c s %
% %
% %
extern WandExport MagickBooleanType
DrawClearException(DrawingWand *),
- DrawComposite(DrawingWand *,const CompositeOperator,const double,const double,
- const double,const double,MagickWand *),
+ DrawComposite(DrawingWand *,const CompositeOperator,const double,
+ const double,const double,const double,MagickWand *),
DrawGetFontResolution(const DrawingWand *,double *,double *),
DrawGetStrokeAntialias(const DrawingWand *),
DrawGetTextAntialias(const DrawingWand *),
+ DrawGetTypeMetrics(const DrawingWand *,const char *,MagickBooleanType,
+ TypeMetric *),
DrawPopPattern(DrawingWand *),
DrawPushPattern(DrawingWand *,const char *,const double,const double,
const double,const double),