comparison src/xfaces.c @ 95377:0c4bba8ae9f2

(Fx_family_fonts): Set frame correctly.
author Kenichi Handa <handa@m17n.org>
date Thu, 29 May 2008 04:46:59 +0000
parents e743691cff9c
children 415f68458e61
comparison
equal deleted inserted replaced
95376:3b1db88e82f9 95377:0c4bba8ae9f2
1752 The result list is sorted according to the current setting of 1752 The result list is sorted according to the current setting of
1753 the face font sort order. */) 1753 the face font sort order. */)
1754 (family, frame) 1754 (family, frame)
1755 Lisp_Object family, frame; 1755 Lisp_Object family, frame;
1756 { 1756 {
1757 struct frame *f = check_x_frame (frame); 1757 Lisp_Object font_spec, vec;
1758 Lisp_Object font_spec = Qnil, vec;
1759 int i, nfonts; 1758 int i, nfonts;
1760 Lisp_Object result; 1759 Lisp_Object result;
1761 1760
1761 if (NILP (frame))
1762 frame = selected_frame;
1763 CHECK_LIVE_FRAME (frame);
1764
1765 font_spec = Ffont_spec (0, NULL);
1762 if (!NILP (family)) 1766 if (!NILP (family))
1763 { 1767 {
1764 CHECK_STRING (family); 1768 CHECK_STRING (family);
1765 font_spec = Ffont_spec (0, NULL);
1766 Ffont_put (font_spec, QCfamily, family); 1769 Ffont_put (font_spec, QCfamily, family);
1767 } 1770 }
1768 vec = font_list_entities (frame, font_spec); 1771 vec = font_list_entities (frame, font_spec);
1769 nfonts = ASIZE (vec); 1772 nfonts = ASIZE (vec);
1770 if (nfonts == 0) 1773 if (nfonts == 0)
1801 Lisp_Object spacing; 1804 Lisp_Object spacing;
1802 1805
1803 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX)); 1806 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
1804 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font)); 1807 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
1805 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10, 1808 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
1806 f->resy); 1809 XFRAME (frame)->resy);
1807 ASET (v, 2, make_number (point)); 1810 ASET (v, 2, make_number (point));
1808 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font)); 1811 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
1809 ASET (v, 4, FONT_SLANT_SYMBOLIC (font)); 1812 ASET (v, 4, FONT_SLANT_SYMBOLIC (font));
1810 spacing = Ffont_get (font, QCspacing); 1813 spacing = Ffont_get (font, QCspacing);
1811 ASET (v, 5, (NILP (spacing) || EQ (spacing, Qp)) ? Qnil : Qt); 1814 ASET (v, 5, (NILP (spacing) || EQ (spacing, Qp)) ? Qnil : Qt);
1812 ASET (v, 6, AREF (font, FONT_NAME_INDEX)); 1815 ASET (v, 6, Ffont_xlfd_name (font, Qnil));
1813 ASET (v, 7, AREF (font, FONT_REGISTRY_INDEX)); 1816 ASET (v, 7, AREF (font, FONT_REGISTRY_INDEX));
1814 1817
1815 result = Fcons (v, result); 1818 result = Fcons (v, result);
1816 } 1819 }
1817 1820