aboutsummaryrefslogtreecommitdiffstats
path: root/src/fontset.c
diff options
context:
space:
mode:
authorKenichi Handa2009-03-30 12:51:11 +0000
committerKenichi Handa2009-03-30 12:51:11 +0000
commitd8d2f142e0c318c69e9dbc08af4881d861b07d5a (patch)
tree45970e903b59d1bd0ab909e64b38ce9915b95205 /src/fontset.c
parente386973195212656d80a767e7fc0afb1baf6a75f (diff)
downloademacs-d8d2f142e0c318c69e9dbc08af4881d861b07d5a.tar.gz
emacs-d8d2f142e0c318c69e9dbc08af4881d861b07d5a.zip
(fontset_from_font): Specify only registry in a font-spec for all
characters supported by that registry.
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 51568a50d43..f6c94f53e7e 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1729,7 +1729,14 @@ static Lisp_Object auto_fontset_alist;
1729/* Number of automatically created fontsets. */ 1729/* Number of automatically created fontsets. */
1730static int num_auto_fontsets; 1730static int num_auto_fontsets;
1731 1731
1732/* Retun a fontset synthesized from FONT-OBJECT. */ 1732/* Retun a fontset synthesized from FONT-OBJECT. This is called from
1733 x_new_font when FONT-OBJECT is used for the default ASCII font of a
1734 frame, and the returned fontset is used for the default fontset of
1735 that frame. The fontset specifies a font of the same registry as
1736 FONT-OBJECT for all characters in the repertory of the registry
1737 (see Vfont_encoding_alist). If the repertory is not known, the
1738 fontset specifies the font for all Latin characters assuming that a
1739 user intends to use FONT-OBJECT for Latin characters. */
1733 1740
1734int 1741int
1735fontset_from_font (font_object) 1742fontset_from_font (font_object)
@@ -1765,17 +1772,19 @@ fontset_from_font (font_object)
1765 alias = Fdowncase (AREF (font_object, FONT_NAME_INDEX)); 1772 alias = Fdowncase (AREF (font_object, FONT_NAME_INDEX));
1766 Vfontset_alias_alist = Fcons (Fcons (name, alias), Vfontset_alias_alist); 1773 Vfontset_alias_alist = Fcons (Fcons (name, alias), Vfontset_alias_alist);
1767 auto_fontset_alist = Fcons (Fcons (font_spec, fontset), auto_fontset_alist); 1774 auto_fontset_alist = Fcons (Fcons (font_spec, fontset), auto_fontset_alist);
1768 font_spec = Fcopy_font_spec (font_spec); 1775 font_spec = Ffont_spec (0, NULL);
1769 for (i = FONT_WEIGHT_INDEX; i < FONT_EXTRA_INDEX; i++) 1776 ASET (font_spec, FONT_REGISTRY_INDEX, registry);
1770 ASET (font_spec, i, Qnil); 1777 {
1771 Fset_fontset_font (name, Qlatin, font_spec, Qnil, Qnil); 1778 Lisp_Object target = find_font_encoding (SYMBOL_NAME (registry));
1772 Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); 1779
1773 if (!EQ (registry, Qiso10646_1)) 1780 if (CONSP (target))
1774 { 1781 target = XCDR (target);
1775 font_spec = Fcopy_font_spec (font_spec); 1782 if (! CHARSETP (target))
1776 ASET (font_spec, FONT_REGISTRY_INDEX, Qiso10646_1); 1783 target = Qlatin;
1777 Fset_fontset_font (name, Qlatin, font_spec, Qnil, Qappend); 1784 Fset_fontset_font (name, target, font_spec, Qnil, Qnil);
1778 } 1785 Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil);
1786 }
1787
1779 FONTSET_ASCII (fontset) = font_name; 1788 FONTSET_ASCII (fontset) = font_name;
1780 1789
1781#ifdef HAVE_NS 1790#ifdef HAVE_NS