double
angle,
coordinates,
+ cursor,
factor,
primitive_extent;
}
token=AcquireString(primitive);
extent=strlen(token)+MagickPathExtent;
+ cursor=0.0;
defsDepth=0;
symbolDepth=0;
macros=GetMVGMacros(primitive);
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)
MagickTrue : MagickFalse;
break;
}
- if (LocaleCompare("text-span",keyword) == 0)
- {
- primitive_type=TextPrimitive;
- break;
- }
if (LocaleCompare("text-undercolor",keyword) == 0)
{
GetNextToken(q,&q,extent,token);
affine.ty=StringToDouble(token,&next_token);
if (token == next_token)
ThrowPointExpectedException(token,exception);
+ cursor=0.0;
break;
}
status=MagickFalse;
}
case TextPrimitive:
{
+ DrawInfo
+ *clone_info;
+
+ TypeMetric
+ metrics;
+
if (primitive_info[j].coordinates != 1)
{
status=MagickFalse;
if (*token != ',')
GetNextToken(q,&q,extent,token);
(void) CloneString(&primitive_info[j].text,token);
+ /*
+ 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);
+ clone_info->render=MagickFalse;
+ clone_info->text=AcquireString(token);
+ (void) ConcatenateString(&clone_info->text," ");
+ status&=GetTypeMetrics(image,clone_info,&metrics,exception);
+ clone_info=DestroyDrawInfo(clone_info);
+ cursor+=metrics.width;
break;
}
case ImagePrimitive:
status&=DrawPrimitive(image,graphic_context[n],primitive_info,
exception);
}
- if (primitive_info->text != (char *) NULL)
- primitive_info->text=(char *) RelinquishMagickMemory(
- primitive_info->text);
proceed=SetImageProgress(image,RenderImageTag,q-primitive,(MagickSizeType)
primitive_extent);
if (proceed == MagickFalse)
macros=DestroySplayTree(macros);
token=DestroyString(token);
if (primitive_info != (PrimitiveInfo *) NULL)
- primitive_info=(PrimitiveInfo *) RelinquishMagickMemory(primitive_info);
+ {
+ for (i=0; primitive_info[i].primitive != UndefinedPrimitive; i++)
+ if (primitive_info[i].text != (char *) NULL)
+ primitive_info[i].text=(char *) RelinquishMagickMemory(
+ primitive_info[i].text);
+ primitive_info=(PrimitiveInfo *) RelinquishMagickMemory(primitive_info);
+ }
primitive=DestroyString(primitive);
if (stops != (StopInfo *) NULL)
stops=(StopInfo *) RelinquishMagickMemory(stops);