1 |
/* Header for fontset handler. |
/* Header for fontset handler. |
2 |
Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. |
Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. |
3 |
Licensed to the Free Software Foundation. |
Licensed to the Free Software Foundation. |
4 |
|
Copyright (C) 2003 |
5 |
|
National Institute of Advanced Industrial Science and Technology (AIST) |
6 |
|
Registration Number H13PRO009 |
7 |
|
|
8 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
9 |
|
|
64 |
of lines. */ |
of lines. */ |
65 |
int vertical_centering; |
int vertical_centering; |
66 |
|
|
67 |
/* Encodings of the font indexed by CHARSET. The value is one of |
/* Encoding type of the font. The value is one of |
68 |
0, 1, 2, or 3: |
0, 1, 2, or 3: |
69 |
0: code points 0x20..0x7F or 0x2020..0x7F7F are used |
0: code points 0x20..0x7F or 0x2020..0x7F7F are used |
70 |
1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used |
1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used |
71 |
2: code points 0x20A0..0x7FFF are used |
2: code points 0x20A0..0x7FFF are used |
72 |
3: code points 0xA020..0xFF7F are used |
3: code points 0xA020..0xFF7F are used |
|
For instance, ASCII and Latin-1 characters may use the same font |
|
|
but different code points (ASCII uses 0x20..0x7F and Latin-1 uses |
|
|
0xA0..0xFF). |
|
|
|
|
|
If the value can't be decided from information of the font, we |
|
|
consult `font-encoding-alist' to get of the corresponding charset |
|
|
whose default value is defined in lisp/fontset.el. Since there's |
|
|
no charset whose id is 1, we use encoding[1] to store the |
|
|
encoding information decided by the font itself. |
|
|
|
|
73 |
If the member `font_encoder' is not NULL, this member is ignored. |
If the member `font_encoder' is not NULL, this member is ignored. |
74 |
*/ |
*/ |
75 |
unsigned char encoding[MAX_CHARSET + 1]; |
unsigned char encoding_type; |
76 |
|
|
77 |
/* The baseline position of a font is normally `ascent' value of the |
/* The baseline position of a font is normally `ascent' value of the |
78 |
font. However, there exists many fonts which don't set `ascent' |
font. However, there exists many fonts which don't set `ascent' |
132 |
to be used. */ |
to be used. */ |
133 |
#define FONT_ENCODING_NOT_DECIDED 255 |
#define FONT_ENCODING_NOT_DECIDED 255 |
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 |
|
|
146 |
/* Forward declaration for prototypes. */ |
/* Forward declaration for prototypes. */ |
147 |
struct frame; |
struct frame; |
148 |
|
|
182 |
This function set the memer `encoder' of the structure. */ |
This function set the memer `encoder' of the structure. */ |
183 |
extern void (*find_ccl_program_func) P_ ((struct font_info *)); |
extern void (*find_ccl_program_func) P_ ((struct font_info *)); |
184 |
|
|
185 |
|
extern Lisp_Object (*get_font_repertory_func) P_ ((struct frame *, |
186 |
|
struct font_info *)); |
187 |
|
|
188 |
/* Check if any window system is used now. */ |
/* Check if any window system is used now. */ |
189 |
extern void (*check_window_system_func) P_ ((void)); |
extern void (*check_window_system_func) P_ ((void)); |
190 |
|
|
191 |
struct face; |
struct face; |
192 |
|
|
193 |
extern void free_face_fontset P_ ((FRAME_PTR, struct face *)); |
extern void free_face_fontset P_ ((FRAME_PTR, struct face *)); |
194 |
extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, int, int)); |
extern Lisp_Object fontset_font_pattern P_ ((FRAME_PTR, struct face *, int)); |
195 |
extern int face_suitable_for_char_p P_ ((struct face *, int)); |
extern int face_suitable_for_char_p P_ ((struct face *, int)); |
196 |
extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); |
extern int face_for_char P_ ((FRAME_PTR, struct face *, int)); |
197 |
extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int)); |
extern int make_fontset_for_ascii_face P_ ((FRAME_PTR, int, struct face *)); |
198 |
extern struct font_info *fs_load_font P_ ((struct frame *, int, char *, int, |
extern int new_fontset_from_font_name P_ ((Lisp_Object)); |
199 |
struct face *)); |
extern struct font_info *fs_load_font P_ ((struct frame *, char *, int)); |
200 |
extern int fs_query_fontset P_ ((Lisp_Object, int)); |
extern int fs_query_fontset P_ ((Lisp_Object, int)); |
201 |
EXFUN (Fquery_fontset, 2); |
EXFUN (Fquery_fontset, 2); |
202 |
extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); |
extern Lisp_Object list_fontsets P_ ((struct frame *, Lisp_Object, int)); |
203 |
|
|
|
extern Lisp_Object Qfontset; |
|
204 |
extern Lisp_Object Vuse_default_ascent; |
extern Lisp_Object Vuse_default_ascent; |
205 |
extern Lisp_Object Vignore_relative_composition; |
extern Lisp_Object Vignore_relative_composition; |
206 |
extern Lisp_Object Valternate_fontname_alist; |
extern Lisp_Object Valternate_fontname_alist; |
207 |
extern Lisp_Object Vfontset_alias_alist; |
extern Lisp_Object Vfontset_alias_alist; |
208 |
extern Lisp_Object Vvertical_centering_font_regexp; |
extern Lisp_Object Vvertical_centering_font_regexp; |
209 |
|
|
210 |
/* Load a font named FONTNAME for displaying character C. All fonts |
/* Load a font named FONTNAME on frame F. All fonts for frame F is |
211 |
for frame F is stored in a table pointed by FONT_TABLE. Return a |
stored in a table pointed by FONT_TABLE. Return a pointer to the |
212 |
pointer to the struct font_info of the loaded font. If loading |
struct font_info of the loaded font. If loading fails, return |
213 |
fails, return 0; If FONTNAME is NULL, the name is taken from the |
NULL. */ |
|
information of FONTSET. If FONTSET is given, try to load a font |
|
|
whose size matches that of FONTSET, and, the font index is stored |
|
|
in the table for FONTSET. */ |
|
214 |
|
|
215 |
#define FS_LOAD_FONT(f, c, fontname, fontset) \ |
#define FS_LOAD_FONT(f, fontname) fs_load_font (f, fontname, -1) |
|
fs_load_font (f, c, fontname, fontset, NULL) |
|
216 |
|
|
|
#define FS_LOAD_FACE_FONT(f, c, fontname, face) \ |
|
|
fs_load_font (f, c, fontname, -1, face) |
|
217 |
|
|
218 |
/* Return an immutable id for font_info FONT_INFO on frame F. The |
/* 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 |
reason for this macro is hat one cannot hold pointers to font_info |