From bb229eecd916a8d07cd4477ccb3f5816a5581e59 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 4 Mar 2004 12:42:56 +0000 Subject: (build_scalable_font_name): If the scalable font is requested for a specific size, don't change that size. (try_font_list): Try a scalable font also in the case that a pattern string is specified, --- src/xfaces.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index a70e13f36c5..e68d17b2d61 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6215,6 +6215,12 @@ build_scalable_font_name (f, font, specified_pt) double resy = FRAME_X_DISPLAY_INFO (f)->resy; double pt; + if (font->numeric[XLFD_PIXEL_SIZE] != 0 + || font->numeric[XLFD_POINT_SIZE] != 0) + /* This is a scalable font but is requested for a specific size. + We should not change that size. */ + return build_font_name (font); + /* If scalable font is for a specific resolution, compute the point size we must specify from the resolution of the display and the specified resolution of the font. */ @@ -6511,7 +6517,16 @@ try_font_list (f, pattern, family, registry, fonts) int nfonts = 0; if (STRINGP (pattern)) - nfonts = font_list (f, pattern, Qnil, Qnil, fonts); + { + nfonts = font_list (f, pattern, Qnil, Qnil, fonts); + if (nfonts == 0 && ! EQ (Vscalable_fonts_allowed, Qt)) + { + int count = SPECPDL_INDEX (); + specbind (Qscalable_fonts_allowed, Qt); + nfonts = font_list (f, pattern, Qnil, Qnil, fonts); + unbind_to (count, Qnil); + } + } else { Lisp_Object tail; -- cgit v1.2.1