From 493dcf2c9b64d5eb8ef8e218cf1da65ab5f21e92 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 23 Apr 2009 01:34:15 +0000 Subject: [PATCH] (Fx_list_fonts): If a font size is specified in PATTERN, set it in returned scalable fonts. --- src/ChangeLog | 5 +++++ src/xfaces.c | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 58c9272a841..7328c2d54fd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-04-23 Kenichi Handa + + * xfaces.c (Fx_list_fonts): If a font size is specified in + PATTERN, set it in returned scalable fonts. + 2009-04-22 Chong Yidong * keyboard.c (Fset_input_meta_mode): Doc fix. diff --git a/src/xfaces.c b/src/xfaces.c index 62d2cf22196..fa50d45c952 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1904,7 +1904,22 @@ the WIDTH times as wide as FACE on FRAME. */) } args[0] = Flist_fonts (font_spec, frame, maximum, font_spec); for (tail = args[0]; CONSP (tail); tail = XCDR (tail)) - XSETCAR (tail, Ffont_xlfd_name (XCAR (tail), Qnil)); + { + Lisp_Object font_entity; + + font_entity = XCAR (tail); + if ((NILP (AREF (font_entity, FONT_SIZE_INDEX)) + || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0) + && ! NILP (AREF (font_spec, FONT_SIZE_INDEX))) + { + /* This is a scalable font. For backward compatibility, + we set the specified size. */ + font_entity = Fcopy_font_spec (font_entity); + ASET (font_entity, FONT_SIZE_INDEX, + AREF (font_spec, FONT_SIZE_INDEX)); + } + XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil)); + } if (NILP (frame)) /* We don't have to check fontsets. */ return args[0]; -- 2.39.2