diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fontset.h | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/fontset.h b/src/fontset.h index 1a920ac69ec..524a92c274d 100644 --- a/src/fontset.h +++ b/src/fontset.h | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | /* Header for fontset handler. | 1 | /* Header for fontset handler. |
| 2 | Copyright (C) 1995, 1997, 2000 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 | Copyright (C) 2001, 2002 | ||
| 5 | National Institute of Advanced Industrial Science and Technology (AIST) | ||
| 6 | Registration Number H13PRO009 | ||
| 4 | 7 | ||
| 5 | This file is part of GNU Emacs. | 8 | This file is part of GNU Emacs. |
| 6 | 9 | ||
| @@ -61,25 +64,15 @@ struct font_info | |||
| 61 | of lines. */ | 64 | of lines. */ |
| 62 | int vertical_centering; | 65 | int vertical_centering; |
| 63 | 66 | ||
| 64 | /* Encodings of the font indexed by CHARSET. The value is one of | 67 | /* Encoding type of the font. The value is one of |
| 65 | 0, 1, 2, or 3: | 68 | 0, 1, 2, or 3: |
| 66 | 0: code points 0x20..0x7F or 0x2020..0x7F7F are used | 69 | 0: code points 0x20..0x7F or 0x2020..0x7F7F are used |
| 67 | 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used | 70 | 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used |
| 68 | 2: code points 0x20A0..0x7FFF are used | 71 | 2: code points 0x20A0..0x7FFF are used |
| 69 | 3: code points 0xA020..0xFF7F are used | 72 | 3: code points 0xA020..0xFF7F are used |
| 70 | For instance, ASCII and Latin-1 characters may use the same font | ||
| 71 | but different code points (ASCII uses 0x20..0x7F and Latin-1 uses | ||
| 72 | 0xA0..0xFF). | ||
| 73 | |||
| 74 | If the value can't be decided from information of the font, we | ||
| 75 | consult `font-encoding-alist' to get of the corresponding charset | ||
| 76 | whose default value is defined in lisp/fontset.el. Since there's | ||
| 77 | no charset whose id is 1, we use encoding[1] to store the | ||
| 78 | encoding information decided by the font itself. | ||
| 79 | |||
| 80 | If the member `font_encoder' is not NULL, this member is ignored. | 73 | If the member `font_encoder' is not NULL, this member is ignored. |
| 81 | */ | 74 | */ |
| 82 | unsigned char encoding[MAX_CHARSET + 1]; | 75 | unsigned char encoding_type; |
| 83 | 76 | ||
| 84 | /* The baseline position of a font is normally `ascent' value of the | 77 | /* The baseline position of a font is normally `ascent' value of the |
| 85 | font. However, there exists many fonts which don't set `ascent' | 78 | font. However, there exists many fonts which don't set `ascent' |
| @@ -139,6 +132,17 @@ struct font_info | |||
| 139 | to be used. */ | 132 | to be used. */ |
| 140 | #define FONT_ENCODING_NOT_DECIDED 255 | 133 | #define FONT_ENCODING_NOT_DECIDED 255 |
| 141 | 134 | ||
| 135 | enum FONT_SPEC_INDEX | ||
| 136 | { | ||
| 137 | FONT_SPEC_FAMILY_INDEX, | ||
| 138 | FONT_SPEC_WEIGHT_INDEX, | ||
| 139 | FONT_SPEC_SLANT_INDEX, | ||
| 140 | FONT_SPEC_SWIDTH_INDEX, | ||
| 141 | FONT_SPEC_ADSTYLE_INDEX, | ||
| 142 | FONT_SPEC_REGISTRY_INDEX, | ||
| 143 | FONT_SPEC_MAX_INDEX | ||
| 144 | }; | ||
| 145 | |||
| 142 | /* Forward declaration for prototypes. */ | 146 | /* Forward declaration for prototypes. */ |
| 143 | struct frame; | 147 | struct frame; |
| 144 | 148 | ||
| @@ -184,12 +188,11 @@ extern void (*check_window_system_func) P_ ((void)); | |||
| 184 | struct face; | 188 | struct face; |
| 185 | 189 | ||
| 186 | extern void free_face_fontset P_ ((FRAME_PTR, struct face *)); | 190 | extern void free_face_fontset P_ ((FRAME_PTR, struct face *)); |
| 187 | extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, int, int)); | 191 | extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, struct face *, int)); |
| 188 | extern int face_suitable_for_char_p P_ ((struct face *, int)); | 192 | extern int face_suitable_for_char_p P_ ((struct face *, int)); |
| 189 | extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); | 193 | extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); |
| 190 | extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); | 194 | extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); |
| 191 | extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int, | 195 | extern struct font_info *fs_load_font P_ ((struct frame *, char *)); |
| 192 | struct face *)); | ||
| 193 | extern int fs_query_fontset P_ ((Lisp_Object, int)); | 196 | extern int fs_query_fontset P_ ((Lisp_Object, int)); |
| 194 | EXFUN (Fquery_fontset, 2); | 197 | EXFUN (Fquery_fontset, 2); |
| 195 | extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); | 198 | extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); |
| @@ -201,19 +204,13 @@ extern Lisp_Object Valternate_fontname_alist; | |||
| 201 | extern Lisp_Object Vfontset_alias_alist; | 204 | extern Lisp_Object Vfontset_alias_alist; |
| 202 | extern Lisp_Object Vvertical_centering_font_regexp; | 205 | extern Lisp_Object Vvertical_centering_font_regexp; |
| 203 | 206 | ||
| 204 | /* Load a font named FONTNAME for displaying character C. All fonts | 207 | /* Load a font named FONTNAME on frame F. All fonts for frame F is |
| 205 | for frame F is stored in a table pointed by FONT_TABLE. Return a | 208 | stored in a table pointed by FONT_TABLE. Return a pointer to the |
| 206 | pointer to the struct font_info of the loaded font. If loading | 209 | struct font_info of the loaded font. If loading fails, return |
| 207 | fails, return 0; If FONTNAME is NULL, the name is taken from the | 210 | NULL. */ |
| 208 | information of FONTSET. If FONTSET is given, try to load a font | ||
| 209 | whose size matches that of FONTSET, and, the font index is stored | ||
| 210 | in the table for FONTSET. */ | ||
| 211 | 211 | ||
| 212 | #define FS_LOAD_FONT(f, c, fontname, fontset) \ | 212 | #define FS_LOAD_FONT(f, fontname) fs_load_font (f, fontname) |
| 213 | fs_load_font (f, c, fontname, fontset, NULL) | ||
| 214 | 213 | ||
| 215 | #define FS_LOAD_FACE_FONT(f, c, fontname, face) \ | ||
| 216 | fs_load_font (f, c, fontname, -1, face) | ||
| 217 | 214 | ||
| 218 | /* 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 |
| 219 | 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 |