}
token=AcquireString(primitive);
extent=strlen(token)+MagickPathExtent;
- cursor=0.0;
defsDepth=0;
symbolDepth=0;
+ cursor=0.0;
macros=GetMVGMacros(primitive);
status=MagickTrue;
for (q=primitive; *q != '\0'; )
affine.ty=StringToDouble(token,&next_token);
if (token == next_token)
ThrowPointExpectedException(token,exception);
- cursor=0.0;
break;
}
if (LocaleCompare("alpha",keyword) == 0)
if (LocaleCompare("text",keyword) == 0)
{
primitive_type=TextPrimitive;
- /* affine.tx+=cursor; */
break;
}
if (LocaleCompare("text-align",keyword) == 0)
}
case TextPrimitive:
{
+ char
+ geometry[MagickPathExtent];
+
DrawInfo
*clone_info;
Compute text cursor offset.
*/
clone_info=CloneDrawInfo((ImageInfo *) NULL,graphic_context[n]);
- if (clone_info->density != (char *) NULL)
- clone_info->density=DestroyString(clone_info->density);
+ primitive_info->point.x+=cursor;
+ (void) FormatLocaleString(geometry,MagickPathExtent,"%+f%+f",
+ primitive_info->point.x,primitive_info->point.y);
clone_info->render=MagickFalse;
clone_info->text=AcquireString(token);
(void) ConcatenateString(&clone_info->text," ");
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(OptionError,"MustSpecifyImageSize");
draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
+ if (draw_info->density != (char *) NULL)
+ draw_info->density=DestroyString(draw_info->density);
draw_info->affine.sx=image->resolution.x == 0.0 ? 1.0 : image->resolution.x/
96.0;
draw_info->affine.sy=image->resolution.y == 0.0 ? 1.0 : image->resolution.y/
if (sscanf(value,"%2048s %2048s %2048s",style,size,family) != 3)
break;
- (void) FormatLocaleFile(svg_info->file,"font-style \"%s\"\n",style);
+ if (GetUserSpaceCoordinateValue(svg_info,0,style) == 0)
+ (void) FormatLocaleFile(svg_info->file,"font-style \"%s\"\n",
+ style);
+ else
+ if (sscanf(value,"%2048s %2048s",size,family) != 2)
+ break;
(void) FormatLocaleFile(svg_info->file,"font-size \"%s\"\n",size);
(void) FormatLocaleFile(svg_info->file,"font-family \"%s\"\n",
family);
if (LocaleCompare((const char *) name,"text") == 0)
{
PushGraphicContext(id);
+ (void) FormatLocaleFile(svg_info->file,"class \"text\"\n");
(void) FormatLocaleFile(svg_info->file,"translate %g,%g\n",
svg_info->bounds.x,svg_info->bounds.y);
svg_info->center.x=svg_info->bounds.x;
char
*text;
- (void) FormatLocaleFile(svg_info->file,"class \"text\"\n");
text=EscapeString(svg_info->text,'\'');
(void) FormatLocaleFile(svg_info->file,"text 0,0 \"%s\"\n",text);
text=DestroyString(text);
char
*text;
+ (void) FormatLocaleFile(svg_info->file,"class \"tspan\"\n");
text=EscapeString(svg_info->text,'\'');
(void) FormatLocaleFile(svg_info->file,"text %g,%g \"%s\"\n",
svg_info->bounds.x-svg_info->center.x,svg_info->bounds.y-
image=(Image *) NULL;
read_info=CloneImageInfo(image_info);
SetImageInfoBlob(read_info,(void *) NULL,0);
- if (read_info->density != (char *) NULL)
- read_info->density=DestroyString(read_info->density);
(void) FormatLocaleString(read_info->filename,MagickPathExtent,"mvg:%s",
filename);
image=ReadImage(read_info,exception);