}
annotate_info->affine.tx=offset.x;
annotate_info->affine.ty=offset.y;
-
pixel=annotate_info->fill;
if (annotate_info->stroke.alpha != TransparentAlpha)
- pixel = annotate_info->stroke;
-
+ pixel=annotate_info->stroke;
(void) QueryColorname(image,&pixel,AllCompliance,color,exception);
(void) FormatLocaleString(primitive,MagickPathExtent,"stroke %s "
- "stroke-width %g "
- "line 0,0 %g,0",color,(double) metrics.underline_thickness,(double) metrics.width);
-
+ "stroke-width %g line 0,0 %g,0",color,(double)
+ metrics.underline_thickness,(double) metrics.width);
/*
Annotate image with text.
*/
- if (annotate->decorate == OverlineDecoration)
+ switch (annotate->decorate)
+ {
+ case OverlineDecoration:
{
annotate_info->affine.ty-=(draw_info->affine.sy*(metrics.ascent+
metrics.descent-metrics.underline_position));
(void) CloneString(&annotate_info->primitive,primitive);
(void) DrawImage(image,annotate_info,exception);
+ break;
}
- else if (annotate->decorate == UnderlineDecoration)
+ case UnderlineDecoration:
+ default:
{
annotate_info->affine.ty-=(draw_info->affine.sy*
metrics.underline_position);
(void) CloneString(&annotate_info->primitive,primitive);
(void) DrawImage(image,annotate_info,exception);
+ break;
}
- else if (annotate->decorate == LineThroughDecoration)
+ case LineThroughDecoration:
{
annotate_info->affine.ty-=(draw_info->affine.sy*(height+
metrics.underline_position+metrics.descent*2)/2.0);
(void) CloneString(&annotate_info->primitive,primitive);
(void) DrawImage(image,annotate_info,exception);
}
-
+ }
status=RenderType(image,annotate,&offset,&metrics,exception);
if (status == MagickFalse)
break;
metrics->bounds.y1=metrics->descent;
metrics->bounds.x2=metrics->ascent+metrics->descent;
metrics->bounds.y2=metrics->ascent+metrics->descent;
- metrics->underline_position=face->underline_position*(metrics->pixels_per_em.x/face->units_per_EM);
- metrics->underline_thickness=face->underline_thickness*(metrics->pixels_per_em.x/face->units_per_EM);
-
+ metrics->underline_position=face->underline_position*
+ (metrics->pixels_per_em.x/face->units_per_EM);
+ metrics->underline_thickness=face->underline_thickness*
+ (metrics->pixels_per_em.x/face->units_per_EM);
if ((draw_info->text == (char *) NULL) || (*draw_info->text == '\0'))
{
(void) FT_Done_Face(face);