Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
103053:384db4f6fc8a | 103054:c98dbbb65bad |
---|---|
1902 Ffont_put (font_spec, QCsize, make_number (size)); | 1902 Ffont_put (font_spec, QCsize, make_number (size)); |
1903 Ffont_put (font_spec, QCavgwidth, make_number (avgwidth)); | 1903 Ffont_put (font_spec, QCavgwidth, make_number (avgwidth)); |
1904 } | 1904 } |
1905 args[0] = Flist_fonts (font_spec, frame, maximum, font_spec); | 1905 args[0] = Flist_fonts (font_spec, frame, maximum, font_spec); |
1906 for (tail = args[0]; CONSP (tail); tail = XCDR (tail)) | 1906 for (tail = args[0]; CONSP (tail); tail = XCDR (tail)) |
1907 XSETCAR (tail, Ffont_xlfd_name (XCAR (tail), Qnil)); | 1907 { |
1908 Lisp_Object font_entity; | |
1909 | |
1910 font_entity = XCAR (tail); | |
1911 if ((NILP (AREF (font_entity, FONT_SIZE_INDEX)) | |
1912 || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0) | |
1913 && ! NILP (AREF (font_spec, FONT_SIZE_INDEX))) | |
1914 { | |
1915 /* This is a scalable font. For backward compatibility, | |
1916 we set the specified size. */ | |
1917 font_entity = Fcopy_font_spec (font_entity); | |
1918 ASET (font_entity, FONT_SIZE_INDEX, | |
1919 AREF (font_spec, FONT_SIZE_INDEX)); | |
1920 } | |
1921 XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil)); | |
1922 } | |
1908 if (NILP (frame)) | 1923 if (NILP (frame)) |
1909 /* We don't have to check fontsets. */ | 1924 /* We don't have to check fontsets. */ |
1910 return args[0]; | 1925 return args[0]; |
1911 args[1] = list_fontsets (f, pattern, size); | 1926 args[1] = list_fontsets (f, pattern, size); |
1912 return Fnconc (2, args); | 1927 return Fnconc (2, args); |