1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00

(font_parse_xlfd): Check DPI and AVGWIDTH properties more rigidly.

This commit is contained in:
Kenichi Handa 2009-07-28 02:09:52 +00:00
parent 4fa58085e3
commit 087048cd5d
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2009-07-28 Kenichi Handa <handa@m17n.org>
* font.c (font_parse_xlfd): Check DPI and AVGWIDTH properties more
rigidly.
* xfont.c (xfont_list_pattern): Don't ignore the return value of
font_parse_xlfd. Check font properties more rigidly.
2009-07-27 Dan Nicolaescu <dann@ics.uci.edu>
* s/netbsd.h (SIGNALS_VIA_CHARACTERS): Remove, already defined in bsd-common.h

View File

@ -1139,7 +1139,10 @@ font_parse_xlfd (name, font)
}
}
ASET (font, FONT_DPI_INDEX, INTERN_FIELD (XLFD_RESY_INDEX));
val = INTERN_FIELD (XLFD_RESY_INDEX);
if (! NILP (val) && ! INTEGERP (val))
return -1;
ASET (font, FONT_DPI_INDEX, val);
val = INTERN_FIELD (XLFD_SPACING_INDEX);
if (! NILP (val))
{
@ -1151,8 +1154,10 @@ font_parse_xlfd (name, font)
p = f[XLFD_AVGWIDTH_INDEX];
if (*p == '~')
p++;
ASET (font, FONT_AVGWIDTH_INDEX,
font_intern_prop (p, f[XLFD_REGISTRY_INDEX] - 1 - p, 0));
val = font_intern_prop (p, f[XLFD_REGISTRY_INDEX] - 1 - p, 0);
if (! NILP (val) && ! INTEGERP (val))
return -1;
ASET (font, FONT_AVGWIDTH_INDEX, val);
}
else
{