diff options
| author | Kenichi Handa | 2003-02-20 08:40:35 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-02-20 08:40:35 +0000 |
| commit | e2b45cf9a0b19aef57e1c4645752fc04b17de463 (patch) | |
| tree | 5820019539a2e3c060d294d002249b64fff88216 /src/fontset.c | |
| parent | 20f1ef2e3a9525204b408495fed05724dbcb24e6 (diff) | |
| download | emacs-e2b45cf9a0b19aef57e1c4645752fc04b17de463.tar.gz emacs-e2b45cf9a0b19aef57e1c4645752fc04b17de463.zip | |
(check_fontset_name): If NAME is nil, return the
default fontset.
(override_font_info): New function.
(Ffontset_info): If FONTSET is not the default fontset, merge
FONTSET onto the copy of the default fontset, and work on that
copy.
Diffstat (limited to 'src/fontset.c')
| -rw-r--r-- | src/fontset.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/fontset.c b/src/fontset.c index 2c1074e4d82..c7e5507f248 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -955,7 +955,7 @@ clear_fontset_elements (fontset) | |||
| 955 | 955 | ||
| 956 | /* Check validity of NAME as a fontset name and return the | 956 | /* Check validity of NAME as a fontset name and return the |
| 957 | corresponding fontset. If not valid, signal an error. | 957 | corresponding fontset. If not valid, signal an error. |
| 958 | If NAME is t, return Vdefault_fontset. */ | 958 | If NAME is nil, return Vdefault_fontset. */ |
| 959 | 959 | ||
| 960 | static Lisp_Object | 960 | static Lisp_Object |
| 961 | check_fontset_name (name) | 961 | check_fontset_name (name) |
| @@ -963,7 +963,7 @@ check_fontset_name (name) | |||
| 963 | { | 963 | { |
| 964 | int id; | 964 | int id; |
| 965 | 965 | ||
| 966 | if (EQ (name, Qt)) | 966 | if (EQ (name, Qnil)) |
| 967 | return Vdefault_fontset; | 967 | return Vdefault_fontset; |
| 968 | 968 | ||
| 969 | CHECK_STRING (name); | 969 | CHECK_STRING (name); |
| @@ -1190,12 +1190,25 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 1, 0, | |||
| 1190 | 1190 | ||
| 1191 | 1191 | ||
| 1192 | /* Called from Ffontset_info via map_char_table on each leaf of | 1192 | /* Called from Ffontset_info via map_char_table on each leaf of |
| 1193 | fontset. ARG is a copy of the default fontset. The current leaf | ||
| 1194 | is indexed by CHARACTER and has value ELT. This function override | ||
| 1195 | the copy by ELT if ELT is not nil. */ | ||
| 1196 | |||
| 1197 | static void | ||
| 1198 | override_font_info (fontset, character, elt) | ||
| 1199 | Lisp_Object fontset, character, elt; | ||
| 1200 | { | ||
| 1201 | if (! NILP (elt)) | ||
| 1202 | Faset (fontset, character, elt); | ||
| 1203 | } | ||
| 1204 | |||
| 1205 | /* Called from Ffontset_info via map_char_table on each leaf of | ||
| 1193 | fontset. ARG is a list (LAST FONT-INFO ...), where LAST is `(last | 1206 | fontset. ARG is a list (LAST FONT-INFO ...), where LAST is `(last |
| 1194 | ARG)' and FONT-INFOs have this form: | 1207 | ARG)' and FONT-INFOs have this form: |
| 1195 | (CHAR FONT-SPEC) or ((FROM . TO) FONT-SPEC) | 1208 | (CHAR FONT-SPEC) or ((FROM . TO) FONT-SPEC) |
| 1196 | The current leaf is indexed by CHARACTER and has value ELT. This | 1209 | The current leaf is indexed by CHARACTER and has value ELT. This |
| 1197 | function add the information of the current leaf to ARG by | 1210 | function add the information of the current leaf to ARG by |
| 1198 | appending a new element or modifying the last element.. */ | 1211 | appending a new element or modifying the last element. */ |
| 1199 | 1212 | ||
| 1200 | static void | 1213 | static void |
| 1201 | accumulate_font_info (arg, character, elt) | 1214 | accumulate_font_info (arg, character, elt) |
| @@ -1286,6 +1299,14 @@ If FRAME is omitted, it defaults to the currently selected frame. */) | |||
| 1286 | realized[n_realized++] = elt; | 1299 | realized[n_realized++] = elt; |
| 1287 | } | 1300 | } |
| 1288 | 1301 | ||
| 1302 | if (! EQ (fontset, Vdefault_fontset)) | ||
| 1303 | { | ||
| 1304 | /* Merge FONTSET onto the default fontset. */ | ||
| 1305 | val = Fcopy_sequence (Vdefault_fontset); | ||
| 1306 | map_char_table (override_font_info, Qnil, fontset, val, 0, indices); | ||
| 1307 | fontset = val; | ||
| 1308 | } | ||
| 1309 | |||
| 1289 | /* Accumulate information of the fontset in VAL. The format is | 1310 | /* Accumulate information of the fontset in VAL. The format is |
| 1290 | (LAST FONT-INFO FONT-INFO ...), where FONT-INFO is (CHAR-OR-RANGE | 1311 | (LAST FONT-INFO FONT-INFO ...), where FONT-INFO is (CHAR-OR-RANGE |
| 1291 | FONT-SPEC). See the comment for accumulate_font_info for the | 1312 | FONT-SPEC). See the comment for accumulate_font_info for the |