From f65abb56fd59888e0520271018972d20b5e268a1 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 17 Jun 2018 15:39:19 -0400 Subject: [PATCH] ... --- MagickCore/draw.c | 14 +++++++++----- MagickCore/option.c | 1 + MagickCore/type.h | 3 ++- coders/svg.c | 15 +++++++++++++++ configure | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 1b17d6836..cea03b5fb 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -2273,9 +2273,9 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive) if (LocaleCompare("push",token) == 0) { register const char - *sentinel; + *end, + *start; - sentinel=q-strlen(token)-1; GetNextToken(q,&q,extent,token); if (*q == '"') { @@ -2292,6 +2292,7 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive) Named macro (e.g. push graphic-context "wheel"). */ GetNextToken(q,&q,extent,token); + start=q; (void) CopyMagickString(name,token,MagickPathExtent); n=0; for (p=q; *q != '\0'; ) @@ -2309,7 +2310,10 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive) continue; } if (LocaleCompare(token,"pop") == 0) - n--; + { + end=p-strlen(token)-1; + n--; + } if (LocaleCompare(token,"push") == 0) n++; if (n < 0) @@ -2321,8 +2325,8 @@ static SplayTreeInfo *GetMVGMacros(const char *primitive) Extract macro. */ GetNextToken(p,&p,extent,token); - macro=AcquireString(sentinel); - macro[p-sentinel]='\0'; + macro=AcquireString(start); + macro[end-start]='\0'; (void) AddValueToSplayTree(macros,ConstantString(name), ConstantString(macro)); macro=DestroyString(macro); diff --git a/MagickCore/option.c b/MagickCore/option.c index 054f9492d..447235ec0 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -1992,6 +1992,7 @@ static const OptionInfo { { "Undefined", UndefinedStyle, UndefinedOptionFlag, MagickTrue }, { "Any", AnyStyle, UndefinedOptionFlag, MagickFalse }, + { "Bold", BoldStyle, UndefinedOptionFlag, MagickFalse }, { "Italic", ItalicStyle, UndefinedOptionFlag, MagickFalse }, { "Normal", NormalStyle, UndefinedOptionFlag, MagickFalse }, { "Oblique", ObliqueStyle, UndefinedOptionFlag, MagickFalse }, diff --git a/MagickCore/type.h b/MagickCore/type.h index 6e7bd9a2d..95fb8d0e1 100644 --- a/MagickCore/type.h +++ b/MagickCore/type.h @@ -43,7 +43,8 @@ typedef enum NormalStyle, ItalicStyle, ObliqueStyle, - AnyStyle + AnyStyle, + BoldStyle } StyleType; typedef struct _TypeInfo diff --git a/coders/svg.c b/coders/svg.c index 1442d9dd4..9455d3d99 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -809,6 +809,21 @@ static void SVGProcessStyleElement(void *context,const xmlChar *name, value); break; } + if (LocaleCompare(keyword,"font") == 0) + { + char + family[MagickPathExtent], + size[MagickPathExtent], + style[MagickPathExtent]; + + if (sscanf(value,"%2048s %2048s %2048s",style,size,family) != 3) + break; + (void) FormatLocaleFile(svg_info->file,"font-style \"%s\"\n",style); + (void) FormatLocaleFile(svg_info->file,"font-size \"%s\"\n",size); + (void) FormatLocaleFile(svg_info->file,"font-family \"%s\"\n", + family); + break; + } if (LocaleCompare(keyword,"font-family") == 0) { (void) FormatLocaleFile(svg_info->file,"font-family \"%s\"\n", diff --git a/configure b/configure index 9eb73aff8..023eb88f6 100755 --- a/configure +++ b/configure @@ -4554,7 +4554,7 @@ MAGICK_PATCHLEVEL_VERSION=2 MAGICK_VERSION=7.0.8-2 -MAGICK_GIT_REVISION=14469:13e51d19c:20180617 +MAGICK_GIT_REVISION=14473:578a60bd3:20180617 # Substitute library versioning -- 2.40.0