annotate src/w32font.h @ 95327:257f10afe123

Add todo.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 27 May 2008 00:20:23 +0000
parents 29adfc9354e7
children 2fc5aff56d81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
1 /* Shared GDI and Uniscribe Font backend declarations for the W32 API.
91448
a9ab858a06c6 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 91254
diff changeset
2 Copyright (C) 2007, 2008 Free Software Foundation, Inc.
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
3
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
4 This file is part of GNU Emacs.
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
5
94994
29adfc9354e7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94916
diff changeset
6 GNU Emacs is free software: you can redistribute it and/or modify
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
94994
29adfc9354e7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94916
diff changeset
8 the Free Software Foundation, either version 3 of the License, or
29adfc9354e7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94916
diff changeset
9 (at your option) any later version.
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
10
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
14 GNU General Public License for more details.
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
15
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
94994
29adfc9354e7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94916
diff changeset
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
18
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
19 #ifndef EMACS_W32FONT_H
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
20 #define EMACS_W32FONT_H
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
21
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
22
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
23 /* Bit 17 of ntmFlags in NEWTEXTMETRIC is set for Postscript OpenType fonts,
92408
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
24 bit 18 for Truetype OpenType fonts, bit 20 for Type1 fonts. */
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
25 #ifndef NTM_PS_OPENTYPE
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
26 #define NTM_PS_OPENTYPE 0x00020000
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
27 #endif
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
28 #ifndef NTM_TT_OPENTYPE
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
29 #define NTM_TT_OPENTYPE 0x00040000
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
30 #endif
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
31 #ifndef NTM_TYPE1
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
32 #define NTM_TYPE1 0x00100000
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
33 #endif
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
34
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
35 #define NTMFLAGS_OPENTYPE (NTM_PS_OPENTYPE | NTM_TT_OPENTYPE)
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
36
93860
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
37 struct w32_metric_cache
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
38 {
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
39 short lbearing, rbearing, width;
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
40 unsigned char status;
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
41 };
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
42
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
43 #define W32METRIC_NO_ATTEMPT 0
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
44 #define W32METRIC_SUCCESS 1
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
45 #define W32METRIC_FAIL 2
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
46
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
47 /* The actual structure for a w32 font, that can be cast to struct font.
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
48 The Uniscribe backend extends this. */
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
49 struct w32font_info
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
50 {
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
51 struct font font;
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
52 TEXTMETRIC metrics;
92408
a371504924ef (NTM_PS_OPENTYPE, NTM_TT_OPENTYPE, NTM_TYPE1): Define
Jason Rumney <jasonr@gnu.org>
parents: 91593
diff changeset
53 unsigned int glyph_idx;
93860
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
54 struct w32_metric_cache **cached_metrics;
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
55 int n_cache_blocks;
94916
283ee643ce8b (struct w32font_info): New member.
Kenichi Handa <handa@m17n.org>
parents: 93860
diff changeset
56 W32FontStruct *compat_w32_font;
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
57 };
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
58
94916
283ee643ce8b (struct w32font_info): New member.
Kenichi Handa <handa@m17n.org>
parents: 93860
diff changeset
59 #define FONT_COMPAT(f) (((struct w32font_info *) (f))->compat_w32_font)
283ee643ce8b (struct w32font_info): New member.
Kenichi Handa <handa@m17n.org>
parents: 93860
diff changeset
60
93860
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
61 #define CACHE_BLOCKSIZE 128
0fecf07dfe3c (struct w32_metric_cache): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 93594
diff changeset
62
91254
21661755910b (w32font_get_cache): Update declaration.
Jason Rumney <jasonr@gnu.org>
parents: 91213
diff changeset
63 Lisp_Object w32font_get_cache P_ ((FRAME_PTR fe));
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
64 Lisp_Object w32font_list_internal P_ ((Lisp_Object frame,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
65 Lisp_Object font_spec,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
66 int opentype_only));
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
67 Lisp_Object w32font_match_internal P_ ((Lisp_Object frame,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
68 Lisp_Object font_spec,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
69 int opentype_only));
91210
4de7fe00ac26 (w32font_open_internal): New function.
Jason Rumney <jasonr@gnu.org>
parents: 91206
diff changeset
70 int w32font_open_internal P_ ((FRAME_PTR f, Lisp_Object font_entity,
94916
283ee643ce8b (struct w32font_info): New member.
Kenichi Handa <handa@m17n.org>
parents: 93860
diff changeset
71 int pixel_size, Lisp_Object font_object));
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
72 void w32font_close P_ ((FRAME_PTR f, struct font *font));
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
73 int w32font_has_char P_ ((Lisp_Object entity, int c));
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
74 int w32font_text_extents P_ ((struct font *font, unsigned *code, int nglyphs,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
75 struct font_metrics *metrics));
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
76 int w32font_draw P_ ((struct glyph_string *s, int from, int to,
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
77 int x, int y, int with_background));
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
78
93594
46b8fe649bbc (uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents: 92408
diff changeset
79
46b8fe649bbc (uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents: 92408
diff changeset
80 int uniscribe_check_otf P_ ((LOGFONT *font, Lisp_Object otf_spec));
46b8fe649bbc (uniscribe_check_otf): Declare.
Jason Rumney <jasonr@gnu.org>
parents: 92408
diff changeset
81
91206
d0a0c2702364 New file.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
82 #endif
91213
aaf0103455b0 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 91210
diff changeset
83
aaf0103455b0 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 91210
diff changeset
84 /* arch-tag: ef9d9675-a2a5-4d01-9526-815e9a3da7cb
aaf0103455b0 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 91210
diff changeset
85 (do not change this comment) */