vrshoot

annotate libs/ft2static/freetype/tttables.h @ 1:e7ca128b8713

looks nice :)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 00:35:22 +0200
parents
children
rev   line source
nuclear@0 1 /***************************************************************************/
nuclear@0 2 /* */
nuclear@0 3 /* tttables.h */
nuclear@0 4 /* */
nuclear@0 5 /* Basic SFNT/TrueType tables definitions and interface */
nuclear@0 6 /* (specification only). */
nuclear@0 7 /* */
nuclear@0 8 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 by */
nuclear@0 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
nuclear@0 10 /* */
nuclear@0 11 /* This file is part of the FreeType project, and may only be used, */
nuclear@0 12 /* modified, and distributed under the terms of the FreeType project */
nuclear@0 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
nuclear@0 14 /* this file you indicate that you have read the license and */
nuclear@0 15 /* understand and accept it fully. */
nuclear@0 16 /* */
nuclear@0 17 /***************************************************************************/
nuclear@0 18
nuclear@0 19
nuclear@0 20 #ifndef __TTTABLES_H__
nuclear@0 21 #define __TTTABLES_H__
nuclear@0 22
nuclear@0 23
nuclear@0 24 #include <ft2build.h>
nuclear@0 25 #include FT_FREETYPE_H
nuclear@0 26
nuclear@0 27 #ifdef FREETYPE_H
nuclear@0 28 #error "freetype.h of FreeType 1 has been loaded!"
nuclear@0 29 #error "Please fix the directory search order for header files"
nuclear@0 30 #error "so that freetype.h of FreeType 2 is found first."
nuclear@0 31 #endif
nuclear@0 32
nuclear@0 33
nuclear@0 34 FT_BEGIN_HEADER
nuclear@0 35
nuclear@0 36 /*************************************************************************/
nuclear@0 37 /* */
nuclear@0 38 /* <Section> */
nuclear@0 39 /* truetype_tables */
nuclear@0 40 /* */
nuclear@0 41 /* <Title> */
nuclear@0 42 /* TrueType Tables */
nuclear@0 43 /* */
nuclear@0 44 /* <Abstract> */
nuclear@0 45 /* TrueType specific table types and functions. */
nuclear@0 46 /* */
nuclear@0 47 /* <Description> */
nuclear@0 48 /* This section contains the definition of TrueType-specific tables */
nuclear@0 49 /* as well as some routines used to access and process them. */
nuclear@0 50 /* */
nuclear@0 51 /*************************************************************************/
nuclear@0 52
nuclear@0 53
nuclear@0 54 /*************************************************************************/
nuclear@0 55 /* */
nuclear@0 56 /* <Struct> */
nuclear@0 57 /* TT_Header */
nuclear@0 58 /* */
nuclear@0 59 /* <Description> */
nuclear@0 60 /* A structure used to model a TrueType font header table. All */
nuclear@0 61 /* fields follow the TrueType specification. */
nuclear@0 62 /* */
nuclear@0 63 typedef struct TT_Header_
nuclear@0 64 {
nuclear@0 65 FT_Fixed Table_Version;
nuclear@0 66 FT_Fixed Font_Revision;
nuclear@0 67
nuclear@0 68 FT_Long CheckSum_Adjust;
nuclear@0 69 FT_Long Magic_Number;
nuclear@0 70
nuclear@0 71 FT_UShort Flags;
nuclear@0 72 FT_UShort Units_Per_EM;
nuclear@0 73
nuclear@0 74 FT_Long Created [2];
nuclear@0 75 FT_Long Modified[2];
nuclear@0 76
nuclear@0 77 FT_Short xMin;
nuclear@0 78 FT_Short yMin;
nuclear@0 79 FT_Short xMax;
nuclear@0 80 FT_Short yMax;
nuclear@0 81
nuclear@0 82 FT_UShort Mac_Style;
nuclear@0 83 FT_UShort Lowest_Rec_PPEM;
nuclear@0 84
nuclear@0 85 FT_Short Font_Direction;
nuclear@0 86 FT_Short Index_To_Loc_Format;
nuclear@0 87 FT_Short Glyph_Data_Format;
nuclear@0 88
nuclear@0 89 } TT_Header;
nuclear@0 90
nuclear@0 91
nuclear@0 92 /*************************************************************************/
nuclear@0 93 /* */
nuclear@0 94 /* <Struct> */
nuclear@0 95 /* TT_HoriHeader */
nuclear@0 96 /* */
nuclear@0 97 /* <Description> */
nuclear@0 98 /* A structure used to model a TrueType horizontal header, the `hhea' */
nuclear@0 99 /* table, as well as the corresponding horizontal metrics table, */
nuclear@0 100 /* i.e., the `hmtx' table. */
nuclear@0 101 /* */
nuclear@0 102 /* <Fields> */
nuclear@0 103 /* Version :: The table version. */
nuclear@0 104 /* */
nuclear@0 105 /* Ascender :: The font's ascender, i.e., the distance */
nuclear@0 106 /* from the baseline to the top-most of all */
nuclear@0 107 /* glyph points found in the font. */
nuclear@0 108 /* */
nuclear@0 109 /* This value is invalid in many fonts, as */
nuclear@0 110 /* it is usually set by the font designer, */
nuclear@0 111 /* and often reflects only a portion of the */
nuclear@0 112 /* glyphs found in the font (maybe ASCII). */
nuclear@0 113 /* */
nuclear@0 114 /* You should use the `sTypoAscender' field */
nuclear@0 115 /* of the OS/2 table instead if you want */
nuclear@0 116 /* the correct one. */
nuclear@0 117 /* */
nuclear@0 118 /* Descender :: The font's descender, i.e., the distance */
nuclear@0 119 /* from the baseline to the bottom-most of */
nuclear@0 120 /* all glyph points found in the font. It */
nuclear@0 121 /* is negative. */
nuclear@0 122 /* */
nuclear@0 123 /* This value is invalid in many fonts, as */
nuclear@0 124 /* it is usually set by the font designer, */
nuclear@0 125 /* and often reflects only a portion of the */
nuclear@0 126 /* glyphs found in the font (maybe ASCII). */
nuclear@0 127 /* */
nuclear@0 128 /* You should use the `sTypoDescender' */
nuclear@0 129 /* field of the OS/2 table instead if you */
nuclear@0 130 /* want the correct one. */
nuclear@0 131 /* */
nuclear@0 132 /* Line_Gap :: The font's line gap, i.e., the distance */
nuclear@0 133 /* to add to the ascender and descender to */
nuclear@0 134 /* get the BTB, i.e., the */
nuclear@0 135 /* baseline-to-baseline distance for the */
nuclear@0 136 /* font. */
nuclear@0 137 /* */
nuclear@0 138 /* advance_Width_Max :: This field is the maximum of all advance */
nuclear@0 139 /* widths found in the font. It can be */
nuclear@0 140 /* used to compute the maximum width of an */
nuclear@0 141 /* arbitrary string of text. */
nuclear@0 142 /* */
nuclear@0 143 /* min_Left_Side_Bearing :: The minimum left side bearing of all */
nuclear@0 144 /* glyphs within the font. */
nuclear@0 145 /* */
nuclear@0 146 /* min_Right_Side_Bearing :: The minimum right side bearing of all */
nuclear@0 147 /* glyphs within the font. */
nuclear@0 148 /* */
nuclear@0 149 /* xMax_Extent :: The maximum horizontal extent (i.e., the */
nuclear@0 150 /* `width' of a glyph's bounding box) for */
nuclear@0 151 /* all glyphs in the font. */
nuclear@0 152 /* */
nuclear@0 153 /* caret_Slope_Rise :: The rise coefficient of the cursor's */
nuclear@0 154 /* slope of the cursor (slope=rise/run). */
nuclear@0 155 /* */
nuclear@0 156 /* caret_Slope_Run :: The run coefficient of the cursor's */
nuclear@0 157 /* slope. */
nuclear@0 158 /* */
nuclear@0 159 /* Reserved :: 8~reserved bytes. */
nuclear@0 160 /* */
nuclear@0 161 /* metric_Data_Format :: Always~0. */
nuclear@0 162 /* */
nuclear@0 163 /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */
nuclear@0 164 /* table -- this value can be smaller than */
nuclear@0 165 /* the total number of glyphs in the font. */
nuclear@0 166 /* */
nuclear@0 167 /* long_metrics :: A pointer into the `hmtx' table. */
nuclear@0 168 /* */
nuclear@0 169 /* short_metrics :: A pointer into the `hmtx' table. */
nuclear@0 170 /* */
nuclear@0 171 /* <Note> */
nuclear@0 172 /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
nuclear@0 173 /* be identical except for the names of their fields which */
nuclear@0 174 /* are different. */
nuclear@0 175 /* */
nuclear@0 176 /* This ensures that a single function in the `ttload' */
nuclear@0 177 /* module is able to read both the horizontal and vertical */
nuclear@0 178 /* headers. */
nuclear@0 179 /* */
nuclear@0 180 typedef struct TT_HoriHeader_
nuclear@0 181 {
nuclear@0 182 FT_Fixed Version;
nuclear@0 183 FT_Short Ascender;
nuclear@0 184 FT_Short Descender;
nuclear@0 185 FT_Short Line_Gap;
nuclear@0 186
nuclear@0 187 FT_UShort advance_Width_Max; /* advance width maximum */
nuclear@0 188
nuclear@0 189 FT_Short min_Left_Side_Bearing; /* minimum left-sb */
nuclear@0 190 FT_Short min_Right_Side_Bearing; /* minimum right-sb */
nuclear@0 191 FT_Short xMax_Extent; /* xmax extents */
nuclear@0 192 FT_Short caret_Slope_Rise;
nuclear@0 193 FT_Short caret_Slope_Run;
nuclear@0 194 FT_Short caret_Offset;
nuclear@0 195
nuclear@0 196 FT_Short Reserved[4];
nuclear@0 197
nuclear@0 198 FT_Short metric_Data_Format;
nuclear@0 199 FT_UShort number_Of_HMetrics;
nuclear@0 200
nuclear@0 201 /* The following fields are not defined by the TrueType specification */
nuclear@0 202 /* but they are used to connect the metrics header to the relevant */
nuclear@0 203 /* `HMTX' table. */
nuclear@0 204
nuclear@0 205 void* long_metrics;
nuclear@0 206 void* short_metrics;
nuclear@0 207
nuclear@0 208 } TT_HoriHeader;
nuclear@0 209
nuclear@0 210
nuclear@0 211 /*************************************************************************/
nuclear@0 212 /* */
nuclear@0 213 /* <Struct> */
nuclear@0 214 /* TT_VertHeader */
nuclear@0 215 /* */
nuclear@0 216 /* <Description> */
nuclear@0 217 /* A structure used to model a TrueType vertical header, the `vhea' */
nuclear@0 218 /* table, as well as the corresponding vertical metrics table, i.e., */
nuclear@0 219 /* the `vmtx' table. */
nuclear@0 220 /* */
nuclear@0 221 /* <Fields> */
nuclear@0 222 /* Version :: The table version. */
nuclear@0 223 /* */
nuclear@0 224 /* Ascender :: The font's ascender, i.e., the distance */
nuclear@0 225 /* from the baseline to the top-most of */
nuclear@0 226 /* all glyph points found in the font. */
nuclear@0 227 /* */
nuclear@0 228 /* This value is invalid in many fonts, as */
nuclear@0 229 /* it is usually set by the font designer, */
nuclear@0 230 /* and often reflects only a portion of */
nuclear@0 231 /* the glyphs found in the font (maybe */
nuclear@0 232 /* ASCII). */
nuclear@0 233 /* */
nuclear@0 234 /* You should use the `sTypoAscender' */
nuclear@0 235 /* field of the OS/2 table instead if you */
nuclear@0 236 /* want the correct one. */
nuclear@0 237 /* */
nuclear@0 238 /* Descender :: The font's descender, i.e., the */
nuclear@0 239 /* distance from the baseline to the */
nuclear@0 240 /* bottom-most of all glyph points found */
nuclear@0 241 /* in the font. It is negative. */
nuclear@0 242 /* */
nuclear@0 243 /* This value is invalid in many fonts, as */
nuclear@0 244 /* it is usually set by the font designer, */
nuclear@0 245 /* and often reflects only a portion of */
nuclear@0 246 /* the glyphs found in the font (maybe */
nuclear@0 247 /* ASCII). */
nuclear@0 248 /* */
nuclear@0 249 /* You should use the `sTypoDescender' */
nuclear@0 250 /* field of the OS/2 table instead if you */
nuclear@0 251 /* want the correct one. */
nuclear@0 252 /* */
nuclear@0 253 /* Line_Gap :: The font's line gap, i.e., the distance */
nuclear@0 254 /* to add to the ascender and descender to */
nuclear@0 255 /* get the BTB, i.e., the */
nuclear@0 256 /* baseline-to-baseline distance for the */
nuclear@0 257 /* font. */
nuclear@0 258 /* */
nuclear@0 259 /* advance_Height_Max :: This field is the maximum of all */
nuclear@0 260 /* advance heights found in the font. It */
nuclear@0 261 /* can be used to compute the maximum */
nuclear@0 262 /* height of an arbitrary string of text. */
nuclear@0 263 /* */
nuclear@0 264 /* min_Top_Side_Bearing :: The minimum top side bearing of all */
nuclear@0 265 /* glyphs within the font. */
nuclear@0 266 /* */
nuclear@0 267 /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */
nuclear@0 268 /* glyphs within the font. */
nuclear@0 269 /* */
nuclear@0 270 /* yMax_Extent :: The maximum vertical extent (i.e., the */
nuclear@0 271 /* `height' of a glyph's bounding box) for */
nuclear@0 272 /* all glyphs in the font. */
nuclear@0 273 /* */
nuclear@0 274 /* caret_Slope_Rise :: The rise coefficient of the cursor's */
nuclear@0 275 /* slope of the cursor (slope=rise/run). */
nuclear@0 276 /* */
nuclear@0 277 /* caret_Slope_Run :: The run coefficient of the cursor's */
nuclear@0 278 /* slope. */
nuclear@0 279 /* */
nuclear@0 280 /* caret_Offset :: The cursor's offset for slanted fonts. */
nuclear@0 281 /* This value is `reserved' in vmtx */
nuclear@0 282 /* version 1.0. */
nuclear@0 283 /* */
nuclear@0 284 /* Reserved :: 8~reserved bytes. */
nuclear@0 285 /* */
nuclear@0 286 /* metric_Data_Format :: Always~0. */
nuclear@0 287 /* */
nuclear@0 288 /* number_Of_HMetrics :: Number of VMetrics entries in the */
nuclear@0 289 /* `vmtx' table -- this value can be */
nuclear@0 290 /* smaller than the total number of glyphs */
nuclear@0 291 /* in the font. */
nuclear@0 292 /* */
nuclear@0 293 /* long_metrics :: A pointer into the `vmtx' table. */
nuclear@0 294 /* */
nuclear@0 295 /* short_metrics :: A pointer into the `vmtx' table. */
nuclear@0 296 /* */
nuclear@0 297 /* <Note> */
nuclear@0 298 /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */
nuclear@0 299 /* be identical except for the names of their fields which */
nuclear@0 300 /* are different. */
nuclear@0 301 /* */
nuclear@0 302 /* This ensures that a single function in the `ttload' */
nuclear@0 303 /* module is able to read both the horizontal and vertical */
nuclear@0 304 /* headers. */
nuclear@0 305 /* */
nuclear@0 306 typedef struct TT_VertHeader_
nuclear@0 307 {
nuclear@0 308 FT_Fixed Version;
nuclear@0 309 FT_Short Ascender;
nuclear@0 310 FT_Short Descender;
nuclear@0 311 FT_Short Line_Gap;
nuclear@0 312
nuclear@0 313 FT_UShort advance_Height_Max; /* advance height maximum */
nuclear@0 314
nuclear@0 315 FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */
nuclear@0 316 FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */
nuclear@0 317 FT_Short yMax_Extent; /* xmax or ymax extents */
nuclear@0 318 FT_Short caret_Slope_Rise;
nuclear@0 319 FT_Short caret_Slope_Run;
nuclear@0 320 FT_Short caret_Offset;
nuclear@0 321
nuclear@0 322 FT_Short Reserved[4];
nuclear@0 323
nuclear@0 324 FT_Short metric_Data_Format;
nuclear@0 325 FT_UShort number_Of_VMetrics;
nuclear@0 326
nuclear@0 327 /* The following fields are not defined by the TrueType specification */
nuclear@0 328 /* but they're used to connect the metrics header to the relevant */
nuclear@0 329 /* `HMTX' or `VMTX' table. */
nuclear@0 330
nuclear@0 331 void* long_metrics;
nuclear@0 332 void* short_metrics;
nuclear@0 333
nuclear@0 334 } TT_VertHeader;
nuclear@0 335
nuclear@0 336
nuclear@0 337 /*************************************************************************/
nuclear@0 338 /* */
nuclear@0 339 /* <Struct> */
nuclear@0 340 /* TT_OS2 */
nuclear@0 341 /* */
nuclear@0 342 /* <Description> */
nuclear@0 343 /* A structure used to model a TrueType OS/2 table. This is the long */
nuclear@0 344 /* table version. All fields comply to the TrueType specification. */
nuclear@0 345 /* */
nuclear@0 346 /* Note that we now support old Mac fonts which do not include an */
nuclear@0 347 /* OS/2 table. In this case, the `version' field is always set to */
nuclear@0 348 /* 0xFFFF. */
nuclear@0 349 /* */
nuclear@0 350 typedef struct TT_OS2_
nuclear@0 351 {
nuclear@0 352 FT_UShort version; /* 0x0001 - more or 0xFFFF */
nuclear@0 353 FT_Short xAvgCharWidth;
nuclear@0 354 FT_UShort usWeightClass;
nuclear@0 355 FT_UShort usWidthClass;
nuclear@0 356 FT_Short fsType;
nuclear@0 357 FT_Short ySubscriptXSize;
nuclear@0 358 FT_Short ySubscriptYSize;
nuclear@0 359 FT_Short ySubscriptXOffset;
nuclear@0 360 FT_Short ySubscriptYOffset;
nuclear@0 361 FT_Short ySuperscriptXSize;
nuclear@0 362 FT_Short ySuperscriptYSize;
nuclear@0 363 FT_Short ySuperscriptXOffset;
nuclear@0 364 FT_Short ySuperscriptYOffset;
nuclear@0 365 FT_Short yStrikeoutSize;
nuclear@0 366 FT_Short yStrikeoutPosition;
nuclear@0 367 FT_Short sFamilyClass;
nuclear@0 368
nuclear@0 369 FT_Byte panose[10];
nuclear@0 370
nuclear@0 371 FT_ULong ulUnicodeRange1; /* Bits 0-31 */
nuclear@0 372 FT_ULong ulUnicodeRange2; /* Bits 32-63 */
nuclear@0 373 FT_ULong ulUnicodeRange3; /* Bits 64-95 */
nuclear@0 374 FT_ULong ulUnicodeRange4; /* Bits 96-127 */
nuclear@0 375
nuclear@0 376 FT_Char achVendID[4];
nuclear@0 377
nuclear@0 378 FT_UShort fsSelection;
nuclear@0 379 FT_UShort usFirstCharIndex;
nuclear@0 380 FT_UShort usLastCharIndex;
nuclear@0 381 FT_Short sTypoAscender;
nuclear@0 382 FT_Short sTypoDescender;
nuclear@0 383 FT_Short sTypoLineGap;
nuclear@0 384 FT_UShort usWinAscent;
nuclear@0 385 FT_UShort usWinDescent;
nuclear@0 386
nuclear@0 387 /* only version 1 tables: */
nuclear@0 388
nuclear@0 389 FT_ULong ulCodePageRange1; /* Bits 0-31 */
nuclear@0 390 FT_ULong ulCodePageRange2; /* Bits 32-63 */
nuclear@0 391
nuclear@0 392 /* only version 2 tables: */
nuclear@0 393
nuclear@0 394 FT_Short sxHeight;
nuclear@0 395 FT_Short sCapHeight;
nuclear@0 396 FT_UShort usDefaultChar;
nuclear@0 397 FT_UShort usBreakChar;
nuclear@0 398 FT_UShort usMaxContext;
nuclear@0 399
nuclear@0 400 } TT_OS2;
nuclear@0 401
nuclear@0 402
nuclear@0 403 /*************************************************************************/
nuclear@0 404 /* */
nuclear@0 405 /* <Struct> */
nuclear@0 406 /* TT_Postscript */
nuclear@0 407 /* */
nuclear@0 408 /* <Description> */
nuclear@0 409 /* A structure used to model a TrueType PostScript table. All fields */
nuclear@0 410 /* comply to the TrueType specification. This structure does not */
nuclear@0 411 /* reference the PostScript glyph names, which can be nevertheless */
nuclear@0 412 /* accessed with the `ttpost' module. */
nuclear@0 413 /* */
nuclear@0 414 typedef struct TT_Postscript_
nuclear@0 415 {
nuclear@0 416 FT_Fixed FormatType;
nuclear@0 417 FT_Fixed italicAngle;
nuclear@0 418 FT_Short underlinePosition;
nuclear@0 419 FT_Short underlineThickness;
nuclear@0 420 FT_ULong isFixedPitch;
nuclear@0 421 FT_ULong minMemType42;
nuclear@0 422 FT_ULong maxMemType42;
nuclear@0 423 FT_ULong minMemType1;
nuclear@0 424 FT_ULong maxMemType1;
nuclear@0 425
nuclear@0 426 /* Glyph names follow in the file, but we don't */
nuclear@0 427 /* load them by default. See the ttpost.c file. */
nuclear@0 428
nuclear@0 429 } TT_Postscript;
nuclear@0 430
nuclear@0 431
nuclear@0 432 /*************************************************************************/
nuclear@0 433 /* */
nuclear@0 434 /* <Struct> */
nuclear@0 435 /* TT_PCLT */
nuclear@0 436 /* */
nuclear@0 437 /* <Description> */
nuclear@0 438 /* A structure used to model a TrueType PCLT table. All fields */
nuclear@0 439 /* comply to the TrueType specification. */
nuclear@0 440 /* */
nuclear@0 441 typedef struct TT_PCLT_
nuclear@0 442 {
nuclear@0 443 FT_Fixed Version;
nuclear@0 444 FT_ULong FontNumber;
nuclear@0 445 FT_UShort Pitch;
nuclear@0 446 FT_UShort xHeight;
nuclear@0 447 FT_UShort Style;
nuclear@0 448 FT_UShort TypeFamily;
nuclear@0 449 FT_UShort CapHeight;
nuclear@0 450 FT_UShort SymbolSet;
nuclear@0 451 FT_Char TypeFace[16];
nuclear@0 452 FT_Char CharacterComplement[8];
nuclear@0 453 FT_Char FileName[6];
nuclear@0 454 FT_Char StrokeWeight;
nuclear@0 455 FT_Char WidthType;
nuclear@0 456 FT_Byte SerifStyle;
nuclear@0 457 FT_Byte Reserved;
nuclear@0 458
nuclear@0 459 } TT_PCLT;
nuclear@0 460
nuclear@0 461
nuclear@0 462 /*************************************************************************/
nuclear@0 463 /* */
nuclear@0 464 /* <Struct> */
nuclear@0 465 /* TT_MaxProfile */
nuclear@0 466 /* */
nuclear@0 467 /* <Description> */
nuclear@0 468 /* The maximum profile is a table containing many max values which */
nuclear@0 469 /* can be used to pre-allocate arrays. This ensures that no memory */
nuclear@0 470 /* allocation occurs during a glyph load. */
nuclear@0 471 /* */
nuclear@0 472 /* <Fields> */
nuclear@0 473 /* version :: The version number. */
nuclear@0 474 /* */
nuclear@0 475 /* numGlyphs :: The number of glyphs in this TrueType */
nuclear@0 476 /* font. */
nuclear@0 477 /* */
nuclear@0 478 /* maxPoints :: The maximum number of points in a */
nuclear@0 479 /* non-composite TrueType glyph. See also */
nuclear@0 480 /* the structure element */
nuclear@0 481 /* `maxCompositePoints'. */
nuclear@0 482 /* */
nuclear@0 483 /* maxContours :: The maximum number of contours in a */
nuclear@0 484 /* non-composite TrueType glyph. See also */
nuclear@0 485 /* the structure element */
nuclear@0 486 /* `maxCompositeContours'. */
nuclear@0 487 /* */
nuclear@0 488 /* maxCompositePoints :: The maximum number of points in a */
nuclear@0 489 /* composite TrueType glyph. See also the */
nuclear@0 490 /* structure element `maxPoints'. */
nuclear@0 491 /* */
nuclear@0 492 /* maxCompositeContours :: The maximum number of contours in a */
nuclear@0 493 /* composite TrueType glyph. See also the */
nuclear@0 494 /* structure element `maxContours'. */
nuclear@0 495 /* */
nuclear@0 496 /* maxZones :: The maximum number of zones used for */
nuclear@0 497 /* glyph hinting. */
nuclear@0 498 /* */
nuclear@0 499 /* maxTwilightPoints :: The maximum number of points in the */
nuclear@0 500 /* twilight zone used for glyph hinting. */
nuclear@0 501 /* */
nuclear@0 502 /* maxStorage :: The maximum number of elements in the */
nuclear@0 503 /* storage area used for glyph hinting. */
nuclear@0 504 /* */
nuclear@0 505 /* maxFunctionDefs :: The maximum number of function */
nuclear@0 506 /* definitions in the TrueType bytecode for */
nuclear@0 507 /* this font. */
nuclear@0 508 /* */
nuclear@0 509 /* maxInstructionDefs :: The maximum number of instruction */
nuclear@0 510 /* definitions in the TrueType bytecode for */
nuclear@0 511 /* this font. */
nuclear@0 512 /* */
nuclear@0 513 /* maxStackElements :: The maximum number of stack elements used */
nuclear@0 514 /* during bytecode interpretation. */
nuclear@0 515 /* */
nuclear@0 516 /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */
nuclear@0 517 /* used for glyph hinting. */
nuclear@0 518 /* */
nuclear@0 519 /* maxComponentElements :: The maximum number of simple (i.e., non- */
nuclear@0 520 /* composite) glyphs in a composite glyph. */
nuclear@0 521 /* */
nuclear@0 522 /* maxComponentDepth :: The maximum nesting depth of composite */
nuclear@0 523 /* glyphs. */
nuclear@0 524 /* */
nuclear@0 525 /* <Note> */
nuclear@0 526 /* This structure is only used during font loading. */
nuclear@0 527 /* */
nuclear@0 528 typedef struct TT_MaxProfile_
nuclear@0 529 {
nuclear@0 530 FT_Fixed version;
nuclear@0 531 FT_UShort numGlyphs;
nuclear@0 532 FT_UShort maxPoints;
nuclear@0 533 FT_UShort maxContours;
nuclear@0 534 FT_UShort maxCompositePoints;
nuclear@0 535 FT_UShort maxCompositeContours;
nuclear@0 536 FT_UShort maxZones;
nuclear@0 537 FT_UShort maxTwilightPoints;
nuclear@0 538 FT_UShort maxStorage;
nuclear@0 539 FT_UShort maxFunctionDefs;
nuclear@0 540 FT_UShort maxInstructionDefs;
nuclear@0 541 FT_UShort maxStackElements;
nuclear@0 542 FT_UShort maxSizeOfInstructions;
nuclear@0 543 FT_UShort maxComponentElements;
nuclear@0 544 FT_UShort maxComponentDepth;
nuclear@0 545
nuclear@0 546 } TT_MaxProfile;
nuclear@0 547
nuclear@0 548
nuclear@0 549 /*************************************************************************/
nuclear@0 550 /* */
nuclear@0 551 /* <Enum> */
nuclear@0 552 /* FT_Sfnt_Tag */
nuclear@0 553 /* */
nuclear@0 554 /* <Description> */
nuclear@0 555 /* An enumeration used to specify the index of an SFNT table. */
nuclear@0 556 /* Used in the @FT_Get_Sfnt_Table API function. */
nuclear@0 557 /* */
nuclear@0 558 typedef enum FT_Sfnt_Tag_
nuclear@0 559 {
nuclear@0 560 ft_sfnt_head = 0, /* TT_Header */
nuclear@0 561 ft_sfnt_maxp = 1, /* TT_MaxProfile */
nuclear@0 562 ft_sfnt_os2 = 2, /* TT_OS2 */
nuclear@0 563 ft_sfnt_hhea = 3, /* TT_HoriHeader */
nuclear@0 564 ft_sfnt_vhea = 4, /* TT_VertHeader */
nuclear@0 565 ft_sfnt_post = 5, /* TT_Postscript */
nuclear@0 566 ft_sfnt_pclt = 6, /* TT_PCLT */
nuclear@0 567
nuclear@0 568 sfnt_max /* internal end mark */
nuclear@0 569
nuclear@0 570 } FT_Sfnt_Tag;
nuclear@0 571
nuclear@0 572 /* */
nuclear@0 573
nuclear@0 574
nuclear@0 575 /*************************************************************************/
nuclear@0 576 /* */
nuclear@0 577 /* <Function> */
nuclear@0 578 /* FT_Get_Sfnt_Table */
nuclear@0 579 /* */
nuclear@0 580 /* <Description> */
nuclear@0 581 /* Return a pointer to a given SFNT table within a face. */
nuclear@0 582 /* */
nuclear@0 583 /* <Input> */
nuclear@0 584 /* face :: A handle to the source. */
nuclear@0 585 /* */
nuclear@0 586 /* tag :: The index of the SFNT table. */
nuclear@0 587 /* */
nuclear@0 588 /* <Return> */
nuclear@0 589 /* A type-less pointer to the table. This will be~0 in case of */
nuclear@0 590 /* error, or if the corresponding table was not found *OR* loaded */
nuclear@0 591 /* from the file. */
nuclear@0 592 /* */
nuclear@0 593 /* Use a typecast according to `tag' to access the structure */
nuclear@0 594 /* elements. */
nuclear@0 595 /* */
nuclear@0 596 /* <Note> */
nuclear@0 597 /* The table is owned by the face object and disappears with it. */
nuclear@0 598 /* */
nuclear@0 599 /* This function is only useful to access SFNT tables that are loaded */
nuclear@0 600 /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */
nuclear@0 601 /* a list. */
nuclear@0 602 /* */
nuclear@0 603 FT_EXPORT( void* )
nuclear@0 604 FT_Get_Sfnt_Table( FT_Face face,
nuclear@0 605 FT_Sfnt_Tag tag );
nuclear@0 606
nuclear@0 607
nuclear@0 608 /**************************************************************************
nuclear@0 609 *
nuclear@0 610 * @function:
nuclear@0 611 * FT_Load_Sfnt_Table
nuclear@0 612 *
nuclear@0 613 * @description:
nuclear@0 614 * Load any font table into client memory.
nuclear@0 615 *
nuclear@0 616 * @input:
nuclear@0 617 * face ::
nuclear@0 618 * A handle to the source face.
nuclear@0 619 *
nuclear@0 620 * tag ::
nuclear@0 621 * The four-byte tag of the table to load. Use the value~0 if you want
nuclear@0 622 * to access the whole font file. Otherwise, you can use one of the
nuclear@0 623 * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
nuclear@0 624 * one with @FT_MAKE_TAG.
nuclear@0 625 *
nuclear@0 626 * offset ::
nuclear@0 627 * The starting offset in the table (or file if tag == 0).
nuclear@0 628 *
nuclear@0 629 * @output:
nuclear@0 630 * buffer ::
nuclear@0 631 * The target buffer address. The client must ensure that the memory
nuclear@0 632 * array is big enough to hold the data.
nuclear@0 633 *
nuclear@0 634 * @inout:
nuclear@0 635 * length ::
nuclear@0 636 * If the `length' parameter is NULL, then try to load the whole table.
nuclear@0 637 * Return an error code if it fails.
nuclear@0 638 *
nuclear@0 639 * Else, if `*length' is~0, exit immediately while returning the
nuclear@0 640 * table's (or file) full size in it.
nuclear@0 641 *
nuclear@0 642 * Else the number of bytes to read from the table or file, from the
nuclear@0 643 * starting offset.
nuclear@0 644 *
nuclear@0 645 * @return:
nuclear@0 646 * FreeType error code. 0~means success.
nuclear@0 647 *
nuclear@0 648 * @note:
nuclear@0 649 * If you need to determine the table's length you should first call this
nuclear@0 650 * function with `*length' set to~0, as in the following example:
nuclear@0 651 *
nuclear@0 652 * {
nuclear@0 653 * FT_ULong length = 0;
nuclear@0 654 *
nuclear@0 655 *
nuclear@0 656 * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );
nuclear@0 657 * if ( error ) { ... table does not exist ... }
nuclear@0 658 *
nuclear@0 659 * buffer = malloc( length );
nuclear@0 660 * if ( buffer == NULL ) { ... not enough memory ... }
nuclear@0 661 *
nuclear@0 662 * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );
nuclear@0 663 * if ( error ) { ... could not load table ... }
nuclear@0 664 * }
nuclear@0 665 */
nuclear@0 666 FT_EXPORT( FT_Error )
nuclear@0 667 FT_Load_Sfnt_Table( FT_Face face,
nuclear@0 668 FT_ULong tag,
nuclear@0 669 FT_Long offset,
nuclear@0 670 FT_Byte* buffer,
nuclear@0 671 FT_ULong* length );
nuclear@0 672
nuclear@0 673
nuclear@0 674 /**************************************************************************
nuclear@0 675 *
nuclear@0 676 * @function:
nuclear@0 677 * FT_Sfnt_Table_Info
nuclear@0 678 *
nuclear@0 679 * @description:
nuclear@0 680 * Return information on an SFNT table.
nuclear@0 681 *
nuclear@0 682 * @input:
nuclear@0 683 * face ::
nuclear@0 684 * A handle to the source face.
nuclear@0 685 *
nuclear@0 686 * table_index ::
nuclear@0 687 * The index of an SFNT table. The function returns
nuclear@0 688 * FT_Err_Table_Missing for an invalid value.
nuclear@0 689 *
nuclear@0 690 * @output:
nuclear@0 691 * tag ::
nuclear@0 692 * The name tag of the SFNT table.
nuclear@0 693 *
nuclear@0 694 * length ::
nuclear@0 695 * The length of the SFNT table.
nuclear@0 696 *
nuclear@0 697 * @return:
nuclear@0 698 * FreeType error code. 0~means success.
nuclear@0 699 *
nuclear@0 700 * @note:
nuclear@0 701 * SFNT tables with length zero are treated as missing.
nuclear@0 702 *
nuclear@0 703 */
nuclear@0 704 FT_EXPORT( FT_Error )
nuclear@0 705 FT_Sfnt_Table_Info( FT_Face face,
nuclear@0 706 FT_UInt table_index,
nuclear@0 707 FT_ULong *tag,
nuclear@0 708 FT_ULong *length );
nuclear@0 709
nuclear@0 710
nuclear@0 711 /*************************************************************************/
nuclear@0 712 /* */
nuclear@0 713 /* <Function> */
nuclear@0 714 /* FT_Get_CMap_Language_ID */
nuclear@0 715 /* */
nuclear@0 716 /* <Description> */
nuclear@0 717 /* Return TrueType/sfnt specific cmap language ID. Definitions of */
nuclear@0 718 /* language ID values are in `freetype/ttnameid.h'. */
nuclear@0 719 /* */
nuclear@0 720 /* <Input> */
nuclear@0 721 /* charmap :: */
nuclear@0 722 /* The target charmap. */
nuclear@0 723 /* */
nuclear@0 724 /* <Return> */
nuclear@0 725 /* The language ID of `charmap'. If `charmap' doesn't belong to a */
nuclear@0 726 /* TrueType/sfnt face, just return~0 as the default value. */
nuclear@0 727 /* */
nuclear@0 728 FT_EXPORT( FT_ULong )
nuclear@0 729 FT_Get_CMap_Language_ID( FT_CharMap charmap );
nuclear@0 730
nuclear@0 731
nuclear@0 732 /*************************************************************************/
nuclear@0 733 /* */
nuclear@0 734 /* <Function> */
nuclear@0 735 /* FT_Get_CMap_Format */
nuclear@0 736 /* */
nuclear@0 737 /* <Description> */
nuclear@0 738 /* Return TrueType/sfnt specific cmap format. */
nuclear@0 739 /* */
nuclear@0 740 /* <Input> */
nuclear@0 741 /* charmap :: */
nuclear@0 742 /* The target charmap. */
nuclear@0 743 /* */
nuclear@0 744 /* <Return> */
nuclear@0 745 /* The format of `charmap'. If `charmap' doesn't belong to a */
nuclear@0 746 /* TrueType/sfnt face, return -1. */
nuclear@0 747 /* */
nuclear@0 748 FT_EXPORT( FT_Long )
nuclear@0 749 FT_Get_CMap_Format( FT_CharMap charmap );
nuclear@0 750
nuclear@0 751 /* */
nuclear@0 752
nuclear@0 753
nuclear@0 754 FT_END_HEADER
nuclear@0 755
nuclear@0 756 #endif /* __TTTABLES_H__ */
nuclear@0 757
nuclear@0 758
nuclear@0 759 /* END */