Mercurial > emacs
diff src/xfaces.c @ 103054:c98dbbb65bad
(Fx_list_fonts): If a font size is specified in PATTERN, set it in
returned scalable fonts.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 23 Apr 2009 01:33:33 +0000 |
parents | 42574e6202e2 |
children | fa8e2c663118 |
line wrap: on
line diff
--- a/src/xfaces.c Wed Apr 22 07:34:17 2009 +0000 +++ b/src/xfaces.c Thu Apr 23 01:33:33 2009 +0000 @@ -1904,7 +1904,22 @@ } 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];