Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentttypes.h
Go to the documentation of this file.
00001 /***************************************************************************/ 00002 /* */ 00003 /* tttypes.h */ 00004 /* */ 00005 /* Basic SFNT/TrueType type definitions and interface (specification */ 00006 /* only). */ 00007 /* */ 00008 /* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by */ 00009 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 00010 /* */ 00011 /* This file is part of the FreeType project, and may only be used, */ 00012 /* modified, and distributed under the terms of the FreeType project */ 00013 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 00014 /* this file you indicate that you have read the license and */ 00015 /* understand and accept it fully. */ 00016 /* */ 00017 /***************************************************************************/ 00018 00019 00020 #ifndef __TTTYPES_H__ 00021 #define __TTTYPES_H__ 00022 00023 00024 #include <ft2build.h> 00025 #include FT_TRUETYPE_TABLES_H 00026 #include FT_INTERNAL_OBJECTS_H 00027 00028 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 00029 #include FT_MULTIPLE_MASTERS_H 00030 #endif 00031 00032 00033 FT_BEGIN_HEADER 00034 00035 00036 /*************************************************************************/ 00037 /*************************************************************************/ 00038 /*************************************************************************/ 00039 /*** ***/ 00040 /*** ***/ 00041 /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ 00042 /*** ***/ 00043 /*** ***/ 00044 /*************************************************************************/ 00045 /*************************************************************************/ 00046 /*************************************************************************/ 00047 00048 00049 /*************************************************************************/ 00050 /* */ 00051 /* <Struct> */ 00052 /* TTC_HeaderRec */ 00053 /* */ 00054 /* <Description> */ 00055 /* TrueType collection header. This table contains the offsets of */ 00056 /* the font headers of each distinct TrueType face in the file. */ 00057 /* */ 00058 /* <Fields> */ 00059 /* tag :: Must be `ttc ' to indicate a TrueType collection. */ 00060 /* */ 00061 /* version :: The version number. */ 00062 /* */ 00063 /* count :: The number of faces in the collection. The */ 00064 /* specification says this should be an unsigned long, but */ 00065 /* we use a signed long since we need the value -1 for */ 00066 /* specific purposes. */ 00067 /* */ 00068 /* offsets :: The offsets of the font headers, one per face. */ 00069 /* */ 00070 typedef struct TTC_HeaderRec_ 00071 { 00072 FT_ULong tag; 00073 FT_Fixed version; 00074 FT_Long count; 00075 FT_ULong* offsets; 00076 00077 } TTC_HeaderRec; 00078 00079 00080 /*************************************************************************/ 00081 /* */ 00082 /* <Struct> */ 00083 /* SFNT_HeaderRec */ 00084 /* */ 00085 /* <Description> */ 00086 /* SFNT file format header. */ 00087 /* */ 00088 /* <Fields> */ 00089 /* format_tag :: The font format tag. */ 00090 /* */ 00091 /* num_tables :: The number of tables in file. */ 00092 /* */ 00093 /* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */ 00094 /* */ 00095 /* entry_selector :: Must be log2 of `search_range / 16'. */ 00096 /* */ 00097 /* range_shift :: Must be `num_tables * 16 - search_range'. */ 00098 /* */ 00099 typedef struct SFNT_HeaderRec_ 00100 { 00101 FT_ULong format_tag; 00102 FT_UShort num_tables; 00103 FT_UShort search_range; 00104 FT_UShort entry_selector; 00105 FT_UShort range_shift; 00106 00107 FT_ULong offset; /* not in file */ 00108 00109 } SFNT_HeaderRec, *SFNT_Header; 00110 00111 00112 /*************************************************************************/ 00113 /* */ 00114 /* <Struct> */ 00115 /* TT_TableRec */ 00116 /* */ 00117 /* <Description> */ 00118 /* This structure describes a given table of a TrueType font. */ 00119 /* */ 00120 /* <Fields> */ 00121 /* Tag :: A four-bytes tag describing the table. */ 00122 /* */ 00123 /* CheckSum :: The table checksum. This value can be ignored. */ 00124 /* */ 00125 /* Offset :: The offset of the table from the start of the TrueType */ 00126 /* font in its resource. */ 00127 /* */ 00128 /* Length :: The table length (in bytes). */ 00129 /* */ 00130 typedef struct TT_TableRec_ 00131 { 00132 FT_ULong Tag; /* table type */ 00133 FT_ULong CheckSum; /* table checksum */ 00134 FT_ULong Offset; /* table file offset */ 00135 FT_ULong Length; /* table length */ 00136 00137 } TT_TableRec, *TT_Table; 00138 00139 00140 /*************************************************************************/ 00141 /* */ 00142 /* <Struct> */ 00143 /* TT_LongMetricsRec */ 00144 /* */ 00145 /* <Description> */ 00146 /* A structure modeling the long metrics of the `hmtx' and `vmtx' */ 00147 /* TrueType tables. The values are expressed in font units. */ 00148 /* */ 00149 /* <Fields> */ 00150 /* advance :: The advance width or height for the glyph. */ 00151 /* */ 00152 /* bearing :: The left-side or top-side bearing for the glyph. */ 00153 /* */ 00154 typedef struct TT_LongMetricsRec_ 00155 { 00156 FT_UShort advance; 00157 FT_Short bearing; 00158 00159 } TT_LongMetricsRec, *TT_LongMetrics; 00160 00161 00162 /*************************************************************************/ 00163 /* */ 00164 /* <Type> */ 00165 /* TT_ShortMetrics */ 00166 /* */ 00167 /* <Description> */ 00168 /* A simple type to model the short metrics of the `hmtx' and `vmtx' */ 00169 /* tables. */ 00170 /* */ 00171 typedef FT_Short TT_ShortMetrics; 00172 00173 00174 /*************************************************************************/ 00175 /* */ 00176 /* <Struct> */ 00177 /* TT_NameEntryRec */ 00178 /* */ 00179 /* <Description> */ 00180 /* A structure modeling TrueType name records. Name records are used */ 00181 /* to store important strings like family name, style name, */ 00182 /* copyright, etc. in _localized_ versions (i.e., language, encoding, */ 00183 /* etc). */ 00184 /* */ 00185 /* <Fields> */ 00186 /* platformID :: The ID of the name's encoding platform. */ 00187 /* */ 00188 /* encodingID :: The platform-specific ID for the name's encoding. */ 00189 /* */ 00190 /* languageID :: The platform-specific ID for the name's language. */ 00191 /* */ 00192 /* nameID :: The ID specifying what kind of name this is. */ 00193 /* */ 00194 /* stringLength :: The length of the string in bytes. */ 00195 /* */ 00196 /* stringOffset :: The offset to the string in the `name' table. */ 00197 /* */ 00198 /* string :: A pointer to the string's bytes. Note that these */ 00199 /* are usually UTF-16 encoded characters. */ 00200 /* */ 00201 typedef struct TT_NameEntryRec_ 00202 { 00203 FT_UShort platformID; 00204 FT_UShort encodingID; 00205 FT_UShort languageID; 00206 FT_UShort nameID; 00207 FT_UShort stringLength; 00208 FT_ULong stringOffset; 00209 00210 /* this last field is not defined in the spec */ 00211 /* but used by the FreeType engine */ 00212 00213 FT_Byte* string; 00214 00215 } TT_NameEntryRec, *TT_NameEntry; 00216 00217 00218 /*************************************************************************/ 00219 /* */ 00220 /* <Struct> */ 00221 /* TT_NameTableRec */ 00222 /* */ 00223 /* <Description> */ 00224 /* A structure modeling the TrueType name table. */ 00225 /* */ 00226 /* <Fields> */ 00227 /* format :: The format of the name table. */ 00228 /* */ 00229 /* numNameRecords :: The number of names in table. */ 00230 /* */ 00231 /* storageOffset :: The offset of the name table in the `name' */ 00232 /* TrueType table. */ 00233 /* */ 00234 /* names :: An array of name records. */ 00235 /* */ 00236 /* stream :: the file's input stream. */ 00237 /* */ 00238 typedef struct TT_NameTableRec_ 00239 { 00240 FT_UShort format; 00241 FT_UInt numNameRecords; 00242 FT_UInt storageOffset; 00243 TT_NameEntryRec* names; 00244 FT_Stream stream; 00245 00246 } TT_NameTableRec, *TT_NameTable; 00247 00248 00249 /*************************************************************************/ 00250 /*************************************************************************/ 00251 /*************************************************************************/ 00252 /*** ***/ 00253 /*** ***/ 00254 /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ 00255 /*** ***/ 00256 /*** ***/ 00257 /*************************************************************************/ 00258 /*************************************************************************/ 00259 /*************************************************************************/ 00260 00261 00262 /*************************************************************************/ 00263 /* */ 00264 /* <Struct> */ 00265 /* TT_GaspRangeRec */ 00266 /* */ 00267 /* <Description> */ 00268 /* A tiny structure used to model a gasp range according to the */ 00269 /* TrueType specification. */ 00270 /* */ 00271 /* <Fields> */ 00272 /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */ 00273 /* */ 00274 /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */ 00275 /* modes to be used. */ 00276 /* */ 00277 typedef struct TT_GaspRangeRec_ 00278 { 00279 FT_UShort maxPPEM; 00280 FT_UShort gaspFlag; 00281 00282 } TT_GaspRangeRec, *TT_GaspRange; 00283 00284 00285 #define TT_GASP_GRIDFIT 0x01 00286 #define TT_GASP_DOGRAY 0x02 00287 00288 00289 /*************************************************************************/ 00290 /* */ 00291 /* <Struct> */ 00292 /* TT_GaspRec */ 00293 /* */ 00294 /* <Description> */ 00295 /* A structure modeling the TrueType `gasp' table used to specify */ 00296 /* grid-fitting and anti-aliasing behaviour. */ 00297 /* */ 00298 /* <Fields> */ 00299 /* version :: The version number. */ 00300 /* */ 00301 /* numRanges :: The number of gasp ranges in table. */ 00302 /* */ 00303 /* gaspRanges :: An array of gasp ranges. */ 00304 /* */ 00305 typedef struct TT_Gasp_ 00306 { 00307 FT_UShort version; 00308 FT_UShort numRanges; 00309 TT_GaspRange gaspRanges; 00310 00311 } TT_GaspRec; 00312 00313 00314 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 00315 00316 /*************************************************************************/ 00317 /* */ 00318 /* <Struct> */ 00319 /* TT_HdmxEntryRec */ 00320 /* */ 00321 /* <Description> */ 00322 /* A small structure used to model the pre-computed widths of a given */ 00323 /* size. They are found in the `hdmx' table. */ 00324 /* */ 00325 /* <Fields> */ 00326 /* ppem :: The pixels per EM value at which these metrics apply. */ 00327 /* */ 00328 /* max_width :: The maximum advance width for this metric. */ 00329 /* */ 00330 /* widths :: An array of widths. Note: These are 8-bit bytes. */ 00331 /* */ 00332 typedef struct TT_HdmxEntryRec_ 00333 { 00334 FT_Byte ppem; 00335 FT_Byte max_width; 00336 FT_Byte* widths; 00337 00338 } TT_HdmxEntryRec, *TT_HdmxEntry; 00339 00340 00341 /*************************************************************************/ 00342 /* */ 00343 /* <Struct> */ 00344 /* TT_HdmxRec */ 00345 /* */ 00346 /* <Description> */ 00347 /* A structure used to model the `hdmx' table, which contains */ 00348 /* pre-computed widths for a set of given sizes/dimensions. */ 00349 /* */ 00350 /* <Fields> */ 00351 /* version :: The version number. */ 00352 /* */ 00353 /* num_records :: The number of hdmx records. */ 00354 /* */ 00355 /* records :: An array of hdmx records. */ 00356 /* */ 00357 typedef struct TT_HdmxRec_ 00358 { 00359 FT_UShort version; 00360 FT_Short num_records; 00361 TT_HdmxEntry records; 00362 00363 } TT_HdmxRec, *TT_Hdmx; 00364 00365 00366 /*************************************************************************/ 00367 /* */ 00368 /* <Struct> */ 00369 /* TT_Kern0_PairRec */ 00370 /* */ 00371 /* <Description> */ 00372 /* A structure used to model a kerning pair for the kerning table */ 00373 /* format 0. The engine now loads this table if it finds one in the */ 00374 /* font file. */ 00375 /* */ 00376 /* <Fields> */ 00377 /* left :: The index of the left glyph in pair. */ 00378 /* */ 00379 /* right :: The index of the right glyph in pair. */ 00380 /* */ 00381 /* value :: The kerning distance. A positive value spaces the */ 00382 /* glyphs, a negative one makes them closer. */ 00383 /* */ 00384 typedef struct TT_Kern0_PairRec_ 00385 { 00386 FT_UShort left; /* index of left glyph in pair */ 00387 FT_UShort right; /* index of right glyph in pair */ 00388 FT_FWord value; /* kerning value */ 00389 00390 } TT_Kern0_PairRec, *TT_Kern0_Pair; 00391 00392 #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ 00393 00394 00395 /*************************************************************************/ 00396 /*************************************************************************/ 00397 /*************************************************************************/ 00398 /*** ***/ 00399 /*** ***/ 00400 /*** EMBEDDED BITMAPS SUPPORT ***/ 00401 /*** ***/ 00402 /*** ***/ 00403 /*************************************************************************/ 00404 /*************************************************************************/ 00405 /*************************************************************************/ 00406 00407 00408 /*************************************************************************/ 00409 /* */ 00410 /* <Struct> */ 00411 /* TT_SBit_MetricsRec */ 00412 /* */ 00413 /* <Description> */ 00414 /* A structure used to hold the big metrics of a given glyph bitmap */ 00415 /* in a TrueType or OpenType font. These are usually found in the */ 00416 /* `EBDT' (Microsoft) or `bloc' (Apple) table. */ 00417 /* */ 00418 /* <Fields> */ 00419 /* height :: The glyph height in pixels. */ 00420 /* */ 00421 /* width :: The glyph width in pixels. */ 00422 /* */ 00423 /* horiBearingX :: The horizontal left bearing. */ 00424 /* */ 00425 /* horiBearingY :: The horizontal top bearing. */ 00426 /* */ 00427 /* horiAdvance :: The horizontal advance. */ 00428 /* */ 00429 /* vertBearingX :: The vertical left bearing. */ 00430 /* */ 00431 /* vertBearingY :: The vertical top bearing. */ 00432 /* */ 00433 /* vertAdvance :: The vertical advance. */ 00434 /* */ 00435 typedef struct TT_SBit_MetricsRec_ 00436 { 00437 FT_Byte height; 00438 FT_Byte width; 00439 00440 FT_Char horiBearingX; 00441 FT_Char horiBearingY; 00442 FT_Byte horiAdvance; 00443 00444 FT_Char vertBearingX; 00445 FT_Char vertBearingY; 00446 FT_Byte vertAdvance; 00447 00448 } TT_SBit_MetricsRec, *TT_SBit_Metrics; 00449 00450 00451 /*************************************************************************/ 00452 /* */ 00453 /* <Struct> */ 00454 /* TT_SBit_SmallMetricsRec */ 00455 /* */ 00456 /* <Description> */ 00457 /* A structure used to hold the small metrics of a given glyph bitmap */ 00458 /* in a TrueType or OpenType font. These are usually found in the */ 00459 /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */ 00460 /* */ 00461 /* <Fields> */ 00462 /* height :: The glyph height in pixels. */ 00463 /* */ 00464 /* width :: The glyph width in pixels. */ 00465 /* */ 00466 /* bearingX :: The left-side bearing. */ 00467 /* */ 00468 /* bearingY :: The top-side bearing. */ 00469 /* */ 00470 /* advance :: The advance width or height. */ 00471 /* */ 00472 typedef struct TT_SBit_Small_Metrics_ 00473 { 00474 FT_Byte height; 00475 FT_Byte width; 00476 00477 FT_Char bearingX; 00478 FT_Char bearingY; 00479 FT_Byte advance; 00480 00481 } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics; 00482 00483 00484 /*************************************************************************/ 00485 /* */ 00486 /* <Struct> */ 00487 /* TT_SBit_LineMetricsRec */ 00488 /* */ 00489 /* <Description> */ 00490 /* A structure used to describe the text line metrics of a given */ 00491 /* bitmap strike, for either a horizontal or vertical layout. */ 00492 /* */ 00493 /* <Fields> */ 00494 /* ascender :: The ascender in pixels. */ 00495 /* */ 00496 /* descender :: The descender in pixels. */ 00497 /* */ 00498 /* max_width :: The maximum glyph width in pixels. */ 00499 /* */ 00500 /* caret_slope_enumerator :: Rise of the caret slope, typically set */ 00501 /* to 1 for non-italic fonts. */ 00502 /* */ 00503 /* caret_slope_denominator :: Rise of the caret slope, typically set */ 00504 /* to 0 for non-italic fonts. */ 00505 /* */ 00506 /* caret_offset :: Offset in pixels to move the caret for */ 00507 /* proper positioning. */ 00508 /* */ 00509 /* min_origin_SB :: Minimum of horiBearingX (resp. */ 00510 /* vertBearingY). */ 00511 /* min_advance_SB :: Minimum of */ 00512 /* */ 00513 /* horizontal advance - */ 00514 /* ( horiBearingX + width ) */ 00515 /* */ 00516 /* resp. */ 00517 /* */ 00518 /* vertical advance - */ 00519 /* ( vertBearingY + height ) */ 00520 /* */ 00521 /* max_before_BL :: Maximum of horiBearingY (resp. */ 00522 /* vertBearingY). */ 00523 /* */ 00524 /* min_after_BL :: Minimum of */ 00525 /* */ 00526 /* horiBearingY - height */ 00527 /* */ 00528 /* resp. */ 00529 /* */ 00530 /* vertBearingX - width */ 00531 /* */ 00532 /* pads :: Unused (to make the size of the record */ 00533 /* a multiple of 32 bits. */ 00534 /* */ 00535 typedef struct TT_SBit_LineMetricsRec_ 00536 { 00537 FT_Char ascender; 00538 FT_Char descender; 00539 FT_Byte max_width; 00540 FT_Char caret_slope_numerator; 00541 FT_Char caret_slope_denominator; 00542 FT_Char caret_offset; 00543 FT_Char min_origin_SB; 00544 FT_Char min_advance_SB; 00545 FT_Char max_before_BL; 00546 FT_Char min_after_BL; 00547 FT_Char pads[2]; 00548 00549 } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics; 00550 00551 00552 /*************************************************************************/ 00553 /* */ 00554 /* <Struct> */ 00555 /* TT_SBit_RangeRec */ 00556 /* */ 00557 /* <Description> */ 00558 /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */ 00559 /* (Microsoft) or `bloc' (Apple) tables. */ 00560 /* */ 00561 /* <Fields> */ 00562 /* first_glyph :: The first glyph index in the range. */ 00563 /* */ 00564 /* last_glyph :: The last glyph index in the range. */ 00565 /* */ 00566 /* index_format :: The format of index table. Valid values are 1 */ 00567 /* to 5. */ 00568 /* */ 00569 /* image_format :: The format of `EBDT' image data. */ 00570 /* */ 00571 /* image_offset :: The offset to image data in `EBDT'. */ 00572 /* */ 00573 /* image_size :: For index formats 2 and 5. This is the size in */ 00574 /* bytes of each glyph bitmap. */ 00575 /* */ 00576 /* big_metrics :: For index formats 2 and 5. This is the big */ 00577 /* metrics for each glyph bitmap. */ 00578 /* */ 00579 /* num_glyphs :: For index formats 4 and 5. This is the number of */ 00580 /* glyphs in the code array. */ 00581 /* */ 00582 /* glyph_offsets :: For index formats 1 and 3. */ 00583 /* */ 00584 /* glyph_codes :: For index formats 4 and 5. */ 00585 /* */ 00586 /* table_offset :: The offset of the index table in the `EBLC' */ 00587 /* table. Only used during strike loading. */ 00588 /* */ 00589 typedef struct TT_SBit_RangeRec_ 00590 { 00591 FT_UShort first_glyph; 00592 FT_UShort last_glyph; 00593 00594 FT_UShort index_format; 00595 FT_UShort image_format; 00596 FT_ULong image_offset; 00597 00598 FT_ULong image_size; 00599 TT_SBit_MetricsRec metrics; 00600 FT_ULong num_glyphs; 00601 00602 FT_ULong* glyph_offsets; 00603 FT_UShort* glyph_codes; 00604 00605 FT_ULong table_offset; 00606 00607 } TT_SBit_RangeRec, *TT_SBit_Range; 00608 00609 00610 /*************************************************************************/ 00611 /* */ 00612 /* <Struct> */ 00613 /* TT_SBit_StrikeRec */ 00614 /* */ 00615 /* <Description> */ 00616 /* A structure used describe a given bitmap strike in the `EBLC' */ 00617 /* (Microsoft) or `bloc' (Apple) tables. */ 00618 /* */ 00619 /* <Fields> */ 00620 /* num_index_ranges :: The number of index ranges. */ 00621 /* */ 00622 /* index_ranges :: An array of glyph index ranges. */ 00623 /* */ 00624 /* color_ref :: Unused. `color_ref' is put in for future */ 00625 /* enhancements, but these fields are already */ 00626 /* in use by other platforms (e.g. Newton). */ 00627 /* For details, please see */ 00628 /* */ 00629 /* http://fonts.apple.com/ */ 00630 /* TTRefMan/RM06/Chap6bloc.html */ 00631 /* */ 00632 /* hori :: The line metrics for horizontal layouts. */ 00633 /* */ 00634 /* vert :: The line metrics for vertical layouts. */ 00635 /* */ 00636 /* start_glyph :: The lowest glyph index for this strike. */ 00637 /* */ 00638 /* end_glyph :: The highest glyph index for this strike. */ 00639 /* */ 00640 /* x_ppem :: The number of horizontal pixels per EM. */ 00641 /* */ 00642 /* y_ppem :: The number of vertical pixels per EM. */ 00643 /* */ 00644 /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */ 00645 /* and 8. */ 00646 /* */ 00647 /* flags :: Is this a vertical or horizontal strike? For */ 00648 /* details, please see */ 00649 /* */ 00650 /* http://fonts.apple.com/ */ 00651 /* TTRefMan/RM06/Chap6bloc.html */ 00652 /* */ 00653 typedef struct TT_SBit_StrikeRec_ 00654 { 00655 FT_Int num_ranges; 00656 TT_SBit_Range sbit_ranges; 00657 FT_ULong ranges_offset; 00658 00659 FT_ULong color_ref; 00660 00661 TT_SBit_LineMetricsRec hori; 00662 TT_SBit_LineMetricsRec vert; 00663 00664 FT_UShort start_glyph; 00665 FT_UShort end_glyph; 00666 00667 FT_Byte x_ppem; 00668 FT_Byte y_ppem; 00669 00670 FT_Byte bit_depth; 00671 FT_Char flags; 00672 00673 } TT_SBit_StrikeRec, *TT_SBit_Strike; 00674 00675 00676 /*************************************************************************/ 00677 /* */ 00678 /* <Struct> */ 00679 /* TT_SBit_ComponentRec */ 00680 /* */ 00681 /* <Description> */ 00682 /* A simple structure to describe a compound sbit element. */ 00683 /* */ 00684 /* <Fields> */ 00685 /* glyph_code :: The element's glyph index. */ 00686 /* */ 00687 /* x_offset :: The element's left bearing. */ 00688 /* */ 00689 /* y_offset :: The element's top bearing. */ 00690 /* */ 00691 typedef struct TT_SBit_ComponentRec_ 00692 { 00693 FT_UShort glyph_code; 00694 FT_Char x_offset; 00695 FT_Char y_offset; 00696 00697 } TT_SBit_ComponentRec, *TT_SBit_Component; 00698 00699 00700 /*************************************************************************/ 00701 /* */ 00702 /* <Struct> */ 00703 /* TT_SBit_ScaleRec */ 00704 /* */ 00705 /* <Description> */ 00706 /* A structure used describe a given bitmap scaling table, as defined */ 00707 /* in the `EBSC' table. */ 00708 /* */ 00709 /* <Fields> */ 00710 /* hori :: The horizontal line metrics. */ 00711 /* */ 00712 /* vert :: The vertical line metrics. */ 00713 /* */ 00714 /* x_ppem :: The number of horizontal pixels per EM. */ 00715 /* */ 00716 /* y_ppem :: The number of vertical pixels per EM. */ 00717 /* */ 00718 /* x_ppem_substitute :: Substitution x_ppem value. */ 00719 /* */ 00720 /* y_ppem_substitute :: Substitution y_ppem value. */ 00721 /* */ 00722 typedef struct TT_SBit_ScaleRec_ 00723 { 00724 TT_SBit_LineMetricsRec hori; 00725 TT_SBit_LineMetricsRec vert; 00726 00727 FT_Byte x_ppem; 00728 FT_Byte y_ppem; 00729 00730 FT_Byte x_ppem_substitute; 00731 FT_Byte y_ppem_substitute; 00732 00733 } TT_SBit_ScaleRec, *TT_SBit_Scale; 00734 00735 00736 /*************************************************************************/ 00737 /*************************************************************************/ 00738 /*************************************************************************/ 00739 /*** ***/ 00740 /*** ***/ 00741 /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/ 00742 /*** ***/ 00743 /*** ***/ 00744 /*************************************************************************/ 00745 /*************************************************************************/ 00746 /*************************************************************************/ 00747 00748 00749 /*************************************************************************/ 00750 /* */ 00751 /* <Struct> */ 00752 /* TT_Post_20Rec */ 00753 /* */ 00754 /* <Description> */ 00755 /* Postscript names sub-table, format 2.0. Stores the PS name of */ 00756 /* each glyph in the font face. */ 00757 /* */ 00758 /* <Fields> */ 00759 /* num_glyphs :: The number of named glyphs in the table. */ 00760 /* */ 00761 /* num_names :: The number of PS names stored in the table. */ 00762 /* */ 00763 /* glyph_indices :: The indices of the glyphs in the names arrays. */ 00764 /* */ 00765 /* glyph_names :: The PS names not in Mac Encoding. */ 00766 /* */ 00767 typedef struct TT_Post_20Rec_ 00768 { 00769 FT_UShort num_glyphs; 00770 FT_UShort num_names; 00771 FT_UShort* glyph_indices; 00772 FT_Char** glyph_names; 00773 00774 } TT_Post_20Rec, *TT_Post_20; 00775 00776 00777 /*************************************************************************/ 00778 /* */ 00779 /* <Struct> */ 00780 /* TT_Post_25Rec */ 00781 /* */ 00782 /* <Description> */ 00783 /* Postscript names sub-table, format 2.5. Stores the PS name of */ 00784 /* each glyph in the font face. */ 00785 /* */ 00786 /* <Fields> */ 00787 /* num_glyphs :: The number of glyphs in the table. */ 00788 /* */ 00789 /* offsets :: An array of signed offsets in a normal Mac */ 00790 /* Postscript name encoding. */ 00791 /* */ 00792 typedef struct TT_Post_25_ 00793 { 00794 FT_UShort num_glyphs; 00795 FT_Char* offsets; 00796 00797 } TT_Post_25Rec, *TT_Post_25; 00798 00799 00800 /*************************************************************************/ 00801 /* */ 00802 /* <Struct> */ 00803 /* TT_Post_NamesRec */ 00804 /* */ 00805 /* <Description> */ 00806 /* Postscript names table, either format 2.0 or 2.5. */ 00807 /* */ 00808 /* <Fields> */ 00809 /* loaded :: A flag to indicate whether the PS names are loaded. */ 00810 /* */ 00811 /* format_20 :: The sub-table used for format 2.0. */ 00812 /* */ 00813 /* format_25 :: The sub-table used for format 2.5. */ 00814 /* */ 00815 typedef struct TT_Post_NamesRec_ 00816 { 00817 FT_Bool loaded; 00818 00819 union 00820 { 00821 TT_Post_20Rec format_20; 00822 TT_Post_25Rec format_25; 00823 00824 } names; 00825 00826 } TT_Post_NamesRec, *TT_Post_Names; 00827 00828 00829 /*************************************************************************/ 00830 /*************************************************************************/ 00831 /*************************************************************************/ 00832 /*** ***/ 00833 /*** ***/ 00834 /*** GX VARIATION TABLE SUPPORT ***/ 00835 /*** ***/ 00836 /*** ***/ 00837 /*************************************************************************/ 00838 /*************************************************************************/ 00839 /*************************************************************************/ 00840 00841 00842 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 00843 typedef struct GX_BlendRec_ *GX_Blend; 00844 #endif 00845 00846 /*************************************************************************/ 00847 /*************************************************************************/ 00848 /*************************************************************************/ 00849 /*** ***/ 00850 /*** ***/ 00851 /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/ 00852 /*** ***/ 00853 /*** ***/ 00854 /*************************************************************************/ 00855 /*************************************************************************/ 00856 /*************************************************************************/ 00857 00858 /* 00859 * These types are used to support a `BDF ' table that isn't part of the 00860 * official TrueType specification. It is mainly used in SFNT-based 00861 * bitmap fonts that were generated from a set of BDF fonts. 00862 * 00863 * The format of the table is as follows. 00864 * 00865 * USHORT version `BDF ' table version number, should be 0x0001. 00866 * USHORT strikeCount Number of strikes (bitmap sizes) in this table. 00867 * ULONG stringTable Offset (from start of BDF table) to string 00868 * table. 00869 * 00870 * This is followed by an array of `strikeCount' descriptors, having the 00871 * following format. 00872 * 00873 * USHORT ppem Vertical pixels per EM for this strike. 00874 * USHORT numItems Number of items for this strike (properties and 00875 * atoms). Maximum is 255. 00876 * 00877 * This array in turn is followed by `strikeCount' value sets. Each 00878 * `value set' is an array of `numItems' items with the following format. 00879 * 00880 * ULONG item_name Offset in string table to item name. 00881 * USHORT item_type The item type. Possible values are 00882 * 0 => string (e.g., COMMENT) 00883 * 1 => atom (e.g., FONT or even SIZE) 00884 * 2 => int32 00885 * 3 => uint32 00886 * 0x10 => A flag to indicate a properties. This 00887 * is ORed with the above values. 00888 * ULONG item_value For strings => Offset into string table without 00889 * the corresponding double quotes. 00890 * For atoms => Offset into string table. 00891 * For integers => Direct value. 00892 * 00893 * All strings in the string table consist of bytes and are 00894 * zero-terminated. 00895 * 00896 */ 00897 00898 #ifdef TT_CONFIG_OPTION_BDF 00899 00900 typedef struct TT_BDFRec_ 00901 { 00902 FT_Byte* table; 00903 FT_Byte* table_end; 00904 FT_Byte* strings; 00905 FT_ULong strings_size; 00906 FT_UInt num_strikes; 00907 FT_Bool loaded; 00908 00909 } TT_BDFRec, *TT_BDF; 00910 00911 #endif /* TT_CONFIG_OPTION_BDF */ 00912 00913 /*************************************************************************/ 00914 /*************************************************************************/ 00915 /*************************************************************************/ 00916 /*** ***/ 00917 /*** ***/ 00918 /*** ORIGINAL TT_FACE CLASS DEFINITION ***/ 00919 /*** ***/ 00920 /*** ***/ 00921 /*************************************************************************/ 00922 /*************************************************************************/ 00923 /*************************************************************************/ 00924 00925 00926 /*************************************************************************/ 00927 /* */ 00928 /* This structure/class is defined here because it is common to the */ 00929 /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ 00930 /* */ 00931 /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */ 00932 /* shared between font drivers, and are thus defined in `ttobjs.h'. */ 00933 /* */ 00934 /*************************************************************************/ 00935 00936 00937 /*************************************************************************/ 00938 /* */ 00939 /* <Type> */ 00940 /* TT_Face */ 00941 /* */ 00942 /* <Description> */ 00943 /* A handle to a TrueType face/font object. A TT_Face encapsulates */ 00944 /* the resolution and scaling independent parts of a TrueType font */ 00945 /* resource. */ 00946 /* */ 00947 /* <Note> */ 00948 /* The TT_Face structure is also used as a `parent class' for the */ 00949 /* OpenType-CFF class (T2_Face). */ 00950 /* */ 00951 typedef struct TT_FaceRec_* TT_Face; 00952 00953 00954 /* a function type used for the truetype bytecode interpreter hooks */ 00955 typedef FT_Error 00956 (*TT_Interpreter)( void* exec_context ); 00957 00958 /* forward declaration */ 00959 typedef struct TT_LoaderRec_* TT_Loader; 00960 00961 00962 /*************************************************************************/ 00963 /* */ 00964 /* <FuncType> */ 00965 /* TT_Loader_GotoTableFunc */ 00966 /* */ 00967 /* <Description> */ 00968 /* Seeks a stream to the start of a given TrueType table. */ 00969 /* */ 00970 /* <Input> */ 00971 /* face :: A handle to the target face object. */ 00972 /* */ 00973 /* tag :: A 4-byte tag used to name the table. */ 00974 /* */ 00975 /* stream :: The input stream. */ 00976 /* */ 00977 /* <Output> */ 00978 /* length :: The length of the table in bytes. Set to 0 if not */ 00979 /* needed. */ 00980 /* */ 00981 /* <Return> */ 00982 /* FreeType error code. 0 means success. */ 00983 /* */ 00984 /* <Note> */ 00985 /* The stream cursor must be at the font file's origin. */ 00986 /* */ 00987 typedef FT_Error 00988 (*TT_Loader_GotoTableFunc)( TT_Face face, 00989 FT_ULong tag, 00990 FT_Stream stream, 00991 FT_ULong* length ); 00992 00993 00994 /*************************************************************************/ 00995 /* */ 00996 /* <FuncType> */ 00997 /* TT_Loader_StartGlyphFunc */ 00998 /* */ 00999 /* <Description> */ 01000 /* Seeks a stream to the start of a given glyph element, and opens a */ 01001 /* frame for it. */ 01002 /* */ 01003 /* <Input> */ 01004 /* loader :: The current TrueType glyph loader object. */ 01005 /* */ 01006 /* glyph index :: The index of the glyph to access. */ 01007 /* */ 01008 /* offset :: The offset of the glyph according to the */ 01009 /* `locations' table. */ 01010 /* */ 01011 /* byte_count :: The size of the frame in bytes. */ 01012 /* */ 01013 /* <Return> */ 01014 /* FreeType error code. 0 means success. */ 01015 /* */ 01016 /* <Note> */ 01017 /* This function is normally equivalent to FT_STREAM_SEEK(offset) */ 01018 /* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */ 01019 /* but alternative formats (e.g. compressed ones) might use something */ 01020 /* different. */ 01021 /* */ 01022 typedef FT_Error 01023 (*TT_Loader_StartGlyphFunc)( TT_Loader loader, 01024 FT_UInt glyph_index, 01025 FT_ULong offset, 01026 FT_UInt byte_count ); 01027 01028 01029 /*************************************************************************/ 01030 /* */ 01031 /* <FuncType> */ 01032 /* TT_Loader_ReadGlyphFunc */ 01033 /* */ 01034 /* <Description> */ 01035 /* Reads one glyph element (its header, a simple glyph, or a */ 01036 /* composite) from the loader's current stream frame. */ 01037 /* */ 01038 /* <Input> */ 01039 /* loader :: The current TrueType glyph loader object. */ 01040 /* */ 01041 /* <Return> */ 01042 /* FreeType error code. 0 means success. */ 01043 /* */ 01044 typedef FT_Error 01045 (*TT_Loader_ReadGlyphFunc)( TT_Loader loader ); 01046 01047 01048 /*************************************************************************/ 01049 /* */ 01050 /* <FuncType> */ 01051 /* TT_Loader_EndGlyphFunc */ 01052 /* */ 01053 /* <Description> */ 01054 /* Closes the current loader stream frame for the glyph. */ 01055 /* */ 01056 /* <Input> */ 01057 /* loader :: The current TrueType glyph loader object. */ 01058 /* */ 01059 typedef void 01060 (*TT_Loader_EndGlyphFunc)( TT_Loader loader ); 01061 01062 01063 /*************************************************************************/ 01064 /* */ 01065 /* TrueType Face Type */ 01066 /* */ 01067 /* <Struct> */ 01068 /* TT_Face */ 01069 /* */ 01070 /* <Description> */ 01071 /* The TrueType face class. These objects model the resolution and */ 01072 /* point-size independent data found in a TrueType font file. */ 01073 /* */ 01074 /* <Fields> */ 01075 /* root :: The base FT_Face structure, managed by the */ 01076 /* base layer. */ 01077 /* */ 01078 /* ttc_header :: The TrueType collection header, used when */ 01079 /* the file is a `ttc' rather than a `ttf'. */ 01080 /* For ordinary font files, the field */ 01081 /* `ttc_header.count' is set to 0. */ 01082 /* */ 01083 /* format_tag :: The font format tag. */ 01084 /* */ 01085 /* num_tables :: The number of TrueType tables in this font */ 01086 /* file. */ 01087 /* */ 01088 /* dir_tables :: The directory of TrueType tables for this */ 01089 /* font file. */ 01090 /* */ 01091 /* header :: The font's font header (`head' table). */ 01092 /* Read on font opening. */ 01093 /* */ 01094 /* horizontal :: The font's horizontal header (`hhea' */ 01095 /* table). This field also contains the */ 01096 /* associated horizontal metrics table */ 01097 /* (`hmtx'). */ 01098 /* */ 01099 /* max_profile :: The font's maximum profile table. Read on */ 01100 /* font opening. Note that some maximum */ 01101 /* values cannot be taken directly from this */ 01102 /* table. We thus define additional fields */ 01103 /* below to hold the computed maxima. */ 01104 /* */ 01105 /* vertical_info :: A boolean which is set when the font file */ 01106 /* contains vertical metrics. If not, the */ 01107 /* value of the `vertical' field is */ 01108 /* undefined. */ 01109 /* */ 01110 /* vertical :: The font's vertical header (`vhea' table). */ 01111 /* This field also contains the associated */ 01112 /* vertical metrics table (`vmtx'), if found. */ 01113 /* IMPORTANT: The contents of this field is */ 01114 /* undefined if the `verticalInfo' field is */ 01115 /* unset. */ 01116 /* */ 01117 /* num_names :: The number of name records within this */ 01118 /* TrueType font. */ 01119 /* */ 01120 /* name_table :: The table of name records (`name'). */ 01121 /* */ 01122 /* os2 :: The font's OS/2 table (`OS/2'). */ 01123 /* */ 01124 /* postscript :: The font's PostScript table (`post' */ 01125 /* table). The PostScript glyph names are */ 01126 /* not loaded by the driver on face opening. */ 01127 /* See the `ttpost' module for more details. */ 01128 /* */ 01129 /* cmap_table :: Address of the face's `cmap' SFNT table */ 01130 /* in memory (it's an extracted frame). */ 01131 /* */ 01132 /* cmap_size :: The size in bytes of the `cmap_table' */ 01133 /* described above. */ 01134 /* */ 01135 /* goto_table :: A function called by each TrueType table */ 01136 /* loader to position a stream's cursor to */ 01137 /* the start of a given table according to */ 01138 /* its tag. It defaults to TT_Goto_Face but */ 01139 /* can be different for strange formats (e.g. */ 01140 /* Type 42). */ 01141 /* */ 01142 /* access_glyph_frame :: A function used to access the frame of a */ 01143 /* given glyph within the face's font file. */ 01144 /* */ 01145 /* forget_glyph_frame :: A function used to forget the frame of a */ 01146 /* given glyph when all data has been loaded. */ 01147 /* */ 01148 /* read_glyph_header :: A function used to read a glyph header. */ 01149 /* It must be called between an `access' and */ 01150 /* `forget'. */ 01151 /* */ 01152 /* read_simple_glyph :: A function used to read a simple glyph. */ 01153 /* It must be called after the header was */ 01154 /* read, and before the `forget'. */ 01155 /* */ 01156 /* read_composite_glyph :: A function used to read a composite glyph. */ 01157 /* It must be called after the header was */ 01158 /* read, and before the `forget'. */ 01159 /* */ 01160 /* sfnt :: A pointer to the SFNT service. */ 01161 /* */ 01162 /* psnames :: A pointer to the PostScript names service. */ 01163 /* */ 01164 /* hdmx :: The face's horizontal device metrics */ 01165 /* (`hdmx' table). This table is optional in */ 01166 /* TrueType/OpenType fonts. */ 01167 /* */ 01168 /* gasp :: The grid-fitting and scaling properties */ 01169 /* table (`gasp'). This table is optional in */ 01170 /* TrueType/OpenType fonts. */ 01171 /* */ 01172 /* pclt :: The `pclt' SFNT table. */ 01173 /* */ 01174 /* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */ 01175 /* sizes, embedded in this font. */ 01176 /* */ 01177 /* sbit_strikes :: An array of sbit strikes embedded in this */ 01178 /* font. This table is optional in a */ 01179 /* TrueType/OpenType font. */ 01180 /* */ 01181 /* num_sbit_scales :: The number of sbit scales for this font. */ 01182 /* */ 01183 /* sbit_scales :: Array of sbit scales embedded in this */ 01184 /* font. This table is optional in a */ 01185 /* TrueType/OpenType font. */ 01186 /* */ 01187 /* postscript_names :: A table used to store the Postscript names */ 01188 /* of the glyphs for this font. See the */ 01189 /* file `ttconfig.h' for comments on the */ 01190 /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */ 01191 /* */ 01192 /* num_locations :: The number of glyph locations in this */ 01193 /* TrueType file. This should be */ 01194 /* identical to the number of glyphs. */ 01195 /* Ignored for Type 2 fonts. */ 01196 /* */ 01197 /* glyph_locations :: An array of longs. These are offsets to */ 01198 /* glyph data within the `glyf' table. */ 01199 /* Ignored for Type 2 font faces. */ 01200 /* */ 01201 /* glyf_len :: The length of the `glyf' table. Needed */ 01202 /* for malformed `loca' tables. */ 01203 /* */ 01204 /* font_program_size :: Size in bytecodes of the face's font */ 01205 /* program. 0 if none defined. Ignored for */ 01206 /* Type 2 fonts. */ 01207 /* */ 01208 /* font_program :: The face's font program (bytecode stream) */ 01209 /* executed at load time, also used during */ 01210 /* glyph rendering. Comes from the `fpgm' */ 01211 /* table. Ignored for Type 2 font fonts. */ 01212 /* */ 01213 /* cvt_program_size :: The size in bytecodes of the face's cvt */ 01214 /* program. Ignored for Type 2 fonts. */ 01215 /* */ 01216 /* cvt_program :: The face's cvt program (bytecode stream) */ 01217 /* executed each time an instance/size is */ 01218 /* changed/reset. Comes from the `prep' */ 01219 /* table. Ignored for Type 2 fonts. */ 01220 /* */ 01221 /* cvt_size :: Size of the control value table (in */ 01222 /* entries). Ignored for Type 2 fonts. */ 01223 /* */ 01224 /* cvt :: The face's original control value table. */ 01225 /* Coordinates are expressed in unscaled font */ 01226 /* units. Comes from the `cvt ' table. */ 01227 /* Ignored for Type 2 fonts. */ 01228 /* */ 01229 /* num_kern_pairs :: The number of kerning pairs present in the */ 01230 /* font file. The engine only loads the */ 01231 /* first horizontal format 0 kern table it */ 01232 /* finds in the font file. Ignored for */ 01233 /* Type 2 fonts. */ 01234 /* */ 01235 /* kern_table_index :: The index of the kerning table in the font */ 01236 /* kerning directory. Ignored for Type 2 */ 01237 /* fonts. */ 01238 /* */ 01239 /* interpreter :: A pointer to the TrueType bytecode */ 01240 /* interpreters field is also used to hook */ 01241 /* the debugger in `ttdebug'. */ 01242 /* */ 01243 /* unpatented_hinting :: If true, use only unpatented methods in */ 01244 /* the bytecode interpreter. */ 01245 /* */ 01246 /* doblend :: A boolean which is set if the font should */ 01247 /* be blended (this is for GX var). */ 01248 /* */ 01249 /* blend :: Contains the data needed to control GX */ 01250 /* variation tables (rather like Multiple */ 01251 /* Master data). */ 01252 /* */ 01253 /* extra :: Reserved for third-party font drivers. */ 01254 /* */ 01255 /* postscript_name :: The PS name of the font. Used by the */ 01256 /* postscript name service. */ 01257 /* */ 01258 typedef struct TT_FaceRec_ 01259 { 01260 FT_FaceRec root; 01261 01262 TTC_HeaderRec ttc_header; 01263 01264 FT_ULong format_tag; 01265 FT_UShort num_tables; 01266 TT_Table dir_tables; 01267 01268 TT_Header header; /* TrueType header table */ 01269 TT_HoriHeader horizontal; /* TrueType horizontal header */ 01270 01271 TT_MaxProfile max_profile; 01272 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 01273 FT_ULong max_components; /* stubbed to 0 */ 01274 #endif 01275 01276 FT_Bool vertical_info; 01277 TT_VertHeader vertical; /* TT Vertical header, if present */ 01278 01279 FT_UShort num_names; /* number of name records */ 01280 TT_NameTableRec name_table; /* name table */ 01281 01282 TT_OS2 os2; /* TrueType OS/2 table */ 01283 TT_Postscript postscript; /* TrueType Postscript table */ 01284 01285 FT_Byte* cmap_table; /* extracted `cmap' table */ 01286 FT_ULong cmap_size; 01287 01288 TT_Loader_GotoTableFunc goto_table; 01289 01290 TT_Loader_StartGlyphFunc access_glyph_frame; 01291 TT_Loader_EndGlyphFunc forget_glyph_frame; 01292 TT_Loader_ReadGlyphFunc read_glyph_header; 01293 TT_Loader_ReadGlyphFunc read_simple_glyph; 01294 TT_Loader_ReadGlyphFunc read_composite_glyph; 01295 01296 /* a typeless pointer to the SFNT_Interface table used to load */ 01297 /* the basic TrueType tables in the face object */ 01298 void* sfnt; 01299 01300 /* a typeless pointer to the FT_Service_PsCMapsRec table used to */ 01301 /* handle glyph names <-> unicode & Mac values */ 01302 void* psnames; 01303 01304 01305 /***********************************************************************/ 01306 /* */ 01307 /* Optional TrueType/OpenType tables */ 01308 /* */ 01309 /***********************************************************************/ 01310 01311 /* horizontal device metrics */ 01312 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 01313 TT_HdmxRec hdmx; 01314 #endif 01315 01316 /* grid-fitting and scaling table */ 01317 TT_GaspRec gasp; /* the `gasp' table */ 01318 01319 /* PCL 5 table */ 01320 TT_PCLT pclt; 01321 01322 /* embedded bitmaps support */ 01323 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 01324 FT_ULong num_sbit_strikes; 01325 TT_SBit_Strike sbit_strikes; 01326 #endif 01327 01328 FT_ULong num_sbit_scales; 01329 TT_SBit_Scale sbit_scales; 01330 01331 /* postscript names table */ 01332 TT_Post_NamesRec postscript_names; 01333 01334 01335 /***********************************************************************/ 01336 /* */ 01337 /* TrueType-specific fields (ignored by the OTF-Type2 driver) */ 01338 /* */ 01339 /***********************************************************************/ 01340 01341 /* the glyph locations */ 01342 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 01343 FT_UShort num_locations_stub; 01344 FT_Long* glyph_locations_stub; 01345 #endif 01346 01347 /* the font program, if any */ 01348 FT_ULong font_program_size; 01349 FT_Byte* font_program; 01350 01351 /* the cvt program, if any */ 01352 FT_ULong cvt_program_size; 01353 FT_Byte* cvt_program; 01354 01355 /* the original, unscaled, control value table */ 01356 FT_ULong cvt_size; 01357 FT_Short* cvt; 01358 01359 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 01360 /* the format 0 kerning table, if any */ 01361 FT_Int num_kern_pairs; 01362 FT_Int kern_table_index; 01363 TT_Kern0_Pair kern_pairs; 01364 #endif 01365 01366 /* A pointer to the bytecode interpreter to use. This is also */ 01367 /* used to hook the debugger for the `ttdebug' utility. */ 01368 TT_Interpreter interpreter; 01369 01370 #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING 01371 /* Use unpatented hinting only. */ 01372 FT_Bool unpatented_hinting; 01373 #endif 01374 01375 /***********************************************************************/ 01376 /* */ 01377 /* Other tables or fields. This is used by derivative formats like */ 01378 /* OpenType. */ 01379 /* */ 01380 /***********************************************************************/ 01381 01382 FT_Generic extra; 01383 01384 const char* postscript_name; 01385 01386 /* since version 2.1.8, but was originally placed after */ 01387 /* `glyph_locations_stub' */ 01388 FT_ULong glyf_len; 01389 01390 /* since version 2.1.8, but was originally placed before `extra' */ 01391 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 01392 FT_Bool doblend; 01393 GX_Blend blend; 01394 #endif 01395 01396 /* since version 2.2 */ 01397 01398 FT_Byte* horz_metrics; 01399 FT_ULong horz_metrics_size; 01400 01401 FT_Byte* vert_metrics; 01402 FT_ULong vert_metrics_size; 01403 01404 FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */ 01405 FT_Byte* glyph_locations; 01406 01407 FT_Byte* hdmx_table; 01408 FT_ULong hdmx_table_size; 01409 FT_UInt hdmx_record_count; 01410 FT_ULong hdmx_record_size; 01411 FT_Byte* hdmx_record_sizes; 01412 01413 FT_Byte* sbit_table; 01414 FT_ULong sbit_table_size; 01415 FT_UInt sbit_num_strikes; 01416 01417 FT_Byte* kern_table; 01418 FT_ULong kern_table_size; 01419 FT_UInt num_kern_tables; 01420 FT_UInt32 kern_avail_bits; 01421 FT_UInt32 kern_order_bits; 01422 01423 #ifdef TT_CONFIG_OPTION_BDF 01424 TT_BDFRec bdf; 01425 #endif /* TT_CONFIG_OPTION_BDF */ 01426 01427 /* since 2.3.0 */ 01428 FT_ULong horz_metrics_offset; 01429 FT_ULong vert_metrics_offset; 01430 01431 } TT_FaceRec; 01432 01433 01434 /*************************************************************************/ 01435 /* */ 01436 /* <Struct> */ 01437 /* TT_GlyphZoneRec */ 01438 /* */ 01439 /* <Description> */ 01440 /* A glyph zone is used to load, scale and hint glyph outline */ 01441 /* coordinates. */ 01442 /* */ 01443 /* <Fields> */ 01444 /* memory :: A handle to the memory manager. */ 01445 /* */ 01446 /* max_points :: The maximal size in points of the zone. */ 01447 /* */ 01448 /* max_contours :: Max size in links contours of the zone. */ 01449 /* */ 01450 /* n_points :: The current number of points in the zone. */ 01451 /* */ 01452 /* n_contours :: The current number of contours in the zone. */ 01453 /* */ 01454 /* org :: The original glyph coordinates (font */ 01455 /* units/scaled). */ 01456 /* */ 01457 /* cur :: The current glyph coordinates (scaled/hinted). */ 01458 /* */ 01459 /* tags :: The point control tags. */ 01460 /* */ 01461 /* contours :: The contours end points. */ 01462 /* */ 01463 /* first_point :: Offset of the current subglyph's first point. */ 01464 /* */ 01465 typedef struct TT_GlyphZoneRec_ 01466 { 01467 FT_Memory memory; 01468 FT_UShort max_points; 01469 FT_UShort max_contours; 01470 FT_UShort n_points; /* number of points in zone */ 01471 FT_Short n_contours; /* number of contours */ 01472 01473 FT_Vector* org; /* original point coordinates */ 01474 FT_Vector* cur; /* current point coordinates */ 01475 FT_Vector* orus; /* original (unscaled) point coordinates */ 01476 01477 FT_Byte* tags; /* current touch flags */ 01478 FT_UShort* contours; /* contour end points */ 01479 01480 FT_UShort first_point; /* offset of first (#0) point */ 01481 01482 } TT_GlyphZoneRec, *TT_GlyphZone; 01483 01484 01485 /* handle to execution context */ 01486 typedef struct TT_ExecContextRec_* TT_ExecContext; 01487 01488 /* glyph loader structure */ 01489 typedef struct TT_LoaderRec_ 01490 { 01491 FT_Face face; 01492 FT_Size size; 01493 FT_GlyphSlot glyph; 01494 FT_GlyphLoader gloader; 01495 01496 FT_ULong load_flags; 01497 FT_UInt glyph_index; 01498 01499 FT_Stream stream; 01500 FT_Int byte_len; 01501 01502 FT_Short n_contours; 01503 FT_BBox bbox; 01504 FT_Int left_bearing; 01505 FT_Int advance; 01506 FT_Int linear; 01507 FT_Bool linear_def; 01508 FT_Bool preserve_pps; 01509 FT_Vector pp1; 01510 FT_Vector pp2; 01511 01512 FT_ULong glyf_offset; 01513 01514 /* the zone where we load our glyphs */ 01515 TT_GlyphZoneRec base; 01516 TT_GlyphZoneRec zone; 01517 01518 TT_ExecContext exec; 01519 FT_Byte* instructions; 01520 FT_ULong ins_pos; 01521 01522 /* for possible extensibility in other formats */ 01523 void* other; 01524 01525 /* since version 2.1.8 */ 01526 FT_Int top_bearing; 01527 FT_Int vadvance; 01528 FT_Vector pp3; 01529 FT_Vector pp4; 01530 01531 /* since version 2.2.1 */ 01532 FT_Byte* cursor; 01533 FT_Byte* limit; 01534 01535 } TT_LoaderRec; 01536 01537 01538 FT_END_HEADER 01539 01540 #endif /* __TTTYPES_H__ */ 01541 01542 01543 /* END */ Generated on Fri May 25 2012 04:32:07 for ReactOS by
1.7.6.1
|