Debian Codegraph @

texk/xdvik/font-open.h

raw
1 /*
2 * Copyright (c) 2002-2013 the xdvik development team
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23 #ifndef FONT_OPEN_H_
24 #define FONT_OPEN_H_
25
26
27 #if FREETYPE || PS
28
29 #include "util.h" /* get AVL basics */
30
31 #if FREETYPE
32 # include <ft2build.h>
33 # include FT_FREETYPE_H
34 #endif
35
36
37 /*
38 * AVL tree structures.
39 */
40
41 /* Data structure for Type 1 fonts -- contents of psfonts.map */
42 struct avl_t1 {
43 AVL_COMMON;
44 const char *psname; /* PS name of font */
45 const char *fontfile; /* (short) name of pfa/pfb file */
46 const char *encname; /* (short) name of encoding file */
47 const char *addinfo; /* additional PS instructions */
48 # if FREETYPE
49 Boolean bad; /* if later found to be unloadable */
50 struct ftfont *ft; /* pointer to FreeType record */
51 # endif
52 };
53
54
55 # if FREETYPE
56
57 struct ftfont { /* info for FreeType font (Type 1 or TrueType) */
58 FT_Face face; /* NULL means not loaded yet */
59 struct font *first_size;
60 struct avl_t1 *t1;
61 /* struct avl_tt *tt; */
62 struct FT_StreamRec_ stream;
63 struct avl_enc *enc; /* pointer to encoding record */
64 double expn; /* expansion factor */
65 };
66
67 struct avl_enc {
68 AVL_COMMON;
69 Boolean valid;
70 const char *vec[256];
71 };
72
73 # endif /* FREETYPE */
74
75 extern Boolean init_t1_lookup(void);
76 extern Boolean lookup_t1_font(struct font *fontp, const char *fontname);
77 extern FILE *open_t1_font (struct avl_t1 *t1p, const char **path_ret);
78 extern void read_encoding(struct avl_enc *encp);
79
80 #endif /* FREETYPE || PS */
81
82
83 extern FILE *font_open(
84 #if DELAYED_MKTEXPK
85 Boolean load_font_now,
86 #endif
87 struct font *fontp,
88 const char **font_ret,
89 int *dpi_ret);
90
91 #if DELAYED_MKTEXPK
92 void reset_missing_font_count(void);
93 #endif
94
95 #endif /* FONT_OPEN_H_ */