diff options
| author | Kenichi Handa | 2000-03-21 00:38:44 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-03-21 00:38:44 +0000 |
| commit | 1afa4408c0340abf288d516d49d20a45d9bc3d1d (patch) | |
| tree | 9b594f20b29dcb435950f8f211739652e75a5cd5 /src | |
| parent | 0d407d778289d6bd33c6f4e0a33a41f25aace397 (diff) | |
| download | emacs-1afa4408c0340abf288d516d49d20a45d9bc3d1d.tar.gz emacs-1afa4408c0340abf288d516d49d20a45d9bc3d1d.zip | |
(FONT_NOT_OPENED, FONT_NOT_FOUND): Macros removed.
(struct fontset_info, struct fontset_data): Structs removed.
(allloc_fontset_data, free_fontset_data, fs_regiser_fontset,
Vglobale_fontset_alist, font_idx_temp): Externs removed.
(fs_load_font, fs_query_fontset): Adjusted for new argument.
(fs_free_face_fontset, fontset_font_pattern,
face_suitable_for_char_p, face_for_char,
make_fontset_for_ascii_face): Extern them.
(FS_LOAD_FONT): Adjusted for the change of fontset implementation.
(FS_LOAD_FACE_FONT): New macro.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fontset.h | 118 |
1 files changed, 41 insertions, 77 deletions
diff --git a/src/fontset.h b/src/fontset.h index 56738758217..031fdbb431d 100644 --- a/src/fontset.h +++ b/src/fontset.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Header for fontset handler. | 1 | /* Header for fontset handler. |
| 2 | Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. | 2 | Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. |
| 3 | Licensed to the Free Software Foundation. | 3 | Licensed to the Free Software Foundation. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -47,14 +47,16 @@ struct font_info | |||
| 47 | X window, this is same as (font->max_bounds.width) */ | 47 | X window, this is same as (font->max_bounds.width) */ |
| 48 | int size; | 48 | int size; |
| 49 | 49 | ||
| 50 | /* Height of the font. On X window, this is same as (font->ascent | 50 | /* Height of the font. On X window, this is the same as |
| 51 | + font->descent). */ | 51 | (font->ascent + font->descent). */ |
| 52 | int height; | 52 | int height; |
| 53 | 53 | ||
| 54 | /* 1 iff we render characters at vartical center positions of lines. */ | 54 | /* 1 iff `vertical-centering-font-regexp' matches this font name. |
| 55 | In this case, we render characters at vartical center positions | ||
| 56 | of lines. */ | ||
| 55 | int vertical_centering; | 57 | int vertical_centering; |
| 56 | 58 | ||
| 57 | /* Encodings of the font indexed by CHARSET. The value an integer | 59 | /* Encodings of the font indexed by CHARSET. The value is one of |
| 58 | 0, 1, 2, or 3: | 60 | 0, 1, 2, or 3: |
| 59 | 0: code points 0x20..0x7F or 0x2020..0x7F7F are used | 61 | 0: code points 0x20..0x7F or 0x2020..0x7F7F are used |
| 60 | 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used | 62 | 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used |
| @@ -68,7 +70,10 @@ struct font_info | |||
| 68 | consult `font-encoding-alist' to get of the corresponding charset | 70 | consult `font-encoding-alist' to get of the corresponding charset |
| 69 | whose default value is defined in lisp/fontset.el. Since there's | 71 | whose default value is defined in lisp/fontset.el. Since there's |
| 70 | no charset whose id is 1, we use encoding[1] to store the | 72 | no charset whose id is 1, we use encoding[1] to store the |
| 71 | encoding information decided by the font itself. */ | 73 | encoding information decided by the font itself. |
| 74 | |||
| 75 | If the member `font_encoder' is not NULL, this member is ignored. | ||
| 76 | */ | ||
| 72 | unsigned char encoding[MAX_CHARSET + 1]; | 77 | unsigned char encoding[MAX_CHARSET + 1]; |
| 73 | 78 | ||
| 74 | /* The baseline position of a font is normally `ascent' value of the | 79 | /* The baseline position of a font is normally `ascent' value of the |
| @@ -124,51 +129,11 @@ struct font_info | |||
| 124 | struct ccl_program *font_encoder; | 129 | struct ccl_program *font_encoder; |
| 125 | }; | 130 | }; |
| 126 | 131 | ||
| 127 | /* A value which may appear in the member encoding of struch font_info | 132 | /* A value which may appear in the member `encoding' of struch |
| 128 | indicating that a font itself doesn't tell which encoding to be | 133 | font_info indicating that a font itself doesn't tell which encoding |
| 129 | used. */ | 134 | to be used. */ |
| 130 | #define FONT_ENCODING_NOT_DECIDED 255 | 135 | #define FONT_ENCODING_NOT_DECIDED 255 |
| 131 | 136 | ||
| 132 | #define FONT_NOT_OPENED -1 | ||
| 133 | #define FONT_NOT_FOUND -2 | ||
| 134 | |||
| 135 | struct fontset_info | ||
| 136 | { | ||
| 137 | /* Name of the fontset. */ | ||
| 138 | char *name; | ||
| 139 | |||
| 140 | /* Size of the fontset. This is the same as the size of ASCII font | ||
| 141 | of this fontset. */ | ||
| 142 | int size; | ||
| 143 | |||
| 144 | /* Height of the tallest font in the fontset. */ | ||
| 145 | int height; | ||
| 146 | |||
| 147 | /* Table of font name for each character set. */ | ||
| 148 | char *fontname[MAX_CHARSET + 1]; | ||
| 149 | |||
| 150 | /* Table of index numbers of fonts indexed by charset. If a font is | ||
| 151 | not yet loaded, the value is -1 (FONT_NOT_OPENED). If font | ||
| 152 | loading is failed, the value is -2 (FONT_NOT_FOUND). */ | ||
| 153 | int font_indexes[MAX_CHARSET + 1]; | ||
| 154 | }; | ||
| 155 | |||
| 156 | /* This data type is used for the fontset_data field of struct frame. */ | ||
| 157 | |||
| 158 | struct fontset_data | ||
| 159 | { | ||
| 160 | /* A table of pointers to all the fontsets. */ | ||
| 161 | struct fontset_info **fontset_table; | ||
| 162 | |||
| 163 | /* The current capacity of fontset_table. */ | ||
| 164 | int fontset_table_size; | ||
| 165 | |||
| 166 | /* The number of fontsets actually stored in fontset_table. | ||
| 167 | fontset_table[n] is used and valid iff 0 <= n < n_fontsets. | ||
| 168 | 0 <= n_fontsets <= fontset_table_size. */ | ||
| 169 | int n_fontsets; | ||
| 170 | }; | ||
| 171 | |||
| 172 | /* Forward declaration for prototypes. */ | 137 | /* Forward declaration for prototypes. */ |
| 173 | struct frame; | 138 | struct frame; |
| 174 | 139 | ||
| @@ -211,46 +176,41 @@ extern void (*find_ccl_program_func) P_ ((struct font_info *)); | |||
| 211 | /* Check if any window system is used now. */ | 176 | /* Check if any window system is used now. */ |
| 212 | extern void (*check_window_system_func) P_ ((void)); | 177 | extern void (*check_window_system_func) P_ ((void)); |
| 213 | 178 | ||
| 214 | extern struct fontset_data *alloc_fontset_data P_ ((void)); | 179 | struct face; |
| 215 | extern void free_fontset_data P_ ((struct fontset_data *)); | 180 | |
| 216 | extern struct font_info *fs_load_font P_ ((struct frame *, struct font_info *, | 181 | extern void fs_free_face_fontset P_ ((FRAME_PTR, struct face *)); |
| 217 | int, char *, int)); | 182 | extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, int, int)); |
| 218 | extern int fs_query_fontset P_ ((struct frame *, char *)); | 183 | extern int face_suitable_for_char_p P_ ((struct face *, int)); |
| 219 | extern int fs_register_fontset P_ ((struct frame *, Lisp_Object)); | 184 | extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); |
| 185 | extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); | ||
| 186 | extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int, | ||
| 187 | struct face *)); | ||
| 188 | extern int fs_query_fontset P_ ((Lisp_Object, int)); | ||
| 220 | EXFUN (Fquery_fontset, 2); | 189 | EXFUN (Fquery_fontset, 2); |
| 221 | extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); | 190 | extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); |
| 222 | extern Lisp_Object Vglobal_fontset_alist; | ||
| 223 | struct frame; | ||
| 224 | int fs_query_fontset P_ ((struct frame *f, char *name)); | ||
| 225 | 191 | ||
| 226 | extern Lisp_Object Qfontset; | 192 | extern Lisp_Object Qfontset; |
| 227 | extern Lisp_Object Vuse_default_ascent; | 193 | extern Lisp_Object Vuse_default_ascent; |
| 228 | extern Lisp_Object Vignore_relative_composition; | 194 | extern Lisp_Object Vignore_relative_composition; |
| 229 | extern Lisp_Object Valternate_fontname_alist; | 195 | extern Lisp_Object Valternate_fontname_alist; |
| 196 | extern Lisp_Object Vfontset_alias_alist; | ||
| 230 | extern Lisp_Object Vhighlight_wrong_size_font; | 197 | extern Lisp_Object Vhighlight_wrong_size_font; |
| 231 | extern Lisp_Object Vclip_large_size_font; | 198 | extern Lisp_Object Vclip_large_size_font; |
| 232 | extern Lisp_Object Vvertical_centering_font_regexp; | 199 | extern Lisp_Object Vvertical_centering_font_regexp; |
| 233 | extern int font_idx_temp; | ||
| 234 | |||
| 235 | /* Load a font named FONTNAME for displaying CHARSET on frame F. | ||
| 236 | All fonts for frame F is stored in a table pointed by FONT_TABLE. | ||
| 237 | Return a pointer to the struct font_info of the loaded font. | ||
| 238 | If loading fails, return 0; | ||
| 239 | If FONTNAME is NULL, the name is taken from the information of FONTSET. | ||
| 240 | If FONTSET is given, try to load a font whose size matches that of | ||
| 241 | FONTSET, and, the font index is stored in the table for FONTSET. */ | ||
| 242 | |||
| 243 | #define FS_LOAD_FONT(f, font_table, charset, fontname, fontset) \ | ||
| 244 | (fontset >= 0 && fontset < FRAME_FONTSET_DATA (f)->n_fontsets \ | ||
| 245 | && (font_idx_temp = (FRAME_FONTSET_DATA (f) \ | ||
| 246 | ->fontset_table[fontset]->font_indexes[charset]), \ | ||
| 247 | font_idx_temp >= 0) \ | ||
| 248 | ? font_table + font_idx_temp \ | ||
| 249 | : fs_load_font (f, font_table, charset, fontname, fontset)) | ||
| 250 | 200 | ||
| 251 | extern Lisp_Object Vfontset_alias_alist; | 201 | /* Load a font named FONTNAME for displaying character C. All fonts |
| 252 | extern Lisp_Object Vglobal_fontset_alist; | 202 | for frame F is stored in a table pointed by FONT_TABLE. Return a |
| 203 | pointer to the struct font_info of the loaded font. If loading | ||
| 204 | fails, return 0; If FONTNAME is NULL, the name is taken from the | ||
| 205 | information of FONTSET. If FONTSET is given, try to load a font | ||
| 206 | whose size matches that of FONTSET, and, the font index is stored | ||
| 207 | in the table for FONTSET. */ | ||
| 208 | |||
| 209 | #define FS_LOAD_FONT(f, c, fontname, fontset) \ | ||
| 210 | fs_load_font (f, c, fontname, fontset, NULL) | ||
| 253 | 211 | ||
| 212 | #define FS_LOAD_FACE_FONT(f, c, fontname, face) \ | ||
| 213 | fs_load_font (f, c, fontname, -1, face) | ||
| 254 | 214 | ||
| 255 | /* Return an immutable id for font_info FONT_INFO on frame F. The | 215 | /* Return an immutable id for font_info FONT_INFO on frame F. The |
| 256 | reason for this macro is hat one cannot hold pointers to font_info | 216 | reason for this macro is hat one cannot hold pointers to font_info |
| @@ -268,4 +228,8 @@ extern Lisp_Object Vglobal_fontset_alist; | |||
| 268 | ? (FRAME_X_DISPLAY_INFO ((F))->font_table + (ID)) \ | 228 | ? (FRAME_X_DISPLAY_INFO ((F))->font_table + (ID)) \ |
| 269 | : 0) | 229 | : 0) |
| 270 | 230 | ||
| 231 | extern Lisp_Object fontset_name P_ ((int)); | ||
| 232 | extern Lisp_Object fontset_ascii P_ ((int)); | ||
| 233 | extern int fontset_height P_ ((int)); | ||
| 234 | |||
| 271 | #endif /* _FONTSET_H */ | 235 | #endif /* _FONTSET_H */ |