1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef EMACS_W32FONT_H
20 #define EMACS_W32FONT_H
21
22 #include "font.h"
23
24
25
26 #ifndef NTM_PS_OPENTYPE
27 #define NTM_PS_OPENTYPE 0x00020000
28 #endif
29 #ifndef NTM_TT_OPENTYPE
30 #define NTM_TT_OPENTYPE 0x00040000
31 #endif
32 #ifndef NTM_TYPE1
33 #define NTM_TYPE1 0x00100000
34 #endif
35
36 #define NTMFLAGS_OPENTYPE (NTM_PS_OPENTYPE | NTM_TT_OPENTYPE)
37
38 struct w32_metric_cache
39 {
40 short lbearing, rbearing, width, ascent, descent;
41 unsigned char status;
42 };
43
44 #define W32METRIC_NO_ATTEMPT 0
45 #define W32METRIC_SUCCESS 1
46 #define W32METRIC_FAIL 2
47
48
49
50 struct w32font_info
51 {
52 struct font font;
53 TEXTMETRICW metrics;
54 unsigned int glyph_idx;
55 struct w32_metric_cache **cached_metrics;
56 int n_cache_blocks;
57 HFONT hfont;
58 };
59
60
61 #define FONT_HANDLE(f) (((struct w32font_info *)(f))->hfont)
62 #define FONT_TEXTMETRIC(f) (((struct w32font_info *)(f))->metrics)
63
64 #define CACHE_BLOCKSIZE 128
65
66 Lisp_Object w32font_get_cache (struct frame *fe);
67 Lisp_Object w32font_list_internal (struct frame *f,
68 Lisp_Object font_spec,
69 bool opentype_only);
70 Lisp_Object w32font_match_internal (struct frame *f,
71 Lisp_Object font_spec,
72 bool opentype_only);
73 int w32font_open_internal (struct frame *f, Lisp_Object font_entity,
74 int pixel_size, Lisp_Object font_object);
75 void w32font_close (struct font *font);
76 int w32font_has_char (Lisp_Object entity, int c);
77 void w32font_text_extents (struct font *font, const unsigned *code, int nglyphs,
78 struct font_metrics *metrics);
79 int w32font_draw (struct glyph_string *s, int from, int to,
80 int x, int y, bool with_background);
81
82
83 int uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec);
84
85 Lisp_Object intern_font_name (char *);
86
87 extern void globals_of_w32font (void);
88
89 #endif