From 4c881797ec96de68df1b47076e41c94802f4775d Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 29 Oct 2004 07:42:01 +0000 Subject: [PATCH] (xlfd_parse_name): If avgwidth is 0, set the size to 0. --- src/font.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/font.c b/src/font.c index 20de5e0..d391c6d 100644 --- a/src/font.c +++ b/src/font.c @@ -678,7 +678,7 @@ static int xlfd_parse_name (char *name, MFont *font) { char *field[XLFD_FIELD_MAX]; - unsigned short size, resy; + unsigned short size, resy, avgwidth; MSymbol attrs[MFONT_PROPERTY_MAX]; char copy[513]; int i; @@ -710,7 +710,10 @@ xlfd_parse_name (char *name, MFont *font) field[i++] = NULL; resy = field[XLFD_RESY] ? atoi (field[XLFD_RESY]) : 0; - if (! field[XLFD_PIXEL]) + avgwidth = field[XLFD_AVGWIDTH] ? atoi (field[XLFD_AVGWIDTH]) : 0; + if (! avgwidth) + size = 0; + else if (! field[XLFD_PIXEL]) size = field[XLFD_POINT] ? atoi (field[XLFD_POINT]) * resy / 72 : 0; else if (field[XLFD_PIXEL][0] == '[') { -- 1.7.10.4