vrshoot
diff libs/ft2static/freetype/internal/tttypes.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/internal/tttypes.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,1543 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* tttypes.h */ 1.7 +/* */ 1.8 +/* Basic SFNT/TrueType type definitions and interface (specification */ 1.9 +/* only). */ 1.10 +/* */ 1.11 +/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by */ 1.12 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.13 +/* */ 1.14 +/* This file is part of the FreeType project, and may only be used, */ 1.15 +/* modified, and distributed under the terms of the FreeType project */ 1.16 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.17 +/* this file you indicate that you have read the license and */ 1.18 +/* understand and accept it fully. */ 1.19 +/* */ 1.20 +/***************************************************************************/ 1.21 + 1.22 + 1.23 +#ifndef __TTTYPES_H__ 1.24 +#define __TTTYPES_H__ 1.25 + 1.26 + 1.27 +#include <ft2build.h> 1.28 +#include FT_TRUETYPE_TABLES_H 1.29 +#include FT_INTERNAL_OBJECTS_H 1.30 + 1.31 +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 1.32 +#include FT_MULTIPLE_MASTERS_H 1.33 +#endif 1.34 + 1.35 + 1.36 +FT_BEGIN_HEADER 1.37 + 1.38 + 1.39 + /*************************************************************************/ 1.40 + /*************************************************************************/ 1.41 + /*************************************************************************/ 1.42 + /*** ***/ 1.43 + /*** ***/ 1.44 + /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ 1.45 + /*** ***/ 1.46 + /*** ***/ 1.47 + /*************************************************************************/ 1.48 + /*************************************************************************/ 1.49 + /*************************************************************************/ 1.50 + 1.51 + 1.52 + /*************************************************************************/ 1.53 + /* */ 1.54 + /* <Struct> */ 1.55 + /* TTC_HeaderRec */ 1.56 + /* */ 1.57 + /* <Description> */ 1.58 + /* TrueType collection header. This table contains the offsets of */ 1.59 + /* the font headers of each distinct TrueType face in the file. */ 1.60 + /* */ 1.61 + /* <Fields> */ 1.62 + /* tag :: Must be `ttc ' to indicate a TrueType collection. */ 1.63 + /* */ 1.64 + /* version :: The version number. */ 1.65 + /* */ 1.66 + /* count :: The number of faces in the collection. The */ 1.67 + /* specification says this should be an unsigned long, but */ 1.68 + /* we use a signed long since we need the value -1 for */ 1.69 + /* specific purposes. */ 1.70 + /* */ 1.71 + /* offsets :: The offsets of the font headers, one per face. */ 1.72 + /* */ 1.73 + typedef struct TTC_HeaderRec_ 1.74 + { 1.75 + FT_ULong tag; 1.76 + FT_Fixed version; 1.77 + FT_Long count; 1.78 + FT_ULong* offsets; 1.79 + 1.80 + } TTC_HeaderRec; 1.81 + 1.82 + 1.83 + /*************************************************************************/ 1.84 + /* */ 1.85 + /* <Struct> */ 1.86 + /* SFNT_HeaderRec */ 1.87 + /* */ 1.88 + /* <Description> */ 1.89 + /* SFNT file format header. */ 1.90 + /* */ 1.91 + /* <Fields> */ 1.92 + /* format_tag :: The font format tag. */ 1.93 + /* */ 1.94 + /* num_tables :: The number of tables in file. */ 1.95 + /* */ 1.96 + /* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */ 1.97 + /* */ 1.98 + /* entry_selector :: Must be log2 of `search_range / 16'. */ 1.99 + /* */ 1.100 + /* range_shift :: Must be `num_tables * 16 - search_range'. */ 1.101 + /* */ 1.102 + typedef struct SFNT_HeaderRec_ 1.103 + { 1.104 + FT_ULong format_tag; 1.105 + FT_UShort num_tables; 1.106 + FT_UShort search_range; 1.107 + FT_UShort entry_selector; 1.108 + FT_UShort range_shift; 1.109 + 1.110 + FT_ULong offset; /* not in file */ 1.111 + 1.112 + } SFNT_HeaderRec, *SFNT_Header; 1.113 + 1.114 + 1.115 + /*************************************************************************/ 1.116 + /* */ 1.117 + /* <Struct> */ 1.118 + /* TT_TableRec */ 1.119 + /* */ 1.120 + /* <Description> */ 1.121 + /* This structure describes a given table of a TrueType font. */ 1.122 + /* */ 1.123 + /* <Fields> */ 1.124 + /* Tag :: A four-bytes tag describing the table. */ 1.125 + /* */ 1.126 + /* CheckSum :: The table checksum. This value can be ignored. */ 1.127 + /* */ 1.128 + /* Offset :: The offset of the table from the start of the TrueType */ 1.129 + /* font in its resource. */ 1.130 + /* */ 1.131 + /* Length :: The table length (in bytes). */ 1.132 + /* */ 1.133 + typedef struct TT_TableRec_ 1.134 + { 1.135 + FT_ULong Tag; /* table type */ 1.136 + FT_ULong CheckSum; /* table checksum */ 1.137 + FT_ULong Offset; /* table file offset */ 1.138 + FT_ULong Length; /* table length */ 1.139 + 1.140 + } TT_TableRec, *TT_Table; 1.141 + 1.142 + 1.143 + /*************************************************************************/ 1.144 + /* */ 1.145 + /* <Struct> */ 1.146 + /* TT_LongMetricsRec */ 1.147 + /* */ 1.148 + /* <Description> */ 1.149 + /* A structure modeling the long metrics of the `hmtx' and `vmtx' */ 1.150 + /* TrueType tables. The values are expressed in font units. */ 1.151 + /* */ 1.152 + /* <Fields> */ 1.153 + /* advance :: The advance width or height for the glyph. */ 1.154 + /* */ 1.155 + /* bearing :: The left-side or top-side bearing for the glyph. */ 1.156 + /* */ 1.157 + typedef struct TT_LongMetricsRec_ 1.158 + { 1.159 + FT_UShort advance; 1.160 + FT_Short bearing; 1.161 + 1.162 + } TT_LongMetricsRec, *TT_LongMetrics; 1.163 + 1.164 + 1.165 + /*************************************************************************/ 1.166 + /* */ 1.167 + /* <Type> */ 1.168 + /* TT_ShortMetrics */ 1.169 + /* */ 1.170 + /* <Description> */ 1.171 + /* A simple type to model the short metrics of the `hmtx' and `vmtx' */ 1.172 + /* tables. */ 1.173 + /* */ 1.174 + typedef FT_Short TT_ShortMetrics; 1.175 + 1.176 + 1.177 + /*************************************************************************/ 1.178 + /* */ 1.179 + /* <Struct> */ 1.180 + /* TT_NameEntryRec */ 1.181 + /* */ 1.182 + /* <Description> */ 1.183 + /* A structure modeling TrueType name records. Name records are used */ 1.184 + /* to store important strings like family name, style name, */ 1.185 + /* copyright, etc. in _localized_ versions (i.e., language, encoding, */ 1.186 + /* etc). */ 1.187 + /* */ 1.188 + /* <Fields> */ 1.189 + /* platformID :: The ID of the name's encoding platform. */ 1.190 + /* */ 1.191 + /* encodingID :: The platform-specific ID for the name's encoding. */ 1.192 + /* */ 1.193 + /* languageID :: The platform-specific ID for the name's language. */ 1.194 + /* */ 1.195 + /* nameID :: The ID specifying what kind of name this is. */ 1.196 + /* */ 1.197 + /* stringLength :: The length of the string in bytes. */ 1.198 + /* */ 1.199 + /* stringOffset :: The offset to the string in the `name' table. */ 1.200 + /* */ 1.201 + /* string :: A pointer to the string's bytes. Note that these */ 1.202 + /* are usually UTF-16 encoded characters. */ 1.203 + /* */ 1.204 + typedef struct TT_NameEntryRec_ 1.205 + { 1.206 + FT_UShort platformID; 1.207 + FT_UShort encodingID; 1.208 + FT_UShort languageID; 1.209 + FT_UShort nameID; 1.210 + FT_UShort stringLength; 1.211 + FT_ULong stringOffset; 1.212 + 1.213 + /* this last field is not defined in the spec */ 1.214 + /* but used by the FreeType engine */ 1.215 + 1.216 + FT_Byte* string; 1.217 + 1.218 + } TT_NameEntryRec, *TT_NameEntry; 1.219 + 1.220 + 1.221 + /*************************************************************************/ 1.222 + /* */ 1.223 + /* <Struct> */ 1.224 + /* TT_NameTableRec */ 1.225 + /* */ 1.226 + /* <Description> */ 1.227 + /* A structure modeling the TrueType name table. */ 1.228 + /* */ 1.229 + /* <Fields> */ 1.230 + /* format :: The format of the name table. */ 1.231 + /* */ 1.232 + /* numNameRecords :: The number of names in table. */ 1.233 + /* */ 1.234 + /* storageOffset :: The offset of the name table in the `name' */ 1.235 + /* TrueType table. */ 1.236 + /* */ 1.237 + /* names :: An array of name records. */ 1.238 + /* */ 1.239 + /* stream :: the file's input stream. */ 1.240 + /* */ 1.241 + typedef struct TT_NameTableRec_ 1.242 + { 1.243 + FT_UShort format; 1.244 + FT_UInt numNameRecords; 1.245 + FT_UInt storageOffset; 1.246 + TT_NameEntryRec* names; 1.247 + FT_Stream stream; 1.248 + 1.249 + } TT_NameTableRec, *TT_NameTable; 1.250 + 1.251 + 1.252 + /*************************************************************************/ 1.253 + /*************************************************************************/ 1.254 + /*************************************************************************/ 1.255 + /*** ***/ 1.256 + /*** ***/ 1.257 + /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ 1.258 + /*** ***/ 1.259 + /*** ***/ 1.260 + /*************************************************************************/ 1.261 + /*************************************************************************/ 1.262 + /*************************************************************************/ 1.263 + 1.264 + 1.265 + /*************************************************************************/ 1.266 + /* */ 1.267 + /* <Struct> */ 1.268 + /* TT_GaspRangeRec */ 1.269 + /* */ 1.270 + /* <Description> */ 1.271 + /* A tiny structure used to model a gasp range according to the */ 1.272 + /* TrueType specification. */ 1.273 + /* */ 1.274 + /* <Fields> */ 1.275 + /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */ 1.276 + /* */ 1.277 + /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */ 1.278 + /* modes to be used. */ 1.279 + /* */ 1.280 + typedef struct TT_GaspRangeRec_ 1.281 + { 1.282 + FT_UShort maxPPEM; 1.283 + FT_UShort gaspFlag; 1.284 + 1.285 + } TT_GaspRangeRec, *TT_GaspRange; 1.286 + 1.287 + 1.288 +#define TT_GASP_GRIDFIT 0x01 1.289 +#define TT_GASP_DOGRAY 0x02 1.290 + 1.291 + 1.292 + /*************************************************************************/ 1.293 + /* */ 1.294 + /* <Struct> */ 1.295 + /* TT_GaspRec */ 1.296 + /* */ 1.297 + /* <Description> */ 1.298 + /* A structure modeling the TrueType `gasp' table used to specify */ 1.299 + /* grid-fitting and anti-aliasing behaviour. */ 1.300 + /* */ 1.301 + /* <Fields> */ 1.302 + /* version :: The version number. */ 1.303 + /* */ 1.304 + /* numRanges :: The number of gasp ranges in table. */ 1.305 + /* */ 1.306 + /* gaspRanges :: An array of gasp ranges. */ 1.307 + /* */ 1.308 + typedef struct TT_Gasp_ 1.309 + { 1.310 + FT_UShort version; 1.311 + FT_UShort numRanges; 1.312 + TT_GaspRange gaspRanges; 1.313 + 1.314 + } TT_GaspRec; 1.315 + 1.316 + 1.317 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.318 + 1.319 + /*************************************************************************/ 1.320 + /* */ 1.321 + /* <Struct> */ 1.322 + /* TT_HdmxEntryRec */ 1.323 + /* */ 1.324 + /* <Description> */ 1.325 + /* A small structure used to model the pre-computed widths of a given */ 1.326 + /* size. They are found in the `hdmx' table. */ 1.327 + /* */ 1.328 + /* <Fields> */ 1.329 + /* ppem :: The pixels per EM value at which these metrics apply. */ 1.330 + /* */ 1.331 + /* max_width :: The maximum advance width for this metric. */ 1.332 + /* */ 1.333 + /* widths :: An array of widths. Note: These are 8-bit bytes. */ 1.334 + /* */ 1.335 + typedef struct TT_HdmxEntryRec_ 1.336 + { 1.337 + FT_Byte ppem; 1.338 + FT_Byte max_width; 1.339 + FT_Byte* widths; 1.340 + 1.341 + } TT_HdmxEntryRec, *TT_HdmxEntry; 1.342 + 1.343 + 1.344 + /*************************************************************************/ 1.345 + /* */ 1.346 + /* <Struct> */ 1.347 + /* TT_HdmxRec */ 1.348 + /* */ 1.349 + /* <Description> */ 1.350 + /* A structure used to model the `hdmx' table, which contains */ 1.351 + /* pre-computed widths for a set of given sizes/dimensions. */ 1.352 + /* */ 1.353 + /* <Fields> */ 1.354 + /* version :: The version number. */ 1.355 + /* */ 1.356 + /* num_records :: The number of hdmx records. */ 1.357 + /* */ 1.358 + /* records :: An array of hdmx records. */ 1.359 + /* */ 1.360 + typedef struct TT_HdmxRec_ 1.361 + { 1.362 + FT_UShort version; 1.363 + FT_Short num_records; 1.364 + TT_HdmxEntry records; 1.365 + 1.366 + } TT_HdmxRec, *TT_Hdmx; 1.367 + 1.368 + 1.369 + /*************************************************************************/ 1.370 + /* */ 1.371 + /* <Struct> */ 1.372 + /* TT_Kern0_PairRec */ 1.373 + /* */ 1.374 + /* <Description> */ 1.375 + /* A structure used to model a kerning pair for the kerning table */ 1.376 + /* format 0. The engine now loads this table if it finds one in the */ 1.377 + /* font file. */ 1.378 + /* */ 1.379 + /* <Fields> */ 1.380 + /* left :: The index of the left glyph in pair. */ 1.381 + /* */ 1.382 + /* right :: The index of the right glyph in pair. */ 1.383 + /* */ 1.384 + /* value :: The kerning distance. A positive value spaces the */ 1.385 + /* glyphs, a negative one makes them closer. */ 1.386 + /* */ 1.387 + typedef struct TT_Kern0_PairRec_ 1.388 + { 1.389 + FT_UShort left; /* index of left glyph in pair */ 1.390 + FT_UShort right; /* index of right glyph in pair */ 1.391 + FT_FWord value; /* kerning value */ 1.392 + 1.393 + } TT_Kern0_PairRec, *TT_Kern0_Pair; 1.394 + 1.395 +#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ 1.396 + 1.397 + 1.398 + /*************************************************************************/ 1.399 + /*************************************************************************/ 1.400 + /*************************************************************************/ 1.401 + /*** ***/ 1.402 + /*** ***/ 1.403 + /*** EMBEDDED BITMAPS SUPPORT ***/ 1.404 + /*** ***/ 1.405 + /*** ***/ 1.406 + /*************************************************************************/ 1.407 + /*************************************************************************/ 1.408 + /*************************************************************************/ 1.409 + 1.410 + 1.411 + /*************************************************************************/ 1.412 + /* */ 1.413 + /* <Struct> */ 1.414 + /* TT_SBit_MetricsRec */ 1.415 + /* */ 1.416 + /* <Description> */ 1.417 + /* A structure used to hold the big metrics of a given glyph bitmap */ 1.418 + /* in a TrueType or OpenType font. These are usually found in the */ 1.419 + /* `EBDT' (Microsoft) or `bloc' (Apple) table. */ 1.420 + /* */ 1.421 + /* <Fields> */ 1.422 + /* height :: The glyph height in pixels. */ 1.423 + /* */ 1.424 + /* width :: The glyph width in pixels. */ 1.425 + /* */ 1.426 + /* horiBearingX :: The horizontal left bearing. */ 1.427 + /* */ 1.428 + /* horiBearingY :: The horizontal top bearing. */ 1.429 + /* */ 1.430 + /* horiAdvance :: The horizontal advance. */ 1.431 + /* */ 1.432 + /* vertBearingX :: The vertical left bearing. */ 1.433 + /* */ 1.434 + /* vertBearingY :: The vertical top bearing. */ 1.435 + /* */ 1.436 + /* vertAdvance :: The vertical advance. */ 1.437 + /* */ 1.438 + typedef struct TT_SBit_MetricsRec_ 1.439 + { 1.440 + FT_Byte height; 1.441 + FT_Byte width; 1.442 + 1.443 + FT_Char horiBearingX; 1.444 + FT_Char horiBearingY; 1.445 + FT_Byte horiAdvance; 1.446 + 1.447 + FT_Char vertBearingX; 1.448 + FT_Char vertBearingY; 1.449 + FT_Byte vertAdvance; 1.450 + 1.451 + } TT_SBit_MetricsRec, *TT_SBit_Metrics; 1.452 + 1.453 + 1.454 + /*************************************************************************/ 1.455 + /* */ 1.456 + /* <Struct> */ 1.457 + /* TT_SBit_SmallMetricsRec */ 1.458 + /* */ 1.459 + /* <Description> */ 1.460 + /* A structure used to hold the small metrics of a given glyph bitmap */ 1.461 + /* in a TrueType or OpenType font. These are usually found in the */ 1.462 + /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */ 1.463 + /* */ 1.464 + /* <Fields> */ 1.465 + /* height :: The glyph height in pixels. */ 1.466 + /* */ 1.467 + /* width :: The glyph width in pixels. */ 1.468 + /* */ 1.469 + /* bearingX :: The left-side bearing. */ 1.470 + /* */ 1.471 + /* bearingY :: The top-side bearing. */ 1.472 + /* */ 1.473 + /* advance :: The advance width or height. */ 1.474 + /* */ 1.475 + typedef struct TT_SBit_Small_Metrics_ 1.476 + { 1.477 + FT_Byte height; 1.478 + FT_Byte width; 1.479 + 1.480 + FT_Char bearingX; 1.481 + FT_Char bearingY; 1.482 + FT_Byte advance; 1.483 + 1.484 + } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics; 1.485 + 1.486 + 1.487 + /*************************************************************************/ 1.488 + /* */ 1.489 + /* <Struct> */ 1.490 + /* TT_SBit_LineMetricsRec */ 1.491 + /* */ 1.492 + /* <Description> */ 1.493 + /* A structure used to describe the text line metrics of a given */ 1.494 + /* bitmap strike, for either a horizontal or vertical layout. */ 1.495 + /* */ 1.496 + /* <Fields> */ 1.497 + /* ascender :: The ascender in pixels. */ 1.498 + /* */ 1.499 + /* descender :: The descender in pixels. */ 1.500 + /* */ 1.501 + /* max_width :: The maximum glyph width in pixels. */ 1.502 + /* */ 1.503 + /* caret_slope_enumerator :: Rise of the caret slope, typically set */ 1.504 + /* to 1 for non-italic fonts. */ 1.505 + /* */ 1.506 + /* caret_slope_denominator :: Rise of the caret slope, typically set */ 1.507 + /* to 0 for non-italic fonts. */ 1.508 + /* */ 1.509 + /* caret_offset :: Offset in pixels to move the caret for */ 1.510 + /* proper positioning. */ 1.511 + /* */ 1.512 + /* min_origin_SB :: Minimum of horiBearingX (resp. */ 1.513 + /* vertBearingY). */ 1.514 + /* min_advance_SB :: Minimum of */ 1.515 + /* */ 1.516 + /* horizontal advance - */ 1.517 + /* ( horiBearingX + width ) */ 1.518 + /* */ 1.519 + /* resp. */ 1.520 + /* */ 1.521 + /* vertical advance - */ 1.522 + /* ( vertBearingY + height ) */ 1.523 + /* */ 1.524 + /* max_before_BL :: Maximum of horiBearingY (resp. */ 1.525 + /* vertBearingY). */ 1.526 + /* */ 1.527 + /* min_after_BL :: Minimum of */ 1.528 + /* */ 1.529 + /* horiBearingY - height */ 1.530 + /* */ 1.531 + /* resp. */ 1.532 + /* */ 1.533 + /* vertBearingX - width */ 1.534 + /* */ 1.535 + /* pads :: Unused (to make the size of the record */ 1.536 + /* a multiple of 32 bits. */ 1.537 + /* */ 1.538 + typedef struct TT_SBit_LineMetricsRec_ 1.539 + { 1.540 + FT_Char ascender; 1.541 + FT_Char descender; 1.542 + FT_Byte max_width; 1.543 + FT_Char caret_slope_numerator; 1.544 + FT_Char caret_slope_denominator; 1.545 + FT_Char caret_offset; 1.546 + FT_Char min_origin_SB; 1.547 + FT_Char min_advance_SB; 1.548 + FT_Char max_before_BL; 1.549 + FT_Char min_after_BL; 1.550 + FT_Char pads[2]; 1.551 + 1.552 + } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics; 1.553 + 1.554 + 1.555 + /*************************************************************************/ 1.556 + /* */ 1.557 + /* <Struct> */ 1.558 + /* TT_SBit_RangeRec */ 1.559 + /* */ 1.560 + /* <Description> */ 1.561 + /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */ 1.562 + /* (Microsoft) or `bloc' (Apple) tables. */ 1.563 + /* */ 1.564 + /* <Fields> */ 1.565 + /* first_glyph :: The first glyph index in the range. */ 1.566 + /* */ 1.567 + /* last_glyph :: The last glyph index in the range. */ 1.568 + /* */ 1.569 + /* index_format :: The format of index table. Valid values are 1 */ 1.570 + /* to 5. */ 1.571 + /* */ 1.572 + /* image_format :: The format of `EBDT' image data. */ 1.573 + /* */ 1.574 + /* image_offset :: The offset to image data in `EBDT'. */ 1.575 + /* */ 1.576 + /* image_size :: For index formats 2 and 5. This is the size in */ 1.577 + /* bytes of each glyph bitmap. */ 1.578 + /* */ 1.579 + /* big_metrics :: For index formats 2 and 5. This is the big */ 1.580 + /* metrics for each glyph bitmap. */ 1.581 + /* */ 1.582 + /* num_glyphs :: For index formats 4 and 5. This is the number of */ 1.583 + /* glyphs in the code array. */ 1.584 + /* */ 1.585 + /* glyph_offsets :: For index formats 1 and 3. */ 1.586 + /* */ 1.587 + /* glyph_codes :: For index formats 4 and 5. */ 1.588 + /* */ 1.589 + /* table_offset :: The offset of the index table in the `EBLC' */ 1.590 + /* table. Only used during strike loading. */ 1.591 + /* */ 1.592 + typedef struct TT_SBit_RangeRec_ 1.593 + { 1.594 + FT_UShort first_glyph; 1.595 + FT_UShort last_glyph; 1.596 + 1.597 + FT_UShort index_format; 1.598 + FT_UShort image_format; 1.599 + FT_ULong image_offset; 1.600 + 1.601 + FT_ULong image_size; 1.602 + TT_SBit_MetricsRec metrics; 1.603 + FT_ULong num_glyphs; 1.604 + 1.605 + FT_ULong* glyph_offsets; 1.606 + FT_UShort* glyph_codes; 1.607 + 1.608 + FT_ULong table_offset; 1.609 + 1.610 + } TT_SBit_RangeRec, *TT_SBit_Range; 1.611 + 1.612 + 1.613 + /*************************************************************************/ 1.614 + /* */ 1.615 + /* <Struct> */ 1.616 + /* TT_SBit_StrikeRec */ 1.617 + /* */ 1.618 + /* <Description> */ 1.619 + /* A structure used describe a given bitmap strike in the `EBLC' */ 1.620 + /* (Microsoft) or `bloc' (Apple) tables. */ 1.621 + /* */ 1.622 + /* <Fields> */ 1.623 + /* num_index_ranges :: The number of index ranges. */ 1.624 + /* */ 1.625 + /* index_ranges :: An array of glyph index ranges. */ 1.626 + /* */ 1.627 + /* color_ref :: Unused. `color_ref' is put in for future */ 1.628 + /* enhancements, but these fields are already */ 1.629 + /* in use by other platforms (e.g. Newton). */ 1.630 + /* For details, please see */ 1.631 + /* */ 1.632 + /* http://fonts.apple.com/ */ 1.633 + /* TTRefMan/RM06/Chap6bloc.html */ 1.634 + /* */ 1.635 + /* hori :: The line metrics for horizontal layouts. */ 1.636 + /* */ 1.637 + /* vert :: The line metrics for vertical layouts. */ 1.638 + /* */ 1.639 + /* start_glyph :: The lowest glyph index for this strike. */ 1.640 + /* */ 1.641 + /* end_glyph :: The highest glyph index for this strike. */ 1.642 + /* */ 1.643 + /* x_ppem :: The number of horizontal pixels per EM. */ 1.644 + /* */ 1.645 + /* y_ppem :: The number of vertical pixels per EM. */ 1.646 + /* */ 1.647 + /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */ 1.648 + /* and 8. */ 1.649 + /* */ 1.650 + /* flags :: Is this a vertical or horizontal strike? For */ 1.651 + /* details, please see */ 1.652 + /* */ 1.653 + /* http://fonts.apple.com/ */ 1.654 + /* TTRefMan/RM06/Chap6bloc.html */ 1.655 + /* */ 1.656 + typedef struct TT_SBit_StrikeRec_ 1.657 + { 1.658 + FT_Int num_ranges; 1.659 + TT_SBit_Range sbit_ranges; 1.660 + FT_ULong ranges_offset; 1.661 + 1.662 + FT_ULong color_ref; 1.663 + 1.664 + TT_SBit_LineMetricsRec hori; 1.665 + TT_SBit_LineMetricsRec vert; 1.666 + 1.667 + FT_UShort start_glyph; 1.668 + FT_UShort end_glyph; 1.669 + 1.670 + FT_Byte x_ppem; 1.671 + FT_Byte y_ppem; 1.672 + 1.673 + FT_Byte bit_depth; 1.674 + FT_Char flags; 1.675 + 1.676 + } TT_SBit_StrikeRec, *TT_SBit_Strike; 1.677 + 1.678 + 1.679 + /*************************************************************************/ 1.680 + /* */ 1.681 + /* <Struct> */ 1.682 + /* TT_SBit_ComponentRec */ 1.683 + /* */ 1.684 + /* <Description> */ 1.685 + /* A simple structure to describe a compound sbit element. */ 1.686 + /* */ 1.687 + /* <Fields> */ 1.688 + /* glyph_code :: The element's glyph index. */ 1.689 + /* */ 1.690 + /* x_offset :: The element's left bearing. */ 1.691 + /* */ 1.692 + /* y_offset :: The element's top bearing. */ 1.693 + /* */ 1.694 + typedef struct TT_SBit_ComponentRec_ 1.695 + { 1.696 + FT_UShort glyph_code; 1.697 + FT_Char x_offset; 1.698 + FT_Char y_offset; 1.699 + 1.700 + } TT_SBit_ComponentRec, *TT_SBit_Component; 1.701 + 1.702 + 1.703 + /*************************************************************************/ 1.704 + /* */ 1.705 + /* <Struct> */ 1.706 + /* TT_SBit_ScaleRec */ 1.707 + /* */ 1.708 + /* <Description> */ 1.709 + /* A structure used describe a given bitmap scaling table, as defined */ 1.710 + /* in the `EBSC' table. */ 1.711 + /* */ 1.712 + /* <Fields> */ 1.713 + /* hori :: The horizontal line metrics. */ 1.714 + /* */ 1.715 + /* vert :: The vertical line metrics. */ 1.716 + /* */ 1.717 + /* x_ppem :: The number of horizontal pixels per EM. */ 1.718 + /* */ 1.719 + /* y_ppem :: The number of vertical pixels per EM. */ 1.720 + /* */ 1.721 + /* x_ppem_substitute :: Substitution x_ppem value. */ 1.722 + /* */ 1.723 + /* y_ppem_substitute :: Substitution y_ppem value. */ 1.724 + /* */ 1.725 + typedef struct TT_SBit_ScaleRec_ 1.726 + { 1.727 + TT_SBit_LineMetricsRec hori; 1.728 + TT_SBit_LineMetricsRec vert; 1.729 + 1.730 + FT_Byte x_ppem; 1.731 + FT_Byte y_ppem; 1.732 + 1.733 + FT_Byte x_ppem_substitute; 1.734 + FT_Byte y_ppem_substitute; 1.735 + 1.736 + } TT_SBit_ScaleRec, *TT_SBit_Scale; 1.737 + 1.738 + 1.739 + /*************************************************************************/ 1.740 + /*************************************************************************/ 1.741 + /*************************************************************************/ 1.742 + /*** ***/ 1.743 + /*** ***/ 1.744 + /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/ 1.745 + /*** ***/ 1.746 + /*** ***/ 1.747 + /*************************************************************************/ 1.748 + /*************************************************************************/ 1.749 + /*************************************************************************/ 1.750 + 1.751 + 1.752 + /*************************************************************************/ 1.753 + /* */ 1.754 + /* <Struct> */ 1.755 + /* TT_Post_20Rec */ 1.756 + /* */ 1.757 + /* <Description> */ 1.758 + /* Postscript names sub-table, format 2.0. Stores the PS name of */ 1.759 + /* each glyph in the font face. */ 1.760 + /* */ 1.761 + /* <Fields> */ 1.762 + /* num_glyphs :: The number of named glyphs in the table. */ 1.763 + /* */ 1.764 + /* num_names :: The number of PS names stored in the table. */ 1.765 + /* */ 1.766 + /* glyph_indices :: The indices of the glyphs in the names arrays. */ 1.767 + /* */ 1.768 + /* glyph_names :: The PS names not in Mac Encoding. */ 1.769 + /* */ 1.770 + typedef struct TT_Post_20Rec_ 1.771 + { 1.772 + FT_UShort num_glyphs; 1.773 + FT_UShort num_names; 1.774 + FT_UShort* glyph_indices; 1.775 + FT_Char** glyph_names; 1.776 + 1.777 + } TT_Post_20Rec, *TT_Post_20; 1.778 + 1.779 + 1.780 + /*************************************************************************/ 1.781 + /* */ 1.782 + /* <Struct> */ 1.783 + /* TT_Post_25Rec */ 1.784 + /* */ 1.785 + /* <Description> */ 1.786 + /* Postscript names sub-table, format 2.5. Stores the PS name of */ 1.787 + /* each glyph in the font face. */ 1.788 + /* */ 1.789 + /* <Fields> */ 1.790 + /* num_glyphs :: The number of glyphs in the table. */ 1.791 + /* */ 1.792 + /* offsets :: An array of signed offsets in a normal Mac */ 1.793 + /* Postscript name encoding. */ 1.794 + /* */ 1.795 + typedef struct TT_Post_25_ 1.796 + { 1.797 + FT_UShort num_glyphs; 1.798 + FT_Char* offsets; 1.799 + 1.800 + } TT_Post_25Rec, *TT_Post_25; 1.801 + 1.802 + 1.803 + /*************************************************************************/ 1.804 + /* */ 1.805 + /* <Struct> */ 1.806 + /* TT_Post_NamesRec */ 1.807 + /* */ 1.808 + /* <Description> */ 1.809 + /* Postscript names table, either format 2.0 or 2.5. */ 1.810 + /* */ 1.811 + /* <Fields> */ 1.812 + /* loaded :: A flag to indicate whether the PS names are loaded. */ 1.813 + /* */ 1.814 + /* format_20 :: The sub-table used for format 2.0. */ 1.815 + /* */ 1.816 + /* format_25 :: The sub-table used for format 2.5. */ 1.817 + /* */ 1.818 + typedef struct TT_Post_NamesRec_ 1.819 + { 1.820 + FT_Bool loaded; 1.821 + 1.822 + union 1.823 + { 1.824 + TT_Post_20Rec format_20; 1.825 + TT_Post_25Rec format_25; 1.826 + 1.827 + } names; 1.828 + 1.829 + } TT_Post_NamesRec, *TT_Post_Names; 1.830 + 1.831 + 1.832 + /*************************************************************************/ 1.833 + /*************************************************************************/ 1.834 + /*************************************************************************/ 1.835 + /*** ***/ 1.836 + /*** ***/ 1.837 + /*** GX VARIATION TABLE SUPPORT ***/ 1.838 + /*** ***/ 1.839 + /*** ***/ 1.840 + /*************************************************************************/ 1.841 + /*************************************************************************/ 1.842 + /*************************************************************************/ 1.843 + 1.844 + 1.845 +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 1.846 + typedef struct GX_BlendRec_ *GX_Blend; 1.847 +#endif 1.848 + 1.849 + /*************************************************************************/ 1.850 + /*************************************************************************/ 1.851 + /*************************************************************************/ 1.852 + /*** ***/ 1.853 + /*** ***/ 1.854 + /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/ 1.855 + /*** ***/ 1.856 + /*** ***/ 1.857 + /*************************************************************************/ 1.858 + /*************************************************************************/ 1.859 + /*************************************************************************/ 1.860 + 1.861 + /* 1.862 + * These types are used to support a `BDF ' table that isn't part of the 1.863 + * official TrueType specification. It is mainly used in SFNT-based 1.864 + * bitmap fonts that were generated from a set of BDF fonts. 1.865 + * 1.866 + * The format of the table is as follows. 1.867 + * 1.868 + * USHORT version `BDF ' table version number, should be 0x0001. 1.869 + * USHORT strikeCount Number of strikes (bitmap sizes) in this table. 1.870 + * ULONG stringTable Offset (from start of BDF table) to string 1.871 + * table. 1.872 + * 1.873 + * This is followed by an array of `strikeCount' descriptors, having the 1.874 + * following format. 1.875 + * 1.876 + * USHORT ppem Vertical pixels per EM for this strike. 1.877 + * USHORT numItems Number of items for this strike (properties and 1.878 + * atoms). Maximum is 255. 1.879 + * 1.880 + * This array in turn is followed by `strikeCount' value sets. Each 1.881 + * `value set' is an array of `numItems' items with the following format. 1.882 + * 1.883 + * ULONG item_name Offset in string table to item name. 1.884 + * USHORT item_type The item type. Possible values are 1.885 + * 0 => string (e.g., COMMENT) 1.886 + * 1 => atom (e.g., FONT or even SIZE) 1.887 + * 2 => int32 1.888 + * 3 => uint32 1.889 + * 0x10 => A flag to indicate a properties. This 1.890 + * is ORed with the above values. 1.891 + * ULONG item_value For strings => Offset into string table without 1.892 + * the corresponding double quotes. 1.893 + * For atoms => Offset into string table. 1.894 + * For integers => Direct value. 1.895 + * 1.896 + * All strings in the string table consist of bytes and are 1.897 + * zero-terminated. 1.898 + * 1.899 + */ 1.900 + 1.901 +#ifdef TT_CONFIG_OPTION_BDF 1.902 + 1.903 + typedef struct TT_BDFRec_ 1.904 + { 1.905 + FT_Byte* table; 1.906 + FT_Byte* table_end; 1.907 + FT_Byte* strings; 1.908 + FT_ULong strings_size; 1.909 + FT_UInt num_strikes; 1.910 + FT_Bool loaded; 1.911 + 1.912 + } TT_BDFRec, *TT_BDF; 1.913 + 1.914 +#endif /* TT_CONFIG_OPTION_BDF */ 1.915 + 1.916 + /*************************************************************************/ 1.917 + /*************************************************************************/ 1.918 + /*************************************************************************/ 1.919 + /*** ***/ 1.920 + /*** ***/ 1.921 + /*** ORIGINAL TT_FACE CLASS DEFINITION ***/ 1.922 + /*** ***/ 1.923 + /*** ***/ 1.924 + /*************************************************************************/ 1.925 + /*************************************************************************/ 1.926 + /*************************************************************************/ 1.927 + 1.928 + 1.929 + /*************************************************************************/ 1.930 + /* */ 1.931 + /* This structure/class is defined here because it is common to the */ 1.932 + /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ 1.933 + /* */ 1.934 + /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */ 1.935 + /* shared between font drivers, and are thus defined in `ttobjs.h'. */ 1.936 + /* */ 1.937 + /*************************************************************************/ 1.938 + 1.939 + 1.940 + /*************************************************************************/ 1.941 + /* */ 1.942 + /* <Type> */ 1.943 + /* TT_Face */ 1.944 + /* */ 1.945 + /* <Description> */ 1.946 + /* A handle to a TrueType face/font object. A TT_Face encapsulates */ 1.947 + /* the resolution and scaling independent parts of a TrueType font */ 1.948 + /* resource. */ 1.949 + /* */ 1.950 + /* <Note> */ 1.951 + /* The TT_Face structure is also used as a `parent class' for the */ 1.952 + /* OpenType-CFF class (T2_Face). */ 1.953 + /* */ 1.954 + typedef struct TT_FaceRec_* TT_Face; 1.955 + 1.956 + 1.957 + /* a function type used for the truetype bytecode interpreter hooks */ 1.958 + typedef FT_Error 1.959 + (*TT_Interpreter)( void* exec_context ); 1.960 + 1.961 + /* forward declaration */ 1.962 + typedef struct TT_LoaderRec_* TT_Loader; 1.963 + 1.964 + 1.965 + /*************************************************************************/ 1.966 + /* */ 1.967 + /* <FuncType> */ 1.968 + /* TT_Loader_GotoTableFunc */ 1.969 + /* */ 1.970 + /* <Description> */ 1.971 + /* Seeks a stream to the start of a given TrueType table. */ 1.972 + /* */ 1.973 + /* <Input> */ 1.974 + /* face :: A handle to the target face object. */ 1.975 + /* */ 1.976 + /* tag :: A 4-byte tag used to name the table. */ 1.977 + /* */ 1.978 + /* stream :: The input stream. */ 1.979 + /* */ 1.980 + /* <Output> */ 1.981 + /* length :: The length of the table in bytes. Set to 0 if not */ 1.982 + /* needed. */ 1.983 + /* */ 1.984 + /* <Return> */ 1.985 + /* FreeType error code. 0 means success. */ 1.986 + /* */ 1.987 + /* <Note> */ 1.988 + /* The stream cursor must be at the font file's origin. */ 1.989 + /* */ 1.990 + typedef FT_Error 1.991 + (*TT_Loader_GotoTableFunc)( TT_Face face, 1.992 + FT_ULong tag, 1.993 + FT_Stream stream, 1.994 + FT_ULong* length ); 1.995 + 1.996 + 1.997 + /*************************************************************************/ 1.998 + /* */ 1.999 + /* <FuncType> */ 1.1000 + /* TT_Loader_StartGlyphFunc */ 1.1001 + /* */ 1.1002 + /* <Description> */ 1.1003 + /* Seeks a stream to the start of a given glyph element, and opens a */ 1.1004 + /* frame for it. */ 1.1005 + /* */ 1.1006 + /* <Input> */ 1.1007 + /* loader :: The current TrueType glyph loader object. */ 1.1008 + /* */ 1.1009 + /* glyph index :: The index of the glyph to access. */ 1.1010 + /* */ 1.1011 + /* offset :: The offset of the glyph according to the */ 1.1012 + /* `locations' table. */ 1.1013 + /* */ 1.1014 + /* byte_count :: The size of the frame in bytes. */ 1.1015 + /* */ 1.1016 + /* <Return> */ 1.1017 + /* FreeType error code. 0 means success. */ 1.1018 + /* */ 1.1019 + /* <Note> */ 1.1020 + /* This function is normally equivalent to FT_STREAM_SEEK(offset) */ 1.1021 + /* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */ 1.1022 + /* but alternative formats (e.g. compressed ones) might use something */ 1.1023 + /* different. */ 1.1024 + /* */ 1.1025 + typedef FT_Error 1.1026 + (*TT_Loader_StartGlyphFunc)( TT_Loader loader, 1.1027 + FT_UInt glyph_index, 1.1028 + FT_ULong offset, 1.1029 + FT_UInt byte_count ); 1.1030 + 1.1031 + 1.1032 + /*************************************************************************/ 1.1033 + /* */ 1.1034 + /* <FuncType> */ 1.1035 + /* TT_Loader_ReadGlyphFunc */ 1.1036 + /* */ 1.1037 + /* <Description> */ 1.1038 + /* Reads one glyph element (its header, a simple glyph, or a */ 1.1039 + /* composite) from the loader's current stream frame. */ 1.1040 + /* */ 1.1041 + /* <Input> */ 1.1042 + /* loader :: The current TrueType glyph loader object. */ 1.1043 + /* */ 1.1044 + /* <Return> */ 1.1045 + /* FreeType error code. 0 means success. */ 1.1046 + /* */ 1.1047 + typedef FT_Error 1.1048 + (*TT_Loader_ReadGlyphFunc)( TT_Loader loader ); 1.1049 + 1.1050 + 1.1051 + /*************************************************************************/ 1.1052 + /* */ 1.1053 + /* <FuncType> */ 1.1054 + /* TT_Loader_EndGlyphFunc */ 1.1055 + /* */ 1.1056 + /* <Description> */ 1.1057 + /* Closes the current loader stream frame for the glyph. */ 1.1058 + /* */ 1.1059 + /* <Input> */ 1.1060 + /* loader :: The current TrueType glyph loader object. */ 1.1061 + /* */ 1.1062 + typedef void 1.1063 + (*TT_Loader_EndGlyphFunc)( TT_Loader loader ); 1.1064 + 1.1065 + 1.1066 + /*************************************************************************/ 1.1067 + /* */ 1.1068 + /* TrueType Face Type */ 1.1069 + /* */ 1.1070 + /* <Struct> */ 1.1071 + /* TT_Face */ 1.1072 + /* */ 1.1073 + /* <Description> */ 1.1074 + /* The TrueType face class. These objects model the resolution and */ 1.1075 + /* point-size independent data found in a TrueType font file. */ 1.1076 + /* */ 1.1077 + /* <Fields> */ 1.1078 + /* root :: The base FT_Face structure, managed by the */ 1.1079 + /* base layer. */ 1.1080 + /* */ 1.1081 + /* ttc_header :: The TrueType collection header, used when */ 1.1082 + /* the file is a `ttc' rather than a `ttf'. */ 1.1083 + /* For ordinary font files, the field */ 1.1084 + /* `ttc_header.count' is set to 0. */ 1.1085 + /* */ 1.1086 + /* format_tag :: The font format tag. */ 1.1087 + /* */ 1.1088 + /* num_tables :: The number of TrueType tables in this font */ 1.1089 + /* file. */ 1.1090 + /* */ 1.1091 + /* dir_tables :: The directory of TrueType tables for this */ 1.1092 + /* font file. */ 1.1093 + /* */ 1.1094 + /* header :: The font's font header (`head' table). */ 1.1095 + /* Read on font opening. */ 1.1096 + /* */ 1.1097 + /* horizontal :: The font's horizontal header (`hhea' */ 1.1098 + /* table). This field also contains the */ 1.1099 + /* associated horizontal metrics table */ 1.1100 + /* (`hmtx'). */ 1.1101 + /* */ 1.1102 + /* max_profile :: The font's maximum profile table. Read on */ 1.1103 + /* font opening. Note that some maximum */ 1.1104 + /* values cannot be taken directly from this */ 1.1105 + /* table. We thus define additional fields */ 1.1106 + /* below to hold the computed maxima. */ 1.1107 + /* */ 1.1108 + /* vertical_info :: A boolean which is set when the font file */ 1.1109 + /* contains vertical metrics. If not, the */ 1.1110 + /* value of the `vertical' field is */ 1.1111 + /* undefined. */ 1.1112 + /* */ 1.1113 + /* vertical :: The font's vertical header (`vhea' table). */ 1.1114 + /* This field also contains the associated */ 1.1115 + /* vertical metrics table (`vmtx'), if found. */ 1.1116 + /* IMPORTANT: The contents of this field is */ 1.1117 + /* undefined if the `verticalInfo' field is */ 1.1118 + /* unset. */ 1.1119 + /* */ 1.1120 + /* num_names :: The number of name records within this */ 1.1121 + /* TrueType font. */ 1.1122 + /* */ 1.1123 + /* name_table :: The table of name records (`name'). */ 1.1124 + /* */ 1.1125 + /* os2 :: The font's OS/2 table (`OS/2'). */ 1.1126 + /* */ 1.1127 + /* postscript :: The font's PostScript table (`post' */ 1.1128 + /* table). The PostScript glyph names are */ 1.1129 + /* not loaded by the driver on face opening. */ 1.1130 + /* See the `ttpost' module for more details. */ 1.1131 + /* */ 1.1132 + /* cmap_table :: Address of the face's `cmap' SFNT table */ 1.1133 + /* in memory (it's an extracted frame). */ 1.1134 + /* */ 1.1135 + /* cmap_size :: The size in bytes of the `cmap_table' */ 1.1136 + /* described above. */ 1.1137 + /* */ 1.1138 + /* goto_table :: A function called by each TrueType table */ 1.1139 + /* loader to position a stream's cursor to */ 1.1140 + /* the start of a given table according to */ 1.1141 + /* its tag. It defaults to TT_Goto_Face but */ 1.1142 + /* can be different for strange formats (e.g. */ 1.1143 + /* Type 42). */ 1.1144 + /* */ 1.1145 + /* access_glyph_frame :: A function used to access the frame of a */ 1.1146 + /* given glyph within the face's font file. */ 1.1147 + /* */ 1.1148 + /* forget_glyph_frame :: A function used to forget the frame of a */ 1.1149 + /* given glyph when all data has been loaded. */ 1.1150 + /* */ 1.1151 + /* read_glyph_header :: A function used to read a glyph header. */ 1.1152 + /* It must be called between an `access' and */ 1.1153 + /* `forget'. */ 1.1154 + /* */ 1.1155 + /* read_simple_glyph :: A function used to read a simple glyph. */ 1.1156 + /* It must be called after the header was */ 1.1157 + /* read, and before the `forget'. */ 1.1158 + /* */ 1.1159 + /* read_composite_glyph :: A function used to read a composite glyph. */ 1.1160 + /* It must be called after the header was */ 1.1161 + /* read, and before the `forget'. */ 1.1162 + /* */ 1.1163 + /* sfnt :: A pointer to the SFNT service. */ 1.1164 + /* */ 1.1165 + /* psnames :: A pointer to the PostScript names service. */ 1.1166 + /* */ 1.1167 + /* hdmx :: The face's horizontal device metrics */ 1.1168 + /* (`hdmx' table). This table is optional in */ 1.1169 + /* TrueType/OpenType fonts. */ 1.1170 + /* */ 1.1171 + /* gasp :: The grid-fitting and scaling properties */ 1.1172 + /* table (`gasp'). This table is optional in */ 1.1173 + /* TrueType/OpenType fonts. */ 1.1174 + /* */ 1.1175 + /* pclt :: The `pclt' SFNT table. */ 1.1176 + /* */ 1.1177 + /* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */ 1.1178 + /* sizes, embedded in this font. */ 1.1179 + /* */ 1.1180 + /* sbit_strikes :: An array of sbit strikes embedded in this */ 1.1181 + /* font. This table is optional in a */ 1.1182 + /* TrueType/OpenType font. */ 1.1183 + /* */ 1.1184 + /* num_sbit_scales :: The number of sbit scales for this font. */ 1.1185 + /* */ 1.1186 + /* sbit_scales :: Array of sbit scales embedded in this */ 1.1187 + /* font. This table is optional in a */ 1.1188 + /* TrueType/OpenType font. */ 1.1189 + /* */ 1.1190 + /* postscript_names :: A table used to store the Postscript names */ 1.1191 + /* of the glyphs for this font. See the */ 1.1192 + /* file `ttconfig.h' for comments on the */ 1.1193 + /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */ 1.1194 + /* */ 1.1195 + /* num_locations :: The number of glyph locations in this */ 1.1196 + /* TrueType file. This should be */ 1.1197 + /* identical to the number of glyphs. */ 1.1198 + /* Ignored for Type 2 fonts. */ 1.1199 + /* */ 1.1200 + /* glyph_locations :: An array of longs. These are offsets to */ 1.1201 + /* glyph data within the `glyf' table. */ 1.1202 + /* Ignored for Type 2 font faces. */ 1.1203 + /* */ 1.1204 + /* glyf_len :: The length of the `glyf' table. Needed */ 1.1205 + /* for malformed `loca' tables. */ 1.1206 + /* */ 1.1207 + /* font_program_size :: Size in bytecodes of the face's font */ 1.1208 + /* program. 0 if none defined. Ignored for */ 1.1209 + /* Type 2 fonts. */ 1.1210 + /* */ 1.1211 + /* font_program :: The face's font program (bytecode stream) */ 1.1212 + /* executed at load time, also used during */ 1.1213 + /* glyph rendering. Comes from the `fpgm' */ 1.1214 + /* table. Ignored for Type 2 font fonts. */ 1.1215 + /* */ 1.1216 + /* cvt_program_size :: The size in bytecodes of the face's cvt */ 1.1217 + /* program. Ignored for Type 2 fonts. */ 1.1218 + /* */ 1.1219 + /* cvt_program :: The face's cvt program (bytecode stream) */ 1.1220 + /* executed each time an instance/size is */ 1.1221 + /* changed/reset. Comes from the `prep' */ 1.1222 + /* table. Ignored for Type 2 fonts. */ 1.1223 + /* */ 1.1224 + /* cvt_size :: Size of the control value table (in */ 1.1225 + /* entries). Ignored for Type 2 fonts. */ 1.1226 + /* */ 1.1227 + /* cvt :: The face's original control value table. */ 1.1228 + /* Coordinates are expressed in unscaled font */ 1.1229 + /* units. Comes from the `cvt ' table. */ 1.1230 + /* Ignored for Type 2 fonts. */ 1.1231 + /* */ 1.1232 + /* num_kern_pairs :: The number of kerning pairs present in the */ 1.1233 + /* font file. The engine only loads the */ 1.1234 + /* first horizontal format 0 kern table it */ 1.1235 + /* finds in the font file. Ignored for */ 1.1236 + /* Type 2 fonts. */ 1.1237 + /* */ 1.1238 + /* kern_table_index :: The index of the kerning table in the font */ 1.1239 + /* kerning directory. Ignored for Type 2 */ 1.1240 + /* fonts. */ 1.1241 + /* */ 1.1242 + /* interpreter :: A pointer to the TrueType bytecode */ 1.1243 + /* interpreters field is also used to hook */ 1.1244 + /* the debugger in `ttdebug'. */ 1.1245 + /* */ 1.1246 + /* unpatented_hinting :: If true, use only unpatented methods in */ 1.1247 + /* the bytecode interpreter. */ 1.1248 + /* */ 1.1249 + /* doblend :: A boolean which is set if the font should */ 1.1250 + /* be blended (this is for GX var). */ 1.1251 + /* */ 1.1252 + /* blend :: Contains the data needed to control GX */ 1.1253 + /* variation tables (rather like Multiple */ 1.1254 + /* Master data). */ 1.1255 + /* */ 1.1256 + /* extra :: Reserved for third-party font drivers. */ 1.1257 + /* */ 1.1258 + /* postscript_name :: The PS name of the font. Used by the */ 1.1259 + /* postscript name service. */ 1.1260 + /* */ 1.1261 + typedef struct TT_FaceRec_ 1.1262 + { 1.1263 + FT_FaceRec root; 1.1264 + 1.1265 + TTC_HeaderRec ttc_header; 1.1266 + 1.1267 + FT_ULong format_tag; 1.1268 + FT_UShort num_tables; 1.1269 + TT_Table dir_tables; 1.1270 + 1.1271 + TT_Header header; /* TrueType header table */ 1.1272 + TT_HoriHeader horizontal; /* TrueType horizontal header */ 1.1273 + 1.1274 + TT_MaxProfile max_profile; 1.1275 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.1276 + FT_ULong max_components; /* stubbed to 0 */ 1.1277 +#endif 1.1278 + 1.1279 + FT_Bool vertical_info; 1.1280 + TT_VertHeader vertical; /* TT Vertical header, if present */ 1.1281 + 1.1282 + FT_UShort num_names; /* number of name records */ 1.1283 + TT_NameTableRec name_table; /* name table */ 1.1284 + 1.1285 + TT_OS2 os2; /* TrueType OS/2 table */ 1.1286 + TT_Postscript postscript; /* TrueType Postscript table */ 1.1287 + 1.1288 + FT_Byte* cmap_table; /* extracted `cmap' table */ 1.1289 + FT_ULong cmap_size; 1.1290 + 1.1291 + TT_Loader_GotoTableFunc goto_table; 1.1292 + 1.1293 + TT_Loader_StartGlyphFunc access_glyph_frame; 1.1294 + TT_Loader_EndGlyphFunc forget_glyph_frame; 1.1295 + TT_Loader_ReadGlyphFunc read_glyph_header; 1.1296 + TT_Loader_ReadGlyphFunc read_simple_glyph; 1.1297 + TT_Loader_ReadGlyphFunc read_composite_glyph; 1.1298 + 1.1299 + /* a typeless pointer to the SFNT_Interface table used to load */ 1.1300 + /* the basic TrueType tables in the face object */ 1.1301 + void* sfnt; 1.1302 + 1.1303 + /* a typeless pointer to the FT_Service_PsCMapsRec table used to */ 1.1304 + /* handle glyph names <-> unicode & Mac values */ 1.1305 + void* psnames; 1.1306 + 1.1307 + 1.1308 + /***********************************************************************/ 1.1309 + /* */ 1.1310 + /* Optional TrueType/OpenType tables */ 1.1311 + /* */ 1.1312 + /***********************************************************************/ 1.1313 + 1.1314 + /* horizontal device metrics */ 1.1315 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.1316 + TT_HdmxRec hdmx; 1.1317 +#endif 1.1318 + 1.1319 + /* grid-fitting and scaling table */ 1.1320 + TT_GaspRec gasp; /* the `gasp' table */ 1.1321 + 1.1322 + /* PCL 5 table */ 1.1323 + TT_PCLT pclt; 1.1324 + 1.1325 + /* embedded bitmaps support */ 1.1326 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.1327 + FT_ULong num_sbit_strikes; 1.1328 + TT_SBit_Strike sbit_strikes; 1.1329 +#endif 1.1330 + 1.1331 + FT_ULong num_sbit_scales; 1.1332 + TT_SBit_Scale sbit_scales; 1.1333 + 1.1334 + /* postscript names table */ 1.1335 + TT_Post_NamesRec postscript_names; 1.1336 + 1.1337 + 1.1338 + /***********************************************************************/ 1.1339 + /* */ 1.1340 + /* TrueType-specific fields (ignored by the OTF-Type2 driver) */ 1.1341 + /* */ 1.1342 + /***********************************************************************/ 1.1343 + 1.1344 + /* the glyph locations */ 1.1345 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.1346 + FT_UShort num_locations_stub; 1.1347 + FT_Long* glyph_locations_stub; 1.1348 +#endif 1.1349 + 1.1350 + /* the font program, if any */ 1.1351 + FT_ULong font_program_size; 1.1352 + FT_Byte* font_program; 1.1353 + 1.1354 + /* the cvt program, if any */ 1.1355 + FT_ULong cvt_program_size; 1.1356 + FT_Byte* cvt_program; 1.1357 + 1.1358 + /* the original, unscaled, control value table */ 1.1359 + FT_ULong cvt_size; 1.1360 + FT_Short* cvt; 1.1361 + 1.1362 +#ifdef FT_CONFIG_OPTION_OLD_INTERNALS 1.1363 + /* the format 0 kerning table, if any */ 1.1364 + FT_Int num_kern_pairs; 1.1365 + FT_Int kern_table_index; 1.1366 + TT_Kern0_Pair kern_pairs; 1.1367 +#endif 1.1368 + 1.1369 + /* A pointer to the bytecode interpreter to use. This is also */ 1.1370 + /* used to hook the debugger for the `ttdebug' utility. */ 1.1371 + TT_Interpreter interpreter; 1.1372 + 1.1373 +#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING 1.1374 + /* Use unpatented hinting only. */ 1.1375 + FT_Bool unpatented_hinting; 1.1376 +#endif 1.1377 + 1.1378 + /***********************************************************************/ 1.1379 + /* */ 1.1380 + /* Other tables or fields. This is used by derivative formats like */ 1.1381 + /* OpenType. */ 1.1382 + /* */ 1.1383 + /***********************************************************************/ 1.1384 + 1.1385 + FT_Generic extra; 1.1386 + 1.1387 + const char* postscript_name; 1.1388 + 1.1389 + /* since version 2.1.8, but was originally placed after */ 1.1390 + /* `glyph_locations_stub' */ 1.1391 + FT_ULong glyf_len; 1.1392 + 1.1393 + /* since version 2.1.8, but was originally placed before `extra' */ 1.1394 +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 1.1395 + FT_Bool doblend; 1.1396 + GX_Blend blend; 1.1397 +#endif 1.1398 + 1.1399 + /* since version 2.2 */ 1.1400 + 1.1401 + FT_Byte* horz_metrics; 1.1402 + FT_ULong horz_metrics_size; 1.1403 + 1.1404 + FT_Byte* vert_metrics; 1.1405 + FT_ULong vert_metrics_size; 1.1406 + 1.1407 + FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */ 1.1408 + FT_Byte* glyph_locations; 1.1409 + 1.1410 + FT_Byte* hdmx_table; 1.1411 + FT_ULong hdmx_table_size; 1.1412 + FT_UInt hdmx_record_count; 1.1413 + FT_ULong hdmx_record_size; 1.1414 + FT_Byte* hdmx_record_sizes; 1.1415 + 1.1416 + FT_Byte* sbit_table; 1.1417 + FT_ULong sbit_table_size; 1.1418 + FT_UInt sbit_num_strikes; 1.1419 + 1.1420 + FT_Byte* kern_table; 1.1421 + FT_ULong kern_table_size; 1.1422 + FT_UInt num_kern_tables; 1.1423 + FT_UInt32 kern_avail_bits; 1.1424 + FT_UInt32 kern_order_bits; 1.1425 + 1.1426 +#ifdef TT_CONFIG_OPTION_BDF 1.1427 + TT_BDFRec bdf; 1.1428 +#endif /* TT_CONFIG_OPTION_BDF */ 1.1429 + 1.1430 + /* since 2.3.0 */ 1.1431 + FT_ULong horz_metrics_offset; 1.1432 + FT_ULong vert_metrics_offset; 1.1433 + 1.1434 + } TT_FaceRec; 1.1435 + 1.1436 + 1.1437 + /*************************************************************************/ 1.1438 + /* */ 1.1439 + /* <Struct> */ 1.1440 + /* TT_GlyphZoneRec */ 1.1441 + /* */ 1.1442 + /* <Description> */ 1.1443 + /* A glyph zone is used to load, scale and hint glyph outline */ 1.1444 + /* coordinates. */ 1.1445 + /* */ 1.1446 + /* <Fields> */ 1.1447 + /* memory :: A handle to the memory manager. */ 1.1448 + /* */ 1.1449 + /* max_points :: The maximal size in points of the zone. */ 1.1450 + /* */ 1.1451 + /* max_contours :: Max size in links contours of the zone. */ 1.1452 + /* */ 1.1453 + /* n_points :: The current number of points in the zone. */ 1.1454 + /* */ 1.1455 + /* n_contours :: The current number of contours in the zone. */ 1.1456 + /* */ 1.1457 + /* org :: The original glyph coordinates (font */ 1.1458 + /* units/scaled). */ 1.1459 + /* */ 1.1460 + /* cur :: The current glyph coordinates (scaled/hinted). */ 1.1461 + /* */ 1.1462 + /* tags :: The point control tags. */ 1.1463 + /* */ 1.1464 + /* contours :: The contours end points. */ 1.1465 + /* */ 1.1466 + /* first_point :: Offset of the current subglyph's first point. */ 1.1467 + /* */ 1.1468 + typedef struct TT_GlyphZoneRec_ 1.1469 + { 1.1470 + FT_Memory memory; 1.1471 + FT_UShort max_points; 1.1472 + FT_UShort max_contours; 1.1473 + FT_UShort n_points; /* number of points in zone */ 1.1474 + FT_Short n_contours; /* number of contours */ 1.1475 + 1.1476 + FT_Vector* org; /* original point coordinates */ 1.1477 + FT_Vector* cur; /* current point coordinates */ 1.1478 + FT_Vector* orus; /* original (unscaled) point coordinates */ 1.1479 + 1.1480 + FT_Byte* tags; /* current touch flags */ 1.1481 + FT_UShort* contours; /* contour end points */ 1.1482 + 1.1483 + FT_UShort first_point; /* offset of first (#0) point */ 1.1484 + 1.1485 + } TT_GlyphZoneRec, *TT_GlyphZone; 1.1486 + 1.1487 + 1.1488 + /* handle to execution context */ 1.1489 + typedef struct TT_ExecContextRec_* TT_ExecContext; 1.1490 + 1.1491 + /* glyph loader structure */ 1.1492 + typedef struct TT_LoaderRec_ 1.1493 + { 1.1494 + FT_Face face; 1.1495 + FT_Size size; 1.1496 + FT_GlyphSlot glyph; 1.1497 + FT_GlyphLoader gloader; 1.1498 + 1.1499 + FT_ULong load_flags; 1.1500 + FT_UInt glyph_index; 1.1501 + 1.1502 + FT_Stream stream; 1.1503 + FT_Int byte_len; 1.1504 + 1.1505 + FT_Short n_contours; 1.1506 + FT_BBox bbox; 1.1507 + FT_Int left_bearing; 1.1508 + FT_Int advance; 1.1509 + FT_Int linear; 1.1510 + FT_Bool linear_def; 1.1511 + FT_Bool preserve_pps; 1.1512 + FT_Vector pp1; 1.1513 + FT_Vector pp2; 1.1514 + 1.1515 + FT_ULong glyf_offset; 1.1516 + 1.1517 + /* the zone where we load our glyphs */ 1.1518 + TT_GlyphZoneRec base; 1.1519 + TT_GlyphZoneRec zone; 1.1520 + 1.1521 + TT_ExecContext exec; 1.1522 + FT_Byte* instructions; 1.1523 + FT_ULong ins_pos; 1.1524 + 1.1525 + /* for possible extensibility in other formats */ 1.1526 + void* other; 1.1527 + 1.1528 + /* since version 2.1.8 */ 1.1529 + FT_Int top_bearing; 1.1530 + FT_Int vadvance; 1.1531 + FT_Vector pp3; 1.1532 + FT_Vector pp4; 1.1533 + 1.1534 + /* since version 2.2.1 */ 1.1535 + FT_Byte* cursor; 1.1536 + FT_Byte* limit; 1.1537 + 1.1538 + } TT_LoaderRec; 1.1539 + 1.1540 + 1.1541 +FT_END_HEADER 1.1542 + 1.1543 +#endif /* __TTTYPES_H__ */ 1.1544 + 1.1545 + 1.1546 +/* END */