54876
|
1 |
/****************************************************************************
|
|
2 |
*
|
|
3 |
* t1tables.h
|
|
4 |
*
|
|
5 |
* Basic Type 1/Type 2 tables definitions and interface (specification
|
|
6 |
* only).
|
|
7 |
*
|
|
8 |
* Copyright (C) 1996-2019 by
|
|
9 |
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
10 |
*
|
|
11 |
* This file is part of the FreeType project, and may only be used,
|
|
12 |
* modified, and distributed under the terms of the FreeType project
|
|
13 |
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
14 |
* this file you indicate that you have read the license and
|
|
15 |
* understand and accept it fully.
|
|
16 |
*
|
|
17 |
*/
|
49234
|
18 |
|
|
19 |
|
|
20 |
#ifndef T1TABLES_H_
|
|
21 |
#define T1TABLES_H_
|
|
22 |
|
|
23 |
|
|
24 |
#include <ft2build.h>
|
|
25 |
#include FT_FREETYPE_H
|
|
26 |
|
|
27 |
#ifdef FREETYPE_H
|
|
28 |
#error "freetype.h of FreeType 1 has been loaded!"
|
|
29 |
#error "Please fix the directory search order for header files"
|
|
30 |
#error "so that freetype.h of FreeType 2 is found first."
|
|
31 |
#endif
|
|
32 |
|
|
33 |
|
|
34 |
FT_BEGIN_HEADER
|
|
35 |
|
|
36 |
|
54876
|
37 |
/**************************************************************************
|
|
38 |
*
|
|
39 |
* @section:
|
|
40 |
* type1_tables
|
|
41 |
*
|
|
42 |
* @title:
|
|
43 |
* Type 1 Tables
|
|
44 |
*
|
|
45 |
* @abstract:
|
|
46 |
* Type~1-specific font tables.
|
|
47 |
*
|
|
48 |
* @description:
|
|
49 |
* This section contains the definition of Type~1-specific tables,
|
|
50 |
* including structures related to other PostScript font formats.
|
|
51 |
*
|
|
52 |
* @order:
|
|
53 |
* PS_FontInfoRec
|
|
54 |
* PS_FontInfo
|
|
55 |
* PS_PrivateRec
|
|
56 |
* PS_Private
|
|
57 |
*
|
|
58 |
* CID_FaceDictRec
|
|
59 |
* CID_FaceDict
|
|
60 |
* CID_FaceInfoRec
|
|
61 |
* CID_FaceInfo
|
|
62 |
*
|
|
63 |
* FT_Has_PS_Glyph_Names
|
|
64 |
* FT_Get_PS_Font_Info
|
|
65 |
* FT_Get_PS_Font_Private
|
|
66 |
* FT_Get_PS_Font_Value
|
|
67 |
*
|
|
68 |
* T1_Blend_Flags
|
|
69 |
* T1_EncodingType
|
|
70 |
* PS_Dict_Keys
|
|
71 |
*
|
|
72 |
*/
|
49234
|
73 |
|
|
74 |
|
|
75 |
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
|
|
76 |
/* structures in order to support Multiple Master fonts. */
|
|
77 |
|
|
78 |
|
54876
|
79 |
/**************************************************************************
|
|
80 |
*
|
|
81 |
* @struct:
|
|
82 |
* PS_FontInfoRec
|
|
83 |
*
|
|
84 |
* @description:
|
|
85 |
* A structure used to model a Type~1 or Type~2 FontInfo dictionary.
|
|
86 |
* Note that for Multiple Master fonts, each instance has its own
|
|
87 |
* FontInfo dictionary.
|
|
88 |
*/
|
49234
|
89 |
typedef struct PS_FontInfoRec_
|
|
90 |
{
|
|
91 |
FT_String* version;
|
|
92 |
FT_String* notice;
|
|
93 |
FT_String* full_name;
|
|
94 |
FT_String* family_name;
|
|
95 |
FT_String* weight;
|
|
96 |
FT_Long italic_angle;
|
|
97 |
FT_Bool is_fixed_pitch;
|
|
98 |
FT_Short underline_position;
|
|
99 |
FT_UShort underline_thickness;
|
|
100 |
|
|
101 |
} PS_FontInfoRec;
|
|
102 |
|
|
103 |
|
54876
|
104 |
/**************************************************************************
|
|
105 |
*
|
|
106 |
* @struct:
|
|
107 |
* PS_FontInfo
|
|
108 |
*
|
|
109 |
* @description:
|
|
110 |
* A handle to a @PS_FontInfoRec structure.
|
|
111 |
*/
|
49234
|
112 |
typedef struct PS_FontInfoRec_* PS_FontInfo;
|
|
113 |
|
|
114 |
|
54876
|
115 |
/**************************************************************************
|
|
116 |
*
|
|
117 |
* @struct:
|
|
118 |
* T1_FontInfo
|
|
119 |
*
|
|
120 |
* @description:
|
|
121 |
* This type is equivalent to @PS_FontInfoRec. It is deprecated but kept
|
|
122 |
* to maintain source compatibility between various versions of FreeType.
|
|
123 |
*/
|
49234
|
124 |
typedef PS_FontInfoRec T1_FontInfo;
|
|
125 |
|
|
126 |
|
54876
|
127 |
/**************************************************************************
|
|
128 |
*
|
|
129 |
* @struct:
|
|
130 |
* PS_PrivateRec
|
|
131 |
*
|
|
132 |
* @description:
|
|
133 |
* A structure used to model a Type~1 or Type~2 private dictionary. Note
|
|
134 |
* that for Multiple Master fonts, each instance has its own Private
|
|
135 |
* dictionary.
|
|
136 |
*/
|
49234
|
137 |
typedef struct PS_PrivateRec_
|
|
138 |
{
|
|
139 |
FT_Int unique_id;
|
|
140 |
FT_Int lenIV;
|
|
141 |
|
|
142 |
FT_Byte num_blue_values;
|
|
143 |
FT_Byte num_other_blues;
|
|
144 |
FT_Byte num_family_blues;
|
|
145 |
FT_Byte num_family_other_blues;
|
|
146 |
|
|
147 |
FT_Short blue_values[14];
|
|
148 |
FT_Short other_blues[10];
|
|
149 |
|
|
150 |
FT_Short family_blues [14];
|
|
151 |
FT_Short family_other_blues[10];
|
|
152 |
|
|
153 |
FT_Fixed blue_scale;
|
|
154 |
FT_Int blue_shift;
|
|
155 |
FT_Int blue_fuzz;
|
|
156 |
|
|
157 |
FT_UShort standard_width[1];
|
|
158 |
FT_UShort standard_height[1];
|
|
159 |
|
|
160 |
FT_Byte num_snap_widths;
|
|
161 |
FT_Byte num_snap_heights;
|
|
162 |
FT_Bool force_bold;
|
|
163 |
FT_Bool round_stem_up;
|
|
164 |
|
|
165 |
FT_Short snap_widths [13]; /* including std width */
|
|
166 |
FT_Short snap_heights[13]; /* including std height */
|
|
167 |
|
|
168 |
FT_Fixed expansion_factor;
|
|
169 |
|
|
170 |
FT_Long language_group;
|
|
171 |
FT_Long password;
|
|
172 |
|
|
173 |
FT_Short min_feature[2];
|
|
174 |
|
|
175 |
} PS_PrivateRec;
|
|
176 |
|
|
177 |
|
54876
|
178 |
/**************************************************************************
|
|
179 |
*
|
|
180 |
* @struct:
|
|
181 |
* PS_Private
|
|
182 |
*
|
|
183 |
* @description:
|
|
184 |
* A handle to a @PS_PrivateRec structure.
|
|
185 |
*/
|
49234
|
186 |
typedef struct PS_PrivateRec_* PS_Private;
|
|
187 |
|
|
188 |
|
54876
|
189 |
/**************************************************************************
|
|
190 |
*
|
|
191 |
* @struct:
|
|
192 |
* T1_Private
|
|
193 |
*
|
|
194 |
* @description:
|
|
195 |
* This type is equivalent to @PS_PrivateRec. It is deprecated but kept
|
|
196 |
* to maintain source compatibility between various versions of FreeType.
|
|
197 |
*/
|
49234
|
198 |
typedef PS_PrivateRec T1_Private;
|
|
199 |
|
|
200 |
|
54876
|
201 |
/**************************************************************************
|
|
202 |
*
|
|
203 |
* @enum:
|
|
204 |
* T1_Blend_Flags
|
|
205 |
*
|
|
206 |
* @description:
|
|
207 |
* A set of flags used to indicate which fields are present in a given
|
|
208 |
* blend dictionary (font info or private). Used to support Multiple
|
|
209 |
* Masters fonts.
|
|
210 |
*
|
|
211 |
* @values:
|
|
212 |
* T1_BLEND_UNDERLINE_POSITION ::
|
|
213 |
* T1_BLEND_UNDERLINE_THICKNESS ::
|
|
214 |
* T1_BLEND_ITALIC_ANGLE ::
|
|
215 |
* T1_BLEND_BLUE_VALUES ::
|
|
216 |
* T1_BLEND_OTHER_BLUES ::
|
|
217 |
* T1_BLEND_STANDARD_WIDTH ::
|
|
218 |
* T1_BLEND_STANDARD_HEIGHT ::
|
|
219 |
* T1_BLEND_STEM_SNAP_WIDTHS ::
|
|
220 |
* T1_BLEND_STEM_SNAP_HEIGHTS ::
|
|
221 |
* T1_BLEND_BLUE_SCALE ::
|
|
222 |
* T1_BLEND_BLUE_SHIFT ::
|
|
223 |
* T1_BLEND_FAMILY_BLUES ::
|
|
224 |
* T1_BLEND_FAMILY_OTHER_BLUES ::
|
|
225 |
* T1_BLEND_FORCE_BOLD ::
|
|
226 |
*/
|
49234
|
227 |
typedef enum T1_Blend_Flags_
|
|
228 |
{
|
|
229 |
/* required fields in a FontInfo blend dictionary */
|
|
230 |
T1_BLEND_UNDERLINE_POSITION = 0,
|
|
231 |
T1_BLEND_UNDERLINE_THICKNESS,
|
|
232 |
T1_BLEND_ITALIC_ANGLE,
|
|
233 |
|
|
234 |
/* required fields in a Private blend dictionary */
|
|
235 |
T1_BLEND_BLUE_VALUES,
|
|
236 |
T1_BLEND_OTHER_BLUES,
|
|
237 |
T1_BLEND_STANDARD_WIDTH,
|
|
238 |
T1_BLEND_STANDARD_HEIGHT,
|
|
239 |
T1_BLEND_STEM_SNAP_WIDTHS,
|
|
240 |
T1_BLEND_STEM_SNAP_HEIGHTS,
|
|
241 |
T1_BLEND_BLUE_SCALE,
|
|
242 |
T1_BLEND_BLUE_SHIFT,
|
|
243 |
T1_BLEND_FAMILY_BLUES,
|
|
244 |
T1_BLEND_FAMILY_OTHER_BLUES,
|
|
245 |
T1_BLEND_FORCE_BOLD,
|
|
246 |
|
|
247 |
T1_BLEND_MAX /* do not remove */
|
|
248 |
|
|
249 |
} T1_Blend_Flags;
|
|
250 |
|
|
251 |
|
|
252 |
/* these constants are deprecated; use the corresponding */
|
54876
|
253 |
/* `T1_Blend_Flags` values instead */
|
49234
|
254 |
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
|
|
255 |
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
|
|
256 |
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
|
|
257 |
#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
|
|
258 |
#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
|
|
259 |
#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
|
|
260 |
#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
|
|
261 |
#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
|
|
262 |
#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
|
|
263 |
#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
|
|
264 |
#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
|
|
265 |
#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
|
|
266 |
#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
|
|
267 |
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
|
|
268 |
#define t1_blend_max T1_BLEND_MAX
|
|
269 |
|
|
270 |
/* */
|
|
271 |
|
|
272 |
|
|
273 |
/* maximum number of Multiple Masters designs, as defined in the spec */
|
|
274 |
#define T1_MAX_MM_DESIGNS 16
|
|
275 |
|
|
276 |
/* maximum number of Multiple Masters axes, as defined in the spec */
|
|
277 |
#define T1_MAX_MM_AXIS 4
|
|
278 |
|
|
279 |
/* maximum number of elements in a design map */
|
|
280 |
#define T1_MAX_MM_MAP_POINTS 20
|
|
281 |
|
|
282 |
|
|
283 |
/* this structure is used to store the BlendDesignMap entry for an axis */
|
|
284 |
typedef struct PS_DesignMap_
|
|
285 |
{
|
|
286 |
FT_Byte num_points;
|
|
287 |
FT_Long* design_points;
|
|
288 |
FT_Fixed* blend_points;
|
|
289 |
|
|
290 |
} PS_DesignMapRec, *PS_DesignMap;
|
|
291 |
|
|
292 |
/* backward compatible definition */
|
|
293 |
typedef PS_DesignMapRec T1_DesignMap;
|
|
294 |
|
|
295 |
|
|
296 |
typedef struct PS_BlendRec_
|
|
297 |
{
|
|
298 |
FT_UInt num_designs;
|
|
299 |
FT_UInt num_axis;
|
|
300 |
|
|
301 |
FT_String* axis_names[T1_MAX_MM_AXIS];
|
|
302 |
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
|
303 |
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
|
|
304 |
|
|
305 |
FT_Fixed* weight_vector;
|
|
306 |
FT_Fixed* default_weight_vector;
|
|
307 |
|
|
308 |
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
|
|
309 |
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
|
|
310 |
|
|
311 |
FT_ULong blend_bitflags;
|
|
312 |
|
|
313 |
FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
|
|
314 |
|
|
315 |
/* since 2.3.0 */
|
|
316 |
|
|
317 |
/* undocumented, optional: the default design instance; */
|
|
318 |
/* corresponds to default_weight_vector -- */
|
|
319 |
/* num_default_design_vector == 0 means it is not present */
|
|
320 |
/* in the font and associated metrics files */
|
|
321 |
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
|
|
322 |
FT_UInt num_default_design_vector;
|
|
323 |
|
|
324 |
} PS_BlendRec, *PS_Blend;
|
|
325 |
|
|
326 |
|
|
327 |
/* backward compatible definition */
|
|
328 |
typedef PS_BlendRec T1_Blend;
|
|
329 |
|
|
330 |
|
54876
|
331 |
/**************************************************************************
|
|
332 |
*
|
|
333 |
* @struct:
|
|
334 |
* CID_FaceDictRec
|
|
335 |
*
|
|
336 |
* @description:
|
|
337 |
* A structure used to represent data in a CID top-level dictionary. In
|
|
338 |
* most cases, they are part of the font's '/FDArray' array. Within a
|
|
339 |
* CID font file, such (internal) subfont dictionaries are enclosed by
|
|
340 |
* '%ADOBeginFontDict' and '%ADOEndFontDict' comments.
|
|
341 |
*
|
|
342 |
* Note that `CID_FaceDictRec` misses a field for the '/FontName'
|
|
343 |
* keyword, specifying the subfont's name (the top-level font name is
|
|
344 |
* given by the '/CIDFontName' keyword). This is an oversight, but it
|
|
345 |
* doesn't limit the 'cid' font module's functionality because FreeType
|
|
346 |
* neither needs this entry nor gives access to CID subfonts.
|
|
347 |
*/
|
49234
|
348 |
typedef struct CID_FaceDictRec_
|
|
349 |
{
|
|
350 |
PS_PrivateRec private_dict;
|
|
351 |
|
|
352 |
FT_UInt len_buildchar;
|
|
353 |
FT_Fixed forcebold_threshold;
|
|
354 |
FT_Pos stroke_width;
|
54876
|
355 |
FT_Fixed expansion_factor; /* this is a duplicate of */
|
|
356 |
/* `private_dict->expansion_factor' */
|
49234
|
357 |
FT_Byte paint_type;
|
|
358 |
FT_Byte font_type;
|
|
359 |
FT_Matrix font_matrix;
|
|
360 |
FT_Vector font_offset;
|
|
361 |
|
|
362 |
FT_UInt num_subrs;
|
|
363 |
FT_ULong subrmap_offset;
|
|
364 |
FT_Int sd_bytes;
|
|
365 |
|
|
366 |
} CID_FaceDictRec;
|
|
367 |
|
|
368 |
|
54876
|
369 |
/**************************************************************************
|
|
370 |
*
|
|
371 |
* @struct:
|
|
372 |
* CID_FaceDict
|
|
373 |
*
|
|
374 |
* @description:
|
|
375 |
* A handle to a @CID_FaceDictRec structure.
|
|
376 |
*/
|
49234
|
377 |
typedef struct CID_FaceDictRec_* CID_FaceDict;
|
|
378 |
|
|
379 |
|
54876
|
380 |
/**************************************************************************
|
|
381 |
*
|
|
382 |
* @struct:
|
|
383 |
* CID_FontDict
|
|
384 |
*
|
|
385 |
* @description:
|
|
386 |
* This type is equivalent to @CID_FaceDictRec. It is deprecated but
|
|
387 |
* kept to maintain source compatibility between various versions of
|
|
388 |
* FreeType.
|
|
389 |
*/
|
49234
|
390 |
typedef CID_FaceDictRec CID_FontDict;
|
|
391 |
|
|
392 |
|
54876
|
393 |
/**************************************************************************
|
|
394 |
*
|
|
395 |
* @struct:
|
|
396 |
* CID_FaceInfoRec
|
|
397 |
*
|
|
398 |
* @description:
|
|
399 |
* A structure used to represent CID Face information.
|
|
400 |
*/
|
49234
|
401 |
typedef struct CID_FaceInfoRec_
|
|
402 |
{
|
|
403 |
FT_String* cid_font_name;
|
|
404 |
FT_Fixed cid_version;
|
|
405 |
FT_Int cid_font_type;
|
|
406 |
|
|
407 |
FT_String* registry;
|
|
408 |
FT_String* ordering;
|
|
409 |
FT_Int supplement;
|
|
410 |
|
|
411 |
PS_FontInfoRec font_info;
|
|
412 |
FT_BBox font_bbox;
|
|
413 |
FT_ULong uid_base;
|
|
414 |
|
|
415 |
FT_Int num_xuid;
|
|
416 |
FT_ULong xuid[16];
|
|
417 |
|
|
418 |
FT_ULong cidmap_offset;
|
|
419 |
FT_Int fd_bytes;
|
|
420 |
FT_Int gd_bytes;
|
|
421 |
FT_ULong cid_count;
|
|
422 |
|
|
423 |
FT_Int num_dicts;
|
|
424 |
CID_FaceDict font_dicts;
|
|
425 |
|
|
426 |
FT_ULong data_offset;
|
|
427 |
|
|
428 |
} CID_FaceInfoRec;
|
|
429 |
|
|
430 |
|
54876
|
431 |
/**************************************************************************
|
|
432 |
*
|
|
433 |
* @struct:
|
|
434 |
* CID_FaceInfo
|
|
435 |
*
|
|
436 |
* @description:
|
|
437 |
* A handle to a @CID_FaceInfoRec structure.
|
|
438 |
*/
|
49234
|
439 |
typedef struct CID_FaceInfoRec_* CID_FaceInfo;
|
|
440 |
|
|
441 |
|
54876
|
442 |
/**************************************************************************
|
|
443 |
*
|
|
444 |
* @struct:
|
|
445 |
* CID_Info
|
|
446 |
*
|
|
447 |
* @description:
|
|
448 |
* This type is equivalent to @CID_FaceInfoRec. It is deprecated but kept
|
|
449 |
* to maintain source compatibility between various versions of FreeType.
|
|
450 |
*/
|
49234
|
451 |
typedef CID_FaceInfoRec CID_Info;
|
|
452 |
|
|
453 |
|
54876
|
454 |
/**************************************************************************
|
49234
|
455 |
*
|
|
456 |
* @function:
|
|
457 |
* FT_Has_PS_Glyph_Names
|
|
458 |
*
|
|
459 |
* @description:
|
54876
|
460 |
* Return true if a given face provides reliable PostScript glyph names.
|
|
461 |
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
|
|
462 |
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
|
49234
|
463 |
*
|
|
464 |
* When this function returns true, the caller is sure that the glyph
|
|
465 |
* names returned by @FT_Get_Glyph_Name are reliable.
|
|
466 |
*
|
|
467 |
* @input:
|
|
468 |
* face ::
|
54876
|
469 |
* face handle
|
49234
|
470 |
*
|
|
471 |
* @return:
|
|
472 |
* Boolean. True if glyph names are reliable.
|
|
473 |
*
|
|
474 |
*/
|
|
475 |
FT_EXPORT( FT_Int )
|
|
476 |
FT_Has_PS_Glyph_Names( FT_Face face );
|
|
477 |
|
|
478 |
|
54876
|
479 |
/**************************************************************************
|
49234
|
480 |
*
|
|
481 |
* @function:
|
|
482 |
* FT_Get_PS_Font_Info
|
|
483 |
*
|
|
484 |
* @description:
|
|
485 |
* Retrieve the @PS_FontInfoRec structure corresponding to a given
|
|
486 |
* PostScript font.
|
|
487 |
*
|
|
488 |
* @input:
|
|
489 |
* face ::
|
54876
|
490 |
* PostScript face handle.
|
49234
|
491 |
*
|
|
492 |
* @output:
|
|
493 |
* afont_info ::
|
54876
|
494 |
* Output font info structure pointer.
|
49234
|
495 |
*
|
|
496 |
* @return:
|
|
497 |
* FreeType error code. 0~means success.
|
|
498 |
*
|
|
499 |
* @note:
|
54876
|
500 |
* String pointers within the @PS_FontInfoRec structure are owned by the
|
|
501 |
* face and don't need to be freed by the caller. Missing entries in
|
|
502 |
* the font's FontInfo dictionary are represented by `NULL` pointers.
|
49234
|
503 |
*
|
|
504 |
* If the font's format is not PostScript-based, this function will
|
54876
|
505 |
* return the `FT_Err_Invalid_Argument` error code.
|
49234
|
506 |
*
|
|
507 |
*/
|
|
508 |
FT_EXPORT( FT_Error )
|
|
509 |
FT_Get_PS_Font_Info( FT_Face face,
|
|
510 |
PS_FontInfo afont_info );
|
|
511 |
|
|
512 |
|
54876
|
513 |
/**************************************************************************
|
49234
|
514 |
*
|
|
515 |
* @function:
|
|
516 |
* FT_Get_PS_Font_Private
|
|
517 |
*
|
|
518 |
* @description:
|
|
519 |
* Retrieve the @PS_PrivateRec structure corresponding to a given
|
|
520 |
* PostScript font.
|
|
521 |
*
|
|
522 |
* @input:
|
|
523 |
* face ::
|
54876
|
524 |
* PostScript face handle.
|
49234
|
525 |
*
|
|
526 |
* @output:
|
|
527 |
* afont_private ::
|
54876
|
528 |
* Output private dictionary structure pointer.
|
49234
|
529 |
*
|
|
530 |
* @return:
|
|
531 |
* FreeType error code. 0~means success.
|
|
532 |
*
|
|
533 |
* @note:
|
|
534 |
* The string pointers within the @PS_PrivateRec structure are owned by
|
|
535 |
* the face and don't need to be freed by the caller.
|
|
536 |
*
|
|
537 |
* If the font's format is not PostScript-based, this function returns
|
54876
|
538 |
* the `FT_Err_Invalid_Argument` error code.
|
49234
|
539 |
*
|
|
540 |
*/
|
|
541 |
FT_EXPORT( FT_Error )
|
|
542 |
FT_Get_PS_Font_Private( FT_Face face,
|
|
543 |
PS_Private afont_private );
|
|
544 |
|
|
545 |
|
54876
|
546 |
/**************************************************************************
|
|
547 |
*
|
|
548 |
* @enum:
|
|
549 |
* T1_EncodingType
|
|
550 |
*
|
|
551 |
* @description:
|
|
552 |
* An enumeration describing the 'Encoding' entry in a Type 1 dictionary.
|
|
553 |
*
|
|
554 |
* @values:
|
|
555 |
* T1_ENCODING_TYPE_NONE ::
|
|
556 |
* T1_ENCODING_TYPE_ARRAY ::
|
|
557 |
* T1_ENCODING_TYPE_STANDARD ::
|
|
558 |
* T1_ENCODING_TYPE_ISOLATIN1 ::
|
|
559 |
* T1_ENCODING_TYPE_EXPERT ::
|
|
560 |
*
|
|
561 |
* @since:
|
|
562 |
* 2.4.8
|
|
563 |
*/
|
49234
|
564 |
typedef enum T1_EncodingType_
|
|
565 |
{
|
|
566 |
T1_ENCODING_TYPE_NONE = 0,
|
|
567 |
T1_ENCODING_TYPE_ARRAY,
|
|
568 |
T1_ENCODING_TYPE_STANDARD,
|
|
569 |
T1_ENCODING_TYPE_ISOLATIN1,
|
|
570 |
T1_ENCODING_TYPE_EXPERT
|
|
571 |
|
|
572 |
} T1_EncodingType;
|
|
573 |
|
|
574 |
|
54876
|
575 |
/**************************************************************************
|
|
576 |
*
|
|
577 |
* @enum:
|
|
578 |
* PS_Dict_Keys
|
|
579 |
*
|
|
580 |
* @description:
|
|
581 |
* An enumeration used in calls to @FT_Get_PS_Font_Value to identify the
|
|
582 |
* Type~1 dictionary entry to retrieve.
|
|
583 |
*
|
|
584 |
* @values:
|
|
585 |
* PS_DICT_FONT_TYPE ::
|
|
586 |
* PS_DICT_FONT_MATRIX ::
|
|
587 |
* PS_DICT_FONT_BBOX ::
|
|
588 |
* PS_DICT_PAINT_TYPE ::
|
|
589 |
* PS_DICT_FONT_NAME ::
|
|
590 |
* PS_DICT_UNIQUE_ID ::
|
|
591 |
* PS_DICT_NUM_CHAR_STRINGS ::
|
|
592 |
* PS_DICT_CHAR_STRING_KEY ::
|
|
593 |
* PS_DICT_CHAR_STRING ::
|
|
594 |
* PS_DICT_ENCODING_TYPE ::
|
|
595 |
* PS_DICT_ENCODING_ENTRY ::
|
|
596 |
* PS_DICT_NUM_SUBRS ::
|
|
597 |
* PS_DICT_SUBR ::
|
|
598 |
* PS_DICT_STD_HW ::
|
|
599 |
* PS_DICT_STD_VW ::
|
|
600 |
* PS_DICT_NUM_BLUE_VALUES ::
|
|
601 |
* PS_DICT_BLUE_VALUE ::
|
|
602 |
* PS_DICT_BLUE_FUZZ ::
|
|
603 |
* PS_DICT_NUM_OTHER_BLUES ::
|
|
604 |
* PS_DICT_OTHER_BLUE ::
|
|
605 |
* PS_DICT_NUM_FAMILY_BLUES ::
|
|
606 |
* PS_DICT_FAMILY_BLUE ::
|
|
607 |
* PS_DICT_NUM_FAMILY_OTHER_BLUES ::
|
|
608 |
* PS_DICT_FAMILY_OTHER_BLUE ::
|
|
609 |
* PS_DICT_BLUE_SCALE ::
|
|
610 |
* PS_DICT_BLUE_SHIFT ::
|
|
611 |
* PS_DICT_NUM_STEM_SNAP_H ::
|
|
612 |
* PS_DICT_STEM_SNAP_H ::
|
|
613 |
* PS_DICT_NUM_STEM_SNAP_V ::
|
|
614 |
* PS_DICT_STEM_SNAP_V ::
|
|
615 |
* PS_DICT_FORCE_BOLD ::
|
|
616 |
* PS_DICT_RND_STEM_UP ::
|
|
617 |
* PS_DICT_MIN_FEATURE ::
|
|
618 |
* PS_DICT_LEN_IV ::
|
|
619 |
* PS_DICT_PASSWORD ::
|
|
620 |
* PS_DICT_LANGUAGE_GROUP ::
|
|
621 |
* PS_DICT_VERSION ::
|
|
622 |
* PS_DICT_NOTICE ::
|
|
623 |
* PS_DICT_FULL_NAME ::
|
|
624 |
* PS_DICT_FAMILY_NAME ::
|
|
625 |
* PS_DICT_WEIGHT ::
|
|
626 |
* PS_DICT_IS_FIXED_PITCH ::
|
|
627 |
* PS_DICT_UNDERLINE_POSITION ::
|
|
628 |
* PS_DICT_UNDERLINE_THICKNESS ::
|
|
629 |
* PS_DICT_FS_TYPE ::
|
|
630 |
* PS_DICT_ITALIC_ANGLE ::
|
|
631 |
*
|
|
632 |
* @since:
|
|
633 |
* 2.4.8
|
|
634 |
*/
|
49234
|
635 |
typedef enum PS_Dict_Keys_
|
|
636 |
{
|
|
637 |
/* conventionally in the font dictionary */
|
|
638 |
PS_DICT_FONT_TYPE, /* FT_Byte */
|
|
639 |
PS_DICT_FONT_MATRIX, /* FT_Fixed */
|
|
640 |
PS_DICT_FONT_BBOX, /* FT_Fixed */
|
|
641 |
PS_DICT_PAINT_TYPE, /* FT_Byte */
|
|
642 |
PS_DICT_FONT_NAME, /* FT_String* */
|
|
643 |
PS_DICT_UNIQUE_ID, /* FT_Int */
|
|
644 |
PS_DICT_NUM_CHAR_STRINGS, /* FT_Int */
|
|
645 |
PS_DICT_CHAR_STRING_KEY, /* FT_String* */
|
|
646 |
PS_DICT_CHAR_STRING, /* FT_String* */
|
|
647 |
PS_DICT_ENCODING_TYPE, /* T1_EncodingType */
|
|
648 |
PS_DICT_ENCODING_ENTRY, /* FT_String* */
|
|
649 |
|
|
650 |
/* conventionally in the font Private dictionary */
|
|
651 |
PS_DICT_NUM_SUBRS, /* FT_Int */
|
|
652 |
PS_DICT_SUBR, /* FT_String* */
|
|
653 |
PS_DICT_STD_HW, /* FT_UShort */
|
|
654 |
PS_DICT_STD_VW, /* FT_UShort */
|
|
655 |
PS_DICT_NUM_BLUE_VALUES, /* FT_Byte */
|
|
656 |
PS_DICT_BLUE_VALUE, /* FT_Short */
|
|
657 |
PS_DICT_BLUE_FUZZ, /* FT_Int */
|
|
658 |
PS_DICT_NUM_OTHER_BLUES, /* FT_Byte */
|
|
659 |
PS_DICT_OTHER_BLUE, /* FT_Short */
|
|
660 |
PS_DICT_NUM_FAMILY_BLUES, /* FT_Byte */
|
|
661 |
PS_DICT_FAMILY_BLUE, /* FT_Short */
|
|
662 |
PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte */
|
|
663 |
PS_DICT_FAMILY_OTHER_BLUE, /* FT_Short */
|
|
664 |
PS_DICT_BLUE_SCALE, /* FT_Fixed */
|
|
665 |
PS_DICT_BLUE_SHIFT, /* FT_Int */
|
|
666 |
PS_DICT_NUM_STEM_SNAP_H, /* FT_Byte */
|
|
667 |
PS_DICT_STEM_SNAP_H, /* FT_Short */
|
|
668 |
PS_DICT_NUM_STEM_SNAP_V, /* FT_Byte */
|
|
669 |
PS_DICT_STEM_SNAP_V, /* FT_Short */
|
|
670 |
PS_DICT_FORCE_BOLD, /* FT_Bool */
|
|
671 |
PS_DICT_RND_STEM_UP, /* FT_Bool */
|
|
672 |
PS_DICT_MIN_FEATURE, /* FT_Short */
|
|
673 |
PS_DICT_LEN_IV, /* FT_Int */
|
|
674 |
PS_DICT_PASSWORD, /* FT_Long */
|
|
675 |
PS_DICT_LANGUAGE_GROUP, /* FT_Long */
|
|
676 |
|
|
677 |
/* conventionally in the font FontInfo dictionary */
|
|
678 |
PS_DICT_VERSION, /* FT_String* */
|
|
679 |
PS_DICT_NOTICE, /* FT_String* */
|
|
680 |
PS_DICT_FULL_NAME, /* FT_String* */
|
|
681 |
PS_DICT_FAMILY_NAME, /* FT_String* */
|
|
682 |
PS_DICT_WEIGHT, /* FT_String* */
|
|
683 |
PS_DICT_IS_FIXED_PITCH, /* FT_Bool */
|
|
684 |
PS_DICT_UNDERLINE_POSITION, /* FT_Short */
|
|
685 |
PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
|
|
686 |
PS_DICT_FS_TYPE, /* FT_UShort */
|
|
687 |
PS_DICT_ITALIC_ANGLE, /* FT_Long */
|
|
688 |
|
|
689 |
PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
|
|
690 |
|
|
691 |
} PS_Dict_Keys;
|
|
692 |
|
|
693 |
|
54876
|
694 |
/**************************************************************************
|
49234
|
695 |
*
|
|
696 |
* @function:
|
|
697 |
* FT_Get_PS_Font_Value
|
|
698 |
*
|
|
699 |
* @description:
|
|
700 |
* Retrieve the value for the supplied key from a PostScript font.
|
|
701 |
*
|
|
702 |
* @input:
|
|
703 |
* face ::
|
54876
|
704 |
* PostScript face handle.
|
49234
|
705 |
*
|
|
706 |
* key ::
|
54876
|
707 |
* An enumeration value representing the dictionary key to retrieve.
|
49234
|
708 |
*
|
|
709 |
* idx ::
|
54876
|
710 |
* For array values, this specifies the index to be returned.
|
49234
|
711 |
*
|
|
712 |
* value ::
|
54876
|
713 |
* A pointer to memory into which to write the value.
|
49234
|
714 |
*
|
|
715 |
* valen_len ::
|
54876
|
716 |
* The size, in bytes, of the memory supplied for the value.
|
49234
|
717 |
*
|
|
718 |
* @output:
|
|
719 |
* value ::
|
54876
|
720 |
* The value matching the above key, if it exists.
|
49234
|
721 |
*
|
|
722 |
* @return:
|
54876
|
723 |
* The amount of memory (in bytes) required to hold the requested value
|
|
724 |
* (if it exists, -1 otherwise).
|
49234
|
725 |
*
|
|
726 |
* @note:
|
|
727 |
* The values returned are not pointers into the internal structures of
|
54876
|
728 |
* the face, but are 'fresh' copies, so that the memory containing them
|
49234
|
729 |
* belongs to the calling application. This also enforces the
|
54876
|
730 |
* 'read-only' nature of these values, i.e., this function cannot be
|
49234
|
731 |
* used to manipulate the face.
|
|
732 |
*
|
54876
|
733 |
* `value` is a void pointer because the values returned can be of
|
49234
|
734 |
* various types.
|
|
735 |
*
|
54876
|
736 |
* If either `value` is `NULL` or `value_len` is too small, just the
|
49234
|
737 |
* required memory size for the requested entry is returned.
|
|
738 |
*
|
54876
|
739 |
* The `idx` parameter is used, not only to retrieve elements of, for
|
49234
|
740 |
* example, the FontMatrix or FontBBox, but also to retrieve name keys
|
|
741 |
* from the CharStrings dictionary, and the charstrings themselves. It
|
|
742 |
* is ignored for atomic values.
|
|
743 |
*
|
54876
|
744 |
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
|
|
745 |
* get the value as in the font stream, you need to divide by 65536000.0
|
|
746 |
* (to remove the FT_Fixed scale, and the x1000 scale).
|
49234
|
747 |
*
|
|
748 |
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
|
54876
|
749 |
* be retrieved. So, for example, PostScript procedures such as NP, ND,
|
|
750 |
* and RD are not available. Arbitrary keys are, obviously, not be
|
49234
|
751 |
* available either.
|
|
752 |
*
|
|
753 |
* If the font's format is not PostScript-based, this function returns
|
54876
|
754 |
* the `FT_Err_Invalid_Argument` error code.
|
49234
|
755 |
*
|
|
756 |
* @since:
|
|
757 |
* 2.4.8
|
|
758 |
*
|
|
759 |
*/
|
|
760 |
FT_EXPORT( FT_Long )
|
|
761 |
FT_Get_PS_Font_Value( FT_Face face,
|
|
762 |
PS_Dict_Keys key,
|
|
763 |
FT_UInt idx,
|
|
764 |
void *value,
|
|
765 |
FT_Long value_len );
|
|
766 |
|
|
767 |
/* */
|
|
768 |
|
|
769 |
FT_END_HEADER
|
|
770 |
|
|
771 |
#endif /* T1TABLES_H_ */
|
|
772 |
|
|
773 |
|
|
774 |
/* END */
|