rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftpfr.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* FreeType API for accessing PFR-specific data (specification only). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
|
nuclear@0
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
nuclear@0
|
9 /* */
|
nuclear@0
|
10 /* This file is part of the FreeType project, and may only be used, */
|
nuclear@0
|
11 /* modified, and distributed under the terms of the FreeType project */
|
nuclear@0
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
nuclear@0
|
13 /* this file you indicate that you have read the license and */
|
nuclear@0
|
14 /* understand and accept it fully. */
|
nuclear@0
|
15 /* */
|
nuclear@0
|
16 /***************************************************************************/
|
nuclear@0
|
17
|
nuclear@0
|
18
|
nuclear@0
|
19 #ifndef __FTPFR_H__
|
nuclear@0
|
20 #define __FTPFR_H__
|
nuclear@0
|
21
|
nuclear@0
|
22 #include <ft2build.h>
|
nuclear@0
|
23 #include FT_FREETYPE_H
|
nuclear@0
|
24
|
nuclear@0
|
25 #ifdef FREETYPE_H
|
nuclear@0
|
26 #error "freetype.h of FreeType 1 has been loaded!"
|
nuclear@0
|
27 #error "Please fix the directory search order for header files"
|
nuclear@0
|
28 #error "so that freetype.h of FreeType 2 is found first."
|
nuclear@0
|
29 #endif
|
nuclear@0
|
30
|
nuclear@0
|
31
|
nuclear@0
|
32 FT_BEGIN_HEADER
|
nuclear@0
|
33
|
nuclear@0
|
34
|
nuclear@0
|
35 /*************************************************************************/
|
nuclear@0
|
36 /* */
|
nuclear@0
|
37 /* <Section> */
|
nuclear@0
|
38 /* pfr_fonts */
|
nuclear@0
|
39 /* */
|
nuclear@0
|
40 /* <Title> */
|
nuclear@0
|
41 /* PFR Fonts */
|
nuclear@0
|
42 /* */
|
nuclear@0
|
43 /* <Abstract> */
|
nuclear@0
|
44 /* PFR/TrueDoc specific API. */
|
nuclear@0
|
45 /* */
|
nuclear@0
|
46 /* <Description> */
|
nuclear@0
|
47 /* This section contains the declaration of PFR-specific functions. */
|
nuclear@0
|
48 /* */
|
nuclear@0
|
49 /*************************************************************************/
|
nuclear@0
|
50
|
nuclear@0
|
51
|
nuclear@0
|
52 /**********************************************************************
|
nuclear@0
|
53 *
|
nuclear@0
|
54 * @function:
|
nuclear@0
|
55 * FT_Get_PFR_Metrics
|
nuclear@0
|
56 *
|
nuclear@0
|
57 * @description:
|
nuclear@0
|
58 * Return the outline and metrics resolutions of a given PFR face.
|
nuclear@0
|
59 *
|
nuclear@0
|
60 * @input:
|
nuclear@0
|
61 * face :: Handle to the input face. It can be a non-PFR face.
|
nuclear@0
|
62 *
|
nuclear@0
|
63 * @output:
|
nuclear@0
|
64 * aoutline_resolution ::
|
nuclear@0
|
65 * Outline resolution. This is equivalent to `face->units_per_EM'
|
nuclear@0
|
66 * for non-PFR fonts. Optional (parameter can be NULL).
|
nuclear@0
|
67 *
|
nuclear@0
|
68 * ametrics_resolution ::
|
nuclear@0
|
69 * Metrics resolution. This is equivalent to `outline_resolution'
|
nuclear@0
|
70 * for non-PFR fonts. Optional (parameter can be NULL).
|
nuclear@0
|
71 *
|
nuclear@0
|
72 * ametrics_x_scale ::
|
nuclear@0
|
73 * A 16.16 fixed-point number used to scale distance expressed
|
nuclear@0
|
74 * in metrics units to device sub-pixels. This is equivalent to
|
nuclear@0
|
75 * `face->size->x_scale', but for metrics only. Optional (parameter
|
nuclear@0
|
76 * can be NULL).
|
nuclear@0
|
77 *
|
nuclear@0
|
78 * ametrics_y_scale ::
|
nuclear@0
|
79 * Same as `ametrics_x_scale' but for the vertical direction.
|
nuclear@0
|
80 * optional (parameter can be NULL).
|
nuclear@0
|
81 *
|
nuclear@0
|
82 * @return:
|
nuclear@0
|
83 * FreeType error code. 0~means success.
|
nuclear@0
|
84 *
|
nuclear@0
|
85 * @note:
|
nuclear@0
|
86 * If the input face is not a PFR, this function will return an error.
|
nuclear@0
|
87 * However, in all cases, it will return valid values.
|
nuclear@0
|
88 */
|
nuclear@0
|
89 FT_EXPORT( FT_Error )
|
nuclear@0
|
90 FT_Get_PFR_Metrics( FT_Face face,
|
nuclear@0
|
91 FT_UInt *aoutline_resolution,
|
nuclear@0
|
92 FT_UInt *ametrics_resolution,
|
nuclear@0
|
93 FT_Fixed *ametrics_x_scale,
|
nuclear@0
|
94 FT_Fixed *ametrics_y_scale );
|
nuclear@0
|
95
|
nuclear@0
|
96
|
nuclear@0
|
97 /**********************************************************************
|
nuclear@0
|
98 *
|
nuclear@0
|
99 * @function:
|
nuclear@0
|
100 * FT_Get_PFR_Kerning
|
nuclear@0
|
101 *
|
nuclear@0
|
102 * @description:
|
nuclear@0
|
103 * Return the kerning pair corresponding to two glyphs in a PFR face.
|
nuclear@0
|
104 * The distance is expressed in metrics units, unlike the result of
|
nuclear@0
|
105 * @FT_Get_Kerning.
|
nuclear@0
|
106 *
|
nuclear@0
|
107 * @input:
|
nuclear@0
|
108 * face :: A handle to the input face.
|
nuclear@0
|
109 *
|
nuclear@0
|
110 * left :: Index of the left glyph.
|
nuclear@0
|
111 *
|
nuclear@0
|
112 * right :: Index of the right glyph.
|
nuclear@0
|
113 *
|
nuclear@0
|
114 * @output:
|
nuclear@0
|
115 * avector :: A kerning vector.
|
nuclear@0
|
116 *
|
nuclear@0
|
117 * @return:
|
nuclear@0
|
118 * FreeType error code. 0~means success.
|
nuclear@0
|
119 *
|
nuclear@0
|
120 * @note:
|
nuclear@0
|
121 * This function always return distances in original PFR metrics
|
nuclear@0
|
122 * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
|
nuclear@0
|
123 * mode, which always returns distances converted to outline units.
|
nuclear@0
|
124 *
|
nuclear@0
|
125 * You can use the value of the `x_scale' and `y_scale' parameters
|
nuclear@0
|
126 * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
|
nuclear@0
|
127 */
|
nuclear@0
|
128 FT_EXPORT( FT_Error )
|
nuclear@0
|
129 FT_Get_PFR_Kerning( FT_Face face,
|
nuclear@0
|
130 FT_UInt left,
|
nuclear@0
|
131 FT_UInt right,
|
nuclear@0
|
132 FT_Vector *avector );
|
nuclear@0
|
133
|
nuclear@0
|
134
|
nuclear@0
|
135 /**********************************************************************
|
nuclear@0
|
136 *
|
nuclear@0
|
137 * @function:
|
nuclear@0
|
138 * FT_Get_PFR_Advance
|
nuclear@0
|
139 *
|
nuclear@0
|
140 * @description:
|
nuclear@0
|
141 * Return a given glyph advance, expressed in original metrics units,
|
nuclear@0
|
142 * from a PFR font.
|
nuclear@0
|
143 *
|
nuclear@0
|
144 * @input:
|
nuclear@0
|
145 * face :: A handle to the input face.
|
nuclear@0
|
146 *
|
nuclear@0
|
147 * gindex :: The glyph index.
|
nuclear@0
|
148 *
|
nuclear@0
|
149 * @output:
|
nuclear@0
|
150 * aadvance :: The glyph advance in metrics units.
|
nuclear@0
|
151 *
|
nuclear@0
|
152 * @return:
|
nuclear@0
|
153 * FreeType error code. 0~means success.
|
nuclear@0
|
154 *
|
nuclear@0
|
155 * @note:
|
nuclear@0
|
156 * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
|
nuclear@0
|
157 * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
|
nuclear@0
|
158 */
|
nuclear@0
|
159 FT_EXPORT( FT_Error )
|
nuclear@0
|
160 FT_Get_PFR_Advance( FT_Face face,
|
nuclear@0
|
161 FT_UInt gindex,
|
nuclear@0
|
162 FT_Pos *aadvance );
|
nuclear@0
|
163
|
nuclear@0
|
164 /* */
|
nuclear@0
|
165
|
nuclear@0
|
166
|
nuclear@0
|
167 FT_END_HEADER
|
nuclear@0
|
168
|
nuclear@0
|
169 #endif /* __FTPFR_H__ */
|
nuclear@0
|
170
|
nuclear@0
|
171
|
nuclear@0
|
172 /* END */
|