diff options
| author | Kenichi Handa | 2009-03-30 12:51:11 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-03-30 12:51:11 +0000 |
| commit | d8d2f142e0c318c69e9dbc08af4881d861b07d5a (patch) | |
| tree | 45970e903b59d1bd0ab909e64b38ce9915b95205 /src | |
| parent | e386973195212656d80a767e7fc0afb1baf6a75f (diff) | |
| download | emacs-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')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/fontset.c | 33 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2b743f6176f..79c79f59eac 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-03-30 Kenichi Handa <handa@m17n.org> | 1 | 2009-03-30 Kenichi Handa <handa@m17n.org> |
| 2 | 2 | ||
| 3 | * fontset.c (fontset_from_font): Specify only registry in a | ||
| 4 | font-spec for all characters supported by that registry. | ||
| 5 | |||
| 3 | * ftfont.c: Fix previous change. Define ftfont_variation_glyphs | 6 | * ftfont.c: Fix previous change. Define ftfont_variation_glyphs |
| 4 | even if HAVE_M17N_FLT is not defined. | 7 | even if HAVE_M17N_FLT is not defined. |
| 5 | 8 | ||
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. */ |
| 1730 | static int num_auto_fontsets; | 1730 | static 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 | ||
| 1734 | int | 1741 | int |
| 1735 | fontset_from_font (font_object) | 1742 | fontset_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 |