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