From: handa Date: Fri, 29 Oct 2004 07:42:01 +0000 (+0000) Subject: (xlfd_parse_name): If avgwidth is 0, set the size to 0. X-Git-Tag: REL-1-2-0~95 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c881797ec96de68df1b47076e41c94802f4775d;p=m17n%2Fm17n-lib.git (xlfd_parse_name): If avgwidth is 0, set the size to 0. --- 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] == '[') {