From 229dced5f9018c341c837bac977b627e2ccad2c3 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 15 Apr 2018 16:10:41 -0400 Subject: [PATCH] Fix font family regression --- MagickCore/annotate.c | 51 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index bb27add1b..b6db0e6c6 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1012,32 +1012,37 @@ static MagickBooleanType RenderType(Image *image,const DrawInfo *draw_info, if ((type_info == (const TypeInfo *) NULL) && (draw_info->family != (const char *) NULL)) { - char - **family; + type_info=GetTypeInfoByFamily(draw_info->family,draw_info->style, + draw_info->stretch,draw_info->weight,exception); + if (type_info == (const TypeInfo *) NULL) + { + char + **family; - int - number_families; + int + number_families; - register ssize_t - i; + register ssize_t + i; - /* - Parse font family list. - */ - family=StringToArgv(draw_info->family,&number_families); - for (i=1; i < (ssize_t) number_families; i++) - { - type_info=GetTypeInfoByFamily(family[i],draw_info->style, - draw_info->stretch,draw_info->weight,exception); - if (type_info != (const TypeInfo *) NULL) - break; - } - for (i=0; i < (ssize_t) number_families; i++) - family[i]=DestroyString(family[i]); - family=(char **) RelinquishMagickMemory(family); - if (type_info == (const TypeInfo *) NULL) - (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning, - "UnableToReadFont","`%s'",draw_info->family); + /* + Parse font family list. + */ + family=StringToArgv(draw_info->family,&number_families); + for (i=1; i < (ssize_t) number_families; i++) + { + type_info=GetTypeInfoByFamily(family[i],draw_info->style, + draw_info->stretch,draw_info->weight,exception); + if (type_info != (const TypeInfo *) NULL) + break; + } + for (i=0; i < (ssize_t) number_families; i++) + family[i]=DestroyString(family[i]); + family=(char **) RelinquishMagickMemory(family); + if (type_info == (const TypeInfo *) NULL) + (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning, + "UnableToReadFont","`%s'",draw_info->family); + } } if (type_info == (const TypeInfo *) NULL) type_info=GetTypeInfoByFamily("Arial",draw_info->style, -- 2.40.0