if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(draw_info != (const DrawInfo *) NULL);
- (void) FormatMagickString(clip_mask,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(clip_mask,MaxTextExtent,"%s",name);
value=GetImageArtifact(image,clip_mask);
if (value == (const char *) NULL)
return(MagickFalse);
double
value;
- value=strtod(point,&p);
+ value=InterpretLocaleValue(point,&p);
return((value == 0.0) && (p == point) ? MagickFalse : MagickTrue);
}
if (LocaleCompare("affine",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=StringToDouble(token);
+ affine.sx=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.rx=StringToDouble(token);
+ affine.rx=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ry=StringToDouble(token);
+ affine.ry=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=StringToDouble(token);
+ affine.sy=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.tx=StringToDouble(token);
+ affine.tx=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=StringToDouble(token);
+ affine.ty=InterpretLocaleValue(token,(char **) NULL);
break;
}
if (LocaleCompare("arc",keyword) == 0)
if (LocaleCompare("fill",keyword) == 0)
{
GetMagickToken(q,&q,token);
- (void) FormatMagickString(pattern,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(pattern,MaxTextExtent,"%s",token);
if (GetImageArtifact(image,pattern) != (const char *) NULL)
(void) DrawPatternPath(image,draw_info,token,
&graphic_context[n]->fill_pattern);
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->fill.opacity=ClampToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*StringToDouble(token)));
+ QuantumRange*(1.0-factor*InterpretLocaleValue(token,
+ (char **) NULL)));
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
if (LocaleCompare("font-size",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->pointsize=StringToDouble(token);
+ graphic_context[n]->pointsize=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
if (LocaleCompare("font-stretch",keyword) == 0)
if (LocaleCompare("interline-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interline_spacing=StringToDouble(token);
+ graphic_context[n]->interline_spacing=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
if (LocaleCompare("interword-spacing",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->interword_spacing=StringToDouble(token);
+ graphic_context[n]->interword_spacing=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
status=MagickFalse;
if (LocaleCompare("kerning",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->kerning=StringToDouble(token);
+ graphic_context[n]->kerning=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
status=MagickFalse;
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->opacity=ClampToQuantum((MagickRealType)
QuantumRange*(1.0-((1.0-QuantumScale*graphic_context[n]->opacity)*
- factor*StringToDouble(token))));
+ factor*InterpretLocaleValue(token,(char **) NULL))));
graphic_context[n]->fill.opacity=graphic_context[n]->opacity;
graphic_context[n]->stroke.opacity=graphic_context[n]->opacity;
break;
name[MaxTextExtent];
GetMagickToken(q,&q,token);
- (void) FormatMagickString(name,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(name,MaxTextExtent,"%s",token);
for (p=q; *q != '\0'; )
{
GetMagickToken(q,&q,token);
GetMagickToken(q,&q,token);
(void) CopyMagickString(type,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- segment.x1=StringToDouble(token);
+ segment.x1=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y1=StringToDouble(token);
+ segment.y1=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.x2=StringToDouble(token);
+ segment.x2=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- segment.y2=StringToDouble(token);
+ segment.y2=InterpretLocaleValue(token,(char **) NULL);
if (LocaleCompare(type,"radial") == 0)
{
GetMagickToken(q,&q,token);
bounds.y2=graphic_context[n]->affine.rx*segment.x2+
graphic_context[n]->affine.sy*segment.y2+
graphic_context[n]->affine.ty;
- (void) FormatMagickString(key,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(key,MaxTextExtent,"%s",name);
(void) SetImageArtifact(image,key,token);
- (void) FormatMagickString(key,MaxTextExtent,"%s-geometry",name);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(key,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%gx%g%+.15g%+.15g",
MagickMax(fabs(bounds.x2-bounds.x1+1.0),1.0),
MagickMax(fabs(bounds.y2-bounds.y1+1.0),1.0),
GetMagickToken(q,&q,token);
(void) CopyMagickString(name,token,MaxTextExtent);
GetMagickToken(q,&q,token);
- bounds.x=(ssize_t) ceil(StringToDouble(token)-0.5);
+ bounds.x=(ssize_t) ceil(InterpretLocaleValue(token,
+ (char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.y=(ssize_t) ceil(StringToDouble(token)-0.5);
+ bounds.y=(ssize_t) ceil(InterpretLocaleValue(token,
+ (char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.width=(size_t) floor(StringToDouble(token)+0.5);
+ bounds.width=(size_t) floor(InterpretLocaleValue(token,
+ (char **) NULL)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- bounds.height=(size_t) floor(StringToDouble(token)+0.5);
+ bounds.height=(size_t) floor(InterpretLocaleValue(token,
+ (char **) NULL)+0.5);
for (p=q; *q != '\0'; )
{
GetMagickToken(q,&q,token);
break;
}
(void) CopyMagickString(token,p,(size_t) (q-p-4+1));
- (void) FormatMagickString(key,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(key,MaxTextExtent,"%s",name);
(void) SetImageArtifact(image,key,token);
- (void) FormatMagickString(key,MaxTextExtent,"%s-geometry",name);
- (void) FormatMagickString(geometry,MaxTextExtent,
+ (void) FormatLocaleString(key,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) bounds.width,(double)
bounds.height,(double) bounds.x,(double) bounds.y);
(void) SetImageArtifact(image,key,geometry);
if (LocaleCompare("rotate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token);
+ angle=InterpretLocaleValue(token,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod((double) angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod((double) angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod((double) angle,360.0))));
if (LocaleCompare("scale",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.sx=StringToDouble(token);
+ affine.sx=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.sy=StringToDouble(token);
+ affine.sy=InterpretLocaleValue(token,(char **) NULL);
break;
}
if (LocaleCompare("skewX",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token);
+ angle=InterpretLocaleValue(token,(char **) NULL);
affine.ry=sin(DegreesToRadians(angle));
break;
}
if (LocaleCompare("skewY",keyword) == 0)
{
GetMagickToken(q,&q,token);
- angle=StringToDouble(token);
+ angle=InterpretLocaleValue(token,(char **) NULL);
affine.rx=(-tan(DegreesToRadians(angle)/2.0));
break;
}
if (LocaleCompare("stroke",keyword) == 0)
{
GetMagickToken(q,&q,token);
- (void) FormatMagickString(pattern,MaxTextExtent,"%s",token);
+ (void) FormatLocaleString(pattern,MaxTextExtent,"%s",token);
if (GetImageArtifact(image,pattern) != (const char *) NULL)
(void) DrawPatternPath(image,draw_info,token,
&graphic_context[n]->stroke_pattern);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_pattern[j]=StringToDouble(token);
+ graphic_context[n]->dash_pattern[j]=InterpretLocaleValue(
+ token,(char **) NULL);
}
if ((x & 0x01) != 0)
for ( ; j < (2*x); j++)
if (LocaleCompare("stroke-dashoffset",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->dash_offset=StringToDouble(token);
+ graphic_context[n]->dash_offset=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
if (LocaleCompare("stroke-linecap",keyword) == 0)
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
graphic_context[n]->stroke.opacity=ClampToQuantum((MagickRealType)
- QuantumRange*(1.0-factor*StringToDouble(token)));
+ QuantumRange*(1.0-factor*InterpretLocaleValue(token,
+ (char **) NULL)));
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->stroke_width=StringToDouble(token);
+ graphic_context[n]->stroke_width=InterpretLocaleValue(token,
+ (char **) NULL);
break;
}
status=MagickFalse;
if (LocaleCompare("translate",keyword) == 0)
{
GetMagickToken(q,&q,token);
- affine.tx=StringToDouble(token);
+ affine.tx=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- affine.ty=StringToDouble(token);
+ affine.ty=InterpretLocaleValue(token,(char **) NULL);
break;
}
status=MagickFalse;
if (LocaleCompare("viewbox",keyword) == 0)
{
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token)-
- 0.5);
+ graphic_context[n]->viewbox.x=(ssize_t) ceil(InterpretLocaleValue(
+ token,(char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token)-
- 0.5);
+ graphic_context[n]->viewbox.y=(ssize_t) ceil(InterpretLocaleValue(
+ token,(char **) NULL)-0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
graphic_context[n]->viewbox.width=(size_t) floor(
- StringToDouble(token)+0.5);
+ InterpretLocaleValue(token,(char **) NULL)+0.5);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
graphic_context[n]->viewbox.height=(size_t) floor(
- StringToDouble(token)+0.5);
+ InterpretLocaleValue(token,(char **) NULL)+0.5);
break;
}
status=MagickFalse;
if (IsPoint(q) == MagickFalse)
break;
GetMagickToken(q,&q,token);
- point.x=StringToDouble(token);
+ point.x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,&q,token);
if (*token == ',')
GetMagickToken(q,&q,token);
- point.y=StringToDouble(token);
+ point.y=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(q,(const char **) NULL,token);
if (*token == ',')
GetMagickToken(q,&q,token);
double
value;
- value=strtod(s,&t);
+ value=InterpretLocaleValue(s,&t);
(void) value;
if (s == t)
{
alpha=bounds.x2-bounds.x1;
beta=bounds.y2-bounds.y1;
radius=hypot((double) alpha,(double) beta);
- length=2*((size_t) ceil(MagickPI*radius))+6*BezierQuantum+360;
+ length=2*((size_t) ceil((double) MagickPI*radius))+6*BezierQuantum+360;
break;
}
default:
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(draw_info != (const DrawInfo *) NULL);
assert(name != (const char *) NULL);
- (void) FormatMagickString(property,MaxTextExtent,"%s",name);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s",name);
path=GetImageArtifact(image,property);
if (path == (const char *) NULL)
return(MagickFalse);
- (void) FormatMagickString(property,MaxTextExtent,"%s-geometry",name);
+ (void) FormatLocaleString(property,MaxTextExtent,"%s-geometry",name);
geometry=GetImageArtifact(image,property);
if (geometry == (const char *) NULL)
return(MagickFalse);
break;
clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
(void) CloneString(&clone_info->text,primitive_info->text);
- (void) FormatMagickString(geometry,MaxTextExtent,"%+f%+f",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f",
primitive_info->point.x,primitive_info->point.y);
(void) CloneString(&clone_info->geometry,geometry);
status=AnnotateImage(image,clone_info);
/*
Resize image.
*/
- (void) FormatMagickString(geometry,MaxTextExtent,"%gx%g!",
+ (void) FormatLocaleString(geometry,MaxTextExtent,"%gx%g!",
primitive_info[1].point.x,primitive_info[1].point.y);
composite_image->filter=image->filter;
(void) TransformImage(&composite_image,(char *) NULL,geometry);
image->gravity=draw_info->gravity;
geometry.x=x;
geometry.y=y;
- (void) FormatMagickString(composite_geometry,MaxTextExtent,
+ (void) FormatLocaleString(composite_geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double)
composite_image->rows,(double) geometry.x,(double) geometry.y);
(void) ParseGravityGeometry(image,composite_geometry,&geometry,
(void) CloneString(&draw_info->encoding,option);
option=GetImageOption(clone_info,"kerning");
if (option != (const char *) NULL)
- draw_info->kerning=StringToDouble(option);
+ draw_info->kerning=InterpretLocaleValue(option,(char **) NULL);
option=GetImageOption(clone_info,"interline-spacing");
if (option != (const char *) NULL)
- draw_info->interline_spacing=StringToDouble(option);
+ draw_info->interline_spacing=InterpretLocaleValue(option,(char **) NULL);
draw_info->direction=UndefinedDirection;
option=GetImageOption(clone_info,"interword-spacing");
if (option != (const char *) NULL)
- draw_info->interword_spacing=StringToDouble(option);
+ draw_info->interword_spacing=InterpretLocaleValue(option,(char **) NULL);
option=GetImageOption(clone_info,"direction");
if (option != (const char *) NULL)
draw_info->direction=(DirectionType) ParseCommandOption(
(void) QueryColorDatabase(option,&draw_info->stroke,exception);
option=GetImageOption(clone_info,"strokewidth");
if (option != (const char *) NULL)
- draw_info->stroke_width=StringToDouble(option);
+ draw_info->stroke_width=InterpretLocaleValue(option,(char **) NULL);
option=GetImageOption(clone_info,"undercolor");
if (option != (const char *) NULL)
(void) QueryColorDatabase(option,&draw_info->undercolor,exception);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.x=StringToDouble(token);
+ arc.x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- arc.y=StringToDouble(token);
+ arc.y=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- angle=StringToDouble(token);
+ angle=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
end.x=(double) (attribute == (int) 'A' ? x : point.x+x);
end.y=(double) (attribute == (int) 'A' ? y : point.y+y);
TraceArcPath(q,point,end,arc,angle,large_arc,sweep);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
end.x=(double) (attribute == (int) 'C' ? x : point.x+x);
end.y=(double) (attribute == (int) 'C' ? y : point.y+y);
points[i]=end;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
point.x=(double) (attribute == (int) 'H' ? x: point.x+x);
TracePoint(q,point);
q+=q->coordinates;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
point.x=(double) (attribute == (int) 'L' ? x : point.x+x);
point.y=(double) (attribute == (int) 'L' ? y : point.y+y);
TracePoint(q,point);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
point.x=(double) (attribute == (int) 'M' ? x : point.x+x);
point.y=(double) (attribute == (int) 'M' ? y : point.y+y);
if (i == 0)
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'Q' ? x : point.x+x);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
if (*p == ',')
p++;
end.x=(double) (attribute == (int) 'S' ? x : point.x+x);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- x=StringToDouble(token);
+ x=InterpretLocaleValue(token,(char **) NULL);
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
end.x=(double) (attribute == (int) 'T' ? x : point.x+x);
end.y=(double) (attribute == (int) 'T' ? y : point.y+y);
points[i]=end;
GetMagickToken(p,&p,token);
if (*token == ',')
GetMagickToken(p,&p,token);
- y=StringToDouble(token);
+ y=InterpretLocaleValue(token,(char **) NULL);
point.y=(double) (attribute == (int) 'V' ? y : point.y+y);
TracePoint(q,point);
q+=q->coordinates;
default:
{
if (isalpha((int) ((unsigned char) attribute)) != 0)
- (void) fprintf(stderr,"attribute not recognized: %c\n",attribute);
+ (void) FormatLocaleFile(stderr,"attribute not recognized: %c\n",
+ attribute);
break;
}
}