vrshoot
diff libs/ft2static/freetype/tttables.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/tttables.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,759 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* tttables.h */ 1.7 +/* */ 1.8 +/* Basic SFNT/TrueType tables definitions and interface */ 1.9 +/* (specification only). */ 1.10 +/* */ 1.11 +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010 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 __TTTABLES_H__ 1.24 +#define __TTTABLES_H__ 1.25 + 1.26 + 1.27 +#include <ft2build.h> 1.28 +#include FT_FREETYPE_H 1.29 + 1.30 +#ifdef FREETYPE_H 1.31 +#error "freetype.h of FreeType 1 has been loaded!" 1.32 +#error "Please fix the directory search order for header files" 1.33 +#error "so that freetype.h of FreeType 2 is found first." 1.34 +#endif 1.35 + 1.36 + 1.37 +FT_BEGIN_HEADER 1.38 + 1.39 + /*************************************************************************/ 1.40 + /* */ 1.41 + /* <Section> */ 1.42 + /* truetype_tables */ 1.43 + /* */ 1.44 + /* <Title> */ 1.45 + /* TrueType Tables */ 1.46 + /* */ 1.47 + /* <Abstract> */ 1.48 + /* TrueType specific table types and functions. */ 1.49 + /* */ 1.50 + /* <Description> */ 1.51 + /* This section contains the definition of TrueType-specific tables */ 1.52 + /* as well as some routines used to access and process them. */ 1.53 + /* */ 1.54 + /*************************************************************************/ 1.55 + 1.56 + 1.57 + /*************************************************************************/ 1.58 + /* */ 1.59 + /* <Struct> */ 1.60 + /* TT_Header */ 1.61 + /* */ 1.62 + /* <Description> */ 1.63 + /* A structure used to model a TrueType font header table. All */ 1.64 + /* fields follow the TrueType specification. */ 1.65 + /* */ 1.66 + typedef struct TT_Header_ 1.67 + { 1.68 + FT_Fixed Table_Version; 1.69 + FT_Fixed Font_Revision; 1.70 + 1.71 + FT_Long CheckSum_Adjust; 1.72 + FT_Long Magic_Number; 1.73 + 1.74 + FT_UShort Flags; 1.75 + FT_UShort Units_Per_EM; 1.76 + 1.77 + FT_Long Created [2]; 1.78 + FT_Long Modified[2]; 1.79 + 1.80 + FT_Short xMin; 1.81 + FT_Short yMin; 1.82 + FT_Short xMax; 1.83 + FT_Short yMax; 1.84 + 1.85 + FT_UShort Mac_Style; 1.86 + FT_UShort Lowest_Rec_PPEM; 1.87 + 1.88 + FT_Short Font_Direction; 1.89 + FT_Short Index_To_Loc_Format; 1.90 + FT_Short Glyph_Data_Format; 1.91 + 1.92 + } TT_Header; 1.93 + 1.94 + 1.95 + /*************************************************************************/ 1.96 + /* */ 1.97 + /* <Struct> */ 1.98 + /* TT_HoriHeader */ 1.99 + /* */ 1.100 + /* <Description> */ 1.101 + /* A structure used to model a TrueType horizontal header, the `hhea' */ 1.102 + /* table, as well as the corresponding horizontal metrics table, */ 1.103 + /* i.e., the `hmtx' table. */ 1.104 + /* */ 1.105 + /* <Fields> */ 1.106 + /* Version :: The table version. */ 1.107 + /* */ 1.108 + /* Ascender :: The font's ascender, i.e., the distance */ 1.109 + /* from the baseline to the top-most of all */ 1.110 + /* glyph points found in the font. */ 1.111 + /* */ 1.112 + /* This value is invalid in many fonts, as */ 1.113 + /* it is usually set by the font designer, */ 1.114 + /* and often reflects only a portion of the */ 1.115 + /* glyphs found in the font (maybe ASCII). */ 1.116 + /* */ 1.117 + /* You should use the `sTypoAscender' field */ 1.118 + /* of the OS/2 table instead if you want */ 1.119 + /* the correct one. */ 1.120 + /* */ 1.121 + /* Descender :: The font's descender, i.e., the distance */ 1.122 + /* from the baseline to the bottom-most of */ 1.123 + /* all glyph points found in the font. It */ 1.124 + /* is negative. */ 1.125 + /* */ 1.126 + /* This value is invalid in many fonts, as */ 1.127 + /* it is usually set by the font designer, */ 1.128 + /* and often reflects only a portion of the */ 1.129 + /* glyphs found in the font (maybe ASCII). */ 1.130 + /* */ 1.131 + /* You should use the `sTypoDescender' */ 1.132 + /* field of the OS/2 table instead if you */ 1.133 + /* want the correct one. */ 1.134 + /* */ 1.135 + /* Line_Gap :: The font's line gap, i.e., the distance */ 1.136 + /* to add to the ascender and descender to */ 1.137 + /* get the BTB, i.e., the */ 1.138 + /* baseline-to-baseline distance for the */ 1.139 + /* font. */ 1.140 + /* */ 1.141 + /* advance_Width_Max :: This field is the maximum of all advance */ 1.142 + /* widths found in the font. It can be */ 1.143 + /* used to compute the maximum width of an */ 1.144 + /* arbitrary string of text. */ 1.145 + /* */ 1.146 + /* min_Left_Side_Bearing :: The minimum left side bearing of all */ 1.147 + /* glyphs within the font. */ 1.148 + /* */ 1.149 + /* min_Right_Side_Bearing :: The minimum right side bearing of all */ 1.150 + /* glyphs within the font. */ 1.151 + /* */ 1.152 + /* xMax_Extent :: The maximum horizontal extent (i.e., the */ 1.153 + /* `width' of a glyph's bounding box) for */ 1.154 + /* all glyphs in the font. */ 1.155 + /* */ 1.156 + /* caret_Slope_Rise :: The rise coefficient of the cursor's */ 1.157 + /* slope of the cursor (slope=rise/run). */ 1.158 + /* */ 1.159 + /* caret_Slope_Run :: The run coefficient of the cursor's */ 1.160 + /* slope. */ 1.161 + /* */ 1.162 + /* Reserved :: 8~reserved bytes. */ 1.163 + /* */ 1.164 + /* metric_Data_Format :: Always~0. */ 1.165 + /* */ 1.166 + /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ 1.167 + /* table -- this value can be smaller than */ 1.168 + /* the total number of glyphs in the font. */ 1.169 + /* */ 1.170 + /* long_metrics :: A pointer into the `hmtx' table. */ 1.171 + /* */ 1.172 + /* short_metrics :: A pointer into the `hmtx' table. */ 1.173 + /* */ 1.174 + /* <Note> */ 1.175 + /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ 1.176 + /* be identical except for the names of their fields which */ 1.177 + /* are different. */ 1.178 + /* */ 1.179 + /* This ensures that a single function in the `ttload' */ 1.180 + /* module is able to read both the horizontal and vertical */ 1.181 + /* headers. */ 1.182 + /* */ 1.183 + typedef struct TT_HoriHeader_ 1.184 + { 1.185 + FT_Fixed Version; 1.186 + FT_Short Ascender; 1.187 + FT_Short Descender; 1.188 + FT_Short Line_Gap; 1.189 + 1.190 + FT_UShort advance_Width_Max; /* advance width maximum */ 1.191 + 1.192 + FT_Short min_Left_Side_Bearing; /* minimum left-sb */ 1.193 + FT_Short min_Right_Side_Bearing; /* minimum right-sb */ 1.194 + FT_Short xMax_Extent; /* xmax extents */ 1.195 + FT_Short caret_Slope_Rise; 1.196 + FT_Short caret_Slope_Run; 1.197 + FT_Short caret_Offset; 1.198 + 1.199 + FT_Short Reserved[4]; 1.200 + 1.201 + FT_Short metric_Data_Format; 1.202 + FT_UShort number_Of_HMetrics; 1.203 + 1.204 + /* The following fields are not defined by the TrueType specification */ 1.205 + /* but they are used to connect the metrics header to the relevant */ 1.206 + /* `HMTX' table. */ 1.207 + 1.208 + void* long_metrics; 1.209 + void* short_metrics; 1.210 + 1.211 + } TT_HoriHeader; 1.212 + 1.213 + 1.214 + /*************************************************************************/ 1.215 + /* */ 1.216 + /* <Struct> */ 1.217 + /* TT_VertHeader */ 1.218 + /* */ 1.219 + /* <Description> */ 1.220 + /* A structure used to model a TrueType vertical header, the `vhea' */ 1.221 + /* table, as well as the corresponding vertical metrics table, i.e., */ 1.222 + /* the `vmtx' table. */ 1.223 + /* */ 1.224 + /* <Fields> */ 1.225 + /* Version :: The table version. */ 1.226 + /* */ 1.227 + /* Ascender :: The font's ascender, i.e., the distance */ 1.228 + /* from the baseline to the top-most of */ 1.229 + /* all glyph points found in the font. */ 1.230 + /* */ 1.231 + /* This value is invalid in many fonts, as */ 1.232 + /* it is usually set by the font designer, */ 1.233 + /* and often reflects only a portion of */ 1.234 + /* the glyphs found in the font (maybe */ 1.235 + /* ASCII). */ 1.236 + /* */ 1.237 + /* You should use the `sTypoAscender' */ 1.238 + /* field of the OS/2 table instead if you */ 1.239 + /* want the correct one. */ 1.240 + /* */ 1.241 + /* Descender :: The font's descender, i.e., the */ 1.242 + /* distance from the baseline to the */ 1.243 + /* bottom-most of all glyph points found */ 1.244 + /* in the font. It is negative. */ 1.245 + /* */ 1.246 + /* This value is invalid in many fonts, as */ 1.247 + /* it is usually set by the font designer, */ 1.248 + /* and often reflects only a portion of */ 1.249 + /* the glyphs found in the font (maybe */ 1.250 + /* ASCII). */ 1.251 + /* */ 1.252 + /* You should use the `sTypoDescender' */ 1.253 + /* field of the OS/2 table instead if you */ 1.254 + /* want the correct one. */ 1.255 + /* */ 1.256 + /* Line_Gap :: The font's line gap, i.e., the distance */ 1.257 + /* to add to the ascender and descender to */ 1.258 + /* get the BTB, i.e., the */ 1.259 + /* baseline-to-baseline distance for the */ 1.260 + /* font. */ 1.261 + /* */ 1.262 + /* advance_Height_Max :: This field is the maximum of all */ 1.263 + /* advance heights found in the font. It */ 1.264 + /* can be used to compute the maximum */ 1.265 + /* height of an arbitrary string of text. */ 1.266 + /* */ 1.267 + /* min_Top_Side_Bearing :: The minimum top side bearing of all */ 1.268 + /* glyphs within the font. */ 1.269 + /* */ 1.270 + /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ 1.271 + /* glyphs within the font. */ 1.272 + /* */ 1.273 + /* yMax_Extent :: The maximum vertical extent (i.e., the */ 1.274 + /* `height' of a glyph's bounding box) for */ 1.275 + /* all glyphs in the font. */ 1.276 + /* */ 1.277 + /* caret_Slope_Rise :: The rise coefficient of the cursor's */ 1.278 + /* slope of the cursor (slope=rise/run). */ 1.279 + /* */ 1.280 + /* caret_Slope_Run :: The run coefficient of the cursor's */ 1.281 + /* slope. */ 1.282 + /* */ 1.283 + /* caret_Offset :: The cursor's offset for slanted fonts. */ 1.284 + /* This value is `reserved' in vmtx */ 1.285 + /* version 1.0. */ 1.286 + /* */ 1.287 + /* Reserved :: 8~reserved bytes. */ 1.288 + /* */ 1.289 + /* metric_Data_Format :: Always~0. */ 1.290 + /* */ 1.291 + /* number_Of_HMetrics :: Number of VMetrics entries in the */ 1.292 + /* `vmtx' table -- this value can be */ 1.293 + /* smaller than the total number of glyphs */ 1.294 + /* in the font. */ 1.295 + /* */ 1.296 + /* long_metrics :: A pointer into the `vmtx' table. */ 1.297 + /* */ 1.298 + /* short_metrics :: A pointer into the `vmtx' table. */ 1.299 + /* */ 1.300 + /* <Note> */ 1.301 + /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ 1.302 + /* be identical except for the names of their fields which */ 1.303 + /* are different. */ 1.304 + /* */ 1.305 + /* This ensures that a single function in the `ttload' */ 1.306 + /* module is able to read both the horizontal and vertical */ 1.307 + /* headers. */ 1.308 + /* */ 1.309 + typedef struct TT_VertHeader_ 1.310 + { 1.311 + FT_Fixed Version; 1.312 + FT_Short Ascender; 1.313 + FT_Short Descender; 1.314 + FT_Short Line_Gap; 1.315 + 1.316 + FT_UShort advance_Height_Max; /* advance height maximum */ 1.317 + 1.318 + FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */ 1.319 + FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ 1.320 + FT_Short yMax_Extent; /* xmax or ymax extents */ 1.321 + FT_Short caret_Slope_Rise; 1.322 + FT_Short caret_Slope_Run; 1.323 + FT_Short caret_Offset; 1.324 + 1.325 + FT_Short Reserved[4]; 1.326 + 1.327 + FT_Short metric_Data_Format; 1.328 + FT_UShort number_Of_VMetrics; 1.329 + 1.330 + /* The following fields are not defined by the TrueType specification */ 1.331 + /* but they're used to connect the metrics header to the relevant */ 1.332 + /* `HMTX' or `VMTX' table. */ 1.333 + 1.334 + void* long_metrics; 1.335 + void* short_metrics; 1.336 + 1.337 + } TT_VertHeader; 1.338 + 1.339 + 1.340 + /*************************************************************************/ 1.341 + /* */ 1.342 + /* <Struct> */ 1.343 + /* TT_OS2 */ 1.344 + /* */ 1.345 + /* <Description> */ 1.346 + /* A structure used to model a TrueType OS/2 table. This is the long */ 1.347 + /* table version. All fields comply to the TrueType specification. */ 1.348 + /* */ 1.349 + /* Note that we now support old Mac fonts which do not include an */ 1.350 + /* OS/2 table. In this case, the `version' field is always set to */ 1.351 + /* 0xFFFF. */ 1.352 + /* */ 1.353 + typedef struct TT_OS2_ 1.354 + { 1.355 + FT_UShort version; /* 0x0001 - more or 0xFFFF */ 1.356 + FT_Short xAvgCharWidth; 1.357 + FT_UShort usWeightClass; 1.358 + FT_UShort usWidthClass; 1.359 + FT_Short fsType; 1.360 + FT_Short ySubscriptXSize; 1.361 + FT_Short ySubscriptYSize; 1.362 + FT_Short ySubscriptXOffset; 1.363 + FT_Short ySubscriptYOffset; 1.364 + FT_Short ySuperscriptXSize; 1.365 + FT_Short ySuperscriptYSize; 1.366 + FT_Short ySuperscriptXOffset; 1.367 + FT_Short ySuperscriptYOffset; 1.368 + FT_Short yStrikeoutSize; 1.369 + FT_Short yStrikeoutPosition; 1.370 + FT_Short sFamilyClass; 1.371 + 1.372 + FT_Byte panose[10]; 1.373 + 1.374 + FT_ULong ulUnicodeRange1; /* Bits 0-31 */ 1.375 + FT_ULong ulUnicodeRange2; /* Bits 32-63 */ 1.376 + FT_ULong ulUnicodeRange3; /* Bits 64-95 */ 1.377 + FT_ULong ulUnicodeRange4; /* Bits 96-127 */ 1.378 + 1.379 + FT_Char achVendID[4]; 1.380 + 1.381 + FT_UShort fsSelection; 1.382 + FT_UShort usFirstCharIndex; 1.383 + FT_UShort usLastCharIndex; 1.384 + FT_Short sTypoAscender; 1.385 + FT_Short sTypoDescender; 1.386 + FT_Short sTypoLineGap; 1.387 + FT_UShort usWinAscent; 1.388 + FT_UShort usWinDescent; 1.389 + 1.390 + /* only version 1 tables: */ 1.391 + 1.392 + FT_ULong ulCodePageRange1; /* Bits 0-31 */ 1.393 + FT_ULong ulCodePageRange2; /* Bits 32-63 */ 1.394 + 1.395 + /* only version 2 tables: */ 1.396 + 1.397 + FT_Short sxHeight; 1.398 + FT_Short sCapHeight; 1.399 + FT_UShort usDefaultChar; 1.400 + FT_UShort usBreakChar; 1.401 + FT_UShort usMaxContext; 1.402 + 1.403 + } TT_OS2; 1.404 + 1.405 + 1.406 + /*************************************************************************/ 1.407 + /* */ 1.408 + /* <Struct> */ 1.409 + /* TT_Postscript */ 1.410 + /* */ 1.411 + /* <Description> */ 1.412 + /* A structure used to model a TrueType PostScript table. All fields */ 1.413 + /* comply to the TrueType specification. This structure does not */ 1.414 + /* reference the PostScript glyph names, which can be nevertheless */ 1.415 + /* accessed with the `ttpost' module. */ 1.416 + /* */ 1.417 + typedef struct TT_Postscript_ 1.418 + { 1.419 + FT_Fixed FormatType; 1.420 + FT_Fixed italicAngle; 1.421 + FT_Short underlinePosition; 1.422 + FT_Short underlineThickness; 1.423 + FT_ULong isFixedPitch; 1.424 + FT_ULong minMemType42; 1.425 + FT_ULong maxMemType42; 1.426 + FT_ULong minMemType1; 1.427 + FT_ULong maxMemType1; 1.428 + 1.429 + /* Glyph names follow in the file, but we don't */ 1.430 + /* load them by default. See the ttpost.c file. */ 1.431 + 1.432 + } TT_Postscript; 1.433 + 1.434 + 1.435 + /*************************************************************************/ 1.436 + /* */ 1.437 + /* <Struct> */ 1.438 + /* TT_PCLT */ 1.439 + /* */ 1.440 + /* <Description> */ 1.441 + /* A structure used to model a TrueType PCLT table. All fields */ 1.442 + /* comply to the TrueType specification. */ 1.443 + /* */ 1.444 + typedef struct TT_PCLT_ 1.445 + { 1.446 + FT_Fixed Version; 1.447 + FT_ULong FontNumber; 1.448 + FT_UShort Pitch; 1.449 + FT_UShort xHeight; 1.450 + FT_UShort Style; 1.451 + FT_UShort TypeFamily; 1.452 + FT_UShort CapHeight; 1.453 + FT_UShort SymbolSet; 1.454 + FT_Char TypeFace[16]; 1.455 + FT_Char CharacterComplement[8]; 1.456 + FT_Char FileName[6]; 1.457 + FT_Char StrokeWeight; 1.458 + FT_Char WidthType; 1.459 + FT_Byte SerifStyle; 1.460 + FT_Byte Reserved; 1.461 + 1.462 + } TT_PCLT; 1.463 + 1.464 + 1.465 + /*************************************************************************/ 1.466 + /* */ 1.467 + /* <Struct> */ 1.468 + /* TT_MaxProfile */ 1.469 + /* */ 1.470 + /* <Description> */ 1.471 + /* The maximum profile is a table containing many max values which */ 1.472 + /* can be used to pre-allocate arrays. This ensures that no memory */ 1.473 + /* allocation occurs during a glyph load. */ 1.474 + /* */ 1.475 + /* <Fields> */ 1.476 + /* version :: The version number. */ 1.477 + /* */ 1.478 + /* numGlyphs :: The number of glyphs in this TrueType */ 1.479 + /* font. */ 1.480 + /* */ 1.481 + /* maxPoints :: The maximum number of points in a */ 1.482 + /* non-composite TrueType glyph. See also */ 1.483 + /* the structure element */ 1.484 + /* `maxCompositePoints'. */ 1.485 + /* */ 1.486 + /* maxContours :: The maximum number of contours in a */ 1.487 + /* non-composite TrueType glyph. See also */ 1.488 + /* the structure element */ 1.489 + /* `maxCompositeContours'. */ 1.490 + /* */ 1.491 + /* maxCompositePoints :: The maximum number of points in a */ 1.492 + /* composite TrueType glyph. See also the */ 1.493 + /* structure element `maxPoints'. */ 1.494 + /* */ 1.495 + /* maxCompositeContours :: The maximum number of contours in a */ 1.496 + /* composite TrueType glyph. See also the */ 1.497 + /* structure element `maxContours'. */ 1.498 + /* */ 1.499 + /* maxZones :: The maximum number of zones used for */ 1.500 + /* glyph hinting. */ 1.501 + /* */ 1.502 + /* maxTwilightPoints :: The maximum number of points in the */ 1.503 + /* twilight zone used for glyph hinting. */ 1.504 + /* */ 1.505 + /* maxStorage :: The maximum number of elements in the */ 1.506 + /* storage area used for glyph hinting. */ 1.507 + /* */ 1.508 + /* maxFunctionDefs :: The maximum number of function */ 1.509 + /* definitions in the TrueType bytecode for */ 1.510 + /* this font. */ 1.511 + /* */ 1.512 + /* maxInstructionDefs :: The maximum number of instruction */ 1.513 + /* definitions in the TrueType bytecode for */ 1.514 + /* this font. */ 1.515 + /* */ 1.516 + /* maxStackElements :: The maximum number of stack elements used */ 1.517 + /* during bytecode interpretation. */ 1.518 + /* */ 1.519 + /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ 1.520 + /* used for glyph hinting. */ 1.521 + /* */ 1.522 + /* maxComponentElements :: The maximum number of simple (i.e., non- */ 1.523 + /* composite) glyphs in a composite glyph. */ 1.524 + /* */ 1.525 + /* maxComponentDepth :: The maximum nesting depth of composite */ 1.526 + /* glyphs. */ 1.527 + /* */ 1.528 + /* <Note> */ 1.529 + /* This structure is only used during font loading. */ 1.530 + /* */ 1.531 + typedef struct TT_MaxProfile_ 1.532 + { 1.533 + FT_Fixed version; 1.534 + FT_UShort numGlyphs; 1.535 + FT_UShort maxPoints; 1.536 + FT_UShort maxContours; 1.537 + FT_UShort maxCompositePoints; 1.538 + FT_UShort maxCompositeContours; 1.539 + FT_UShort maxZones; 1.540 + FT_UShort maxTwilightPoints; 1.541 + FT_UShort maxStorage; 1.542 + FT_UShort maxFunctionDefs; 1.543 + FT_UShort maxInstructionDefs; 1.544 + FT_UShort maxStackElements; 1.545 + FT_UShort maxSizeOfInstructions; 1.546 + FT_UShort maxComponentElements; 1.547 + FT_UShort maxComponentDepth; 1.548 + 1.549 + } TT_MaxProfile; 1.550 + 1.551 + 1.552 + /*************************************************************************/ 1.553 + /* */ 1.554 + /* <Enum> */ 1.555 + /* FT_Sfnt_Tag */ 1.556 + /* */ 1.557 + /* <Description> */ 1.558 + /* An enumeration used to specify the index of an SFNT table. */ 1.559 + /* Used in the @FT_Get_Sfnt_Table API function. */ 1.560 + /* */ 1.561 + typedef enum FT_Sfnt_Tag_ 1.562 + { 1.563 + ft_sfnt_head = 0, /* TT_Header */ 1.564 + ft_sfnt_maxp = 1, /* TT_MaxProfile */ 1.565 + ft_sfnt_os2 = 2, /* TT_OS2 */ 1.566 + ft_sfnt_hhea = 3, /* TT_HoriHeader */ 1.567 + ft_sfnt_vhea = 4, /* TT_VertHeader */ 1.568 + ft_sfnt_post = 5, /* TT_Postscript */ 1.569 + ft_sfnt_pclt = 6, /* TT_PCLT */ 1.570 + 1.571 + sfnt_max /* internal end mark */ 1.572 + 1.573 + } FT_Sfnt_Tag; 1.574 + 1.575 + /* */ 1.576 + 1.577 + 1.578 + /*************************************************************************/ 1.579 + /* */ 1.580 + /* <Function> */ 1.581 + /* FT_Get_Sfnt_Table */ 1.582 + /* */ 1.583 + /* <Description> */ 1.584 + /* Return a pointer to a given SFNT table within a face. */ 1.585 + /* */ 1.586 + /* <Input> */ 1.587 + /* face :: A handle to the source. */ 1.588 + /* */ 1.589 + /* tag :: The index of the SFNT table. */ 1.590 + /* */ 1.591 + /* <Return> */ 1.592 + /* A type-less pointer to the table. This will be~0 in case of */ 1.593 + /* error, or if the corresponding table was not found *OR* loaded */ 1.594 + /* from the file. */ 1.595 + /* */ 1.596 + /* Use a typecast according to `tag' to access the structure */ 1.597 + /* elements. */ 1.598 + /* */ 1.599 + /* <Note> */ 1.600 + /* The table is owned by the face object and disappears with it. */ 1.601 + /* */ 1.602 + /* This function is only useful to access SFNT tables that are loaded */ 1.603 + /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ 1.604 + /* a list. */ 1.605 + /* */ 1.606 + FT_EXPORT( void* ) 1.607 + FT_Get_Sfnt_Table( FT_Face face, 1.608 + FT_Sfnt_Tag tag ); 1.609 + 1.610 + 1.611 + /************************************************************************** 1.612 + * 1.613 + * @function: 1.614 + * FT_Load_Sfnt_Table 1.615 + * 1.616 + * @description: 1.617 + * Load any font table into client memory. 1.618 + * 1.619 + * @input: 1.620 + * face :: 1.621 + * A handle to the source face. 1.622 + * 1.623 + * tag :: 1.624 + * The four-byte tag of the table to load. Use the value~0 if you want 1.625 + * to access the whole font file. Otherwise, you can use one of the 1.626 + * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new 1.627 + * one with @FT_MAKE_TAG. 1.628 + * 1.629 + * offset :: 1.630 + * The starting offset in the table (or file if tag == 0). 1.631 + * 1.632 + * @output: 1.633 + * buffer :: 1.634 + * The target buffer address. The client must ensure that the memory 1.635 + * array is big enough to hold the data. 1.636 + * 1.637 + * @inout: 1.638 + * length :: 1.639 + * If the `length' parameter is NULL, then try to load the whole table. 1.640 + * Return an error code if it fails. 1.641 + * 1.642 + * Else, if `*length' is~0, exit immediately while returning the 1.643 + * table's (or file) full size in it. 1.644 + * 1.645 + * Else the number of bytes to read from the table or file, from the 1.646 + * starting offset. 1.647 + * 1.648 + * @return: 1.649 + * FreeType error code. 0~means success. 1.650 + * 1.651 + * @note: 1.652 + * If you need to determine the table's length you should first call this 1.653 + * function with `*length' set to~0, as in the following example: 1.654 + * 1.655 + * { 1.656 + * FT_ULong length = 0; 1.657 + * 1.658 + * 1.659 + * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); 1.660 + * if ( error ) { ... table does not exist ... } 1.661 + * 1.662 + * buffer = malloc( length ); 1.663 + * if ( buffer == NULL ) { ... not enough memory ... } 1.664 + * 1.665 + * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); 1.666 + * if ( error ) { ... could not load table ... } 1.667 + * } 1.668 + */ 1.669 + FT_EXPORT( FT_Error ) 1.670 + FT_Load_Sfnt_Table( FT_Face face, 1.671 + FT_ULong tag, 1.672 + FT_Long offset, 1.673 + FT_Byte* buffer, 1.674 + FT_ULong* length ); 1.675 + 1.676 + 1.677 + /************************************************************************** 1.678 + * 1.679 + * @function: 1.680 + * FT_Sfnt_Table_Info 1.681 + * 1.682 + * @description: 1.683 + * Return information on an SFNT table. 1.684 + * 1.685 + * @input: 1.686 + * face :: 1.687 + * A handle to the source face. 1.688 + * 1.689 + * table_index :: 1.690 + * The index of an SFNT table. The function returns 1.691 + * FT_Err_Table_Missing for an invalid value. 1.692 + * 1.693 + * @output: 1.694 + * tag :: 1.695 + * The name tag of the SFNT table. 1.696 + * 1.697 + * length :: 1.698 + * The length of the SFNT table. 1.699 + * 1.700 + * @return: 1.701 + * FreeType error code. 0~means success. 1.702 + * 1.703 + * @note: 1.704 + * SFNT tables with length zero are treated as missing. 1.705 + * 1.706 + */ 1.707 + FT_EXPORT( FT_Error ) 1.708 + FT_Sfnt_Table_Info( FT_Face face, 1.709 + FT_UInt table_index, 1.710 + FT_ULong *tag, 1.711 + FT_ULong *length ); 1.712 + 1.713 + 1.714 + /*************************************************************************/ 1.715 + /* */ 1.716 + /* <Function> */ 1.717 + /* FT_Get_CMap_Language_ID */ 1.718 + /* */ 1.719 + /* <Description> */ 1.720 + /* Return TrueType/sfnt specific cmap language ID. Definitions of */ 1.721 + /* language ID values are in `freetype/ttnameid.h'. */ 1.722 + /* */ 1.723 + /* <Input> */ 1.724 + /* charmap :: */ 1.725 + /* The target charmap. */ 1.726 + /* */ 1.727 + /* <Return> */ 1.728 + /* The language ID of `charmap'. If `charmap' doesn't belong to a */ 1.729 + /* TrueType/sfnt face, just return~0 as the default value. */ 1.730 + /* */ 1.731 + FT_EXPORT( FT_ULong ) 1.732 + FT_Get_CMap_Language_ID( FT_CharMap charmap ); 1.733 + 1.734 + 1.735 + /*************************************************************************/ 1.736 + /* */ 1.737 + /* <Function> */ 1.738 + /* FT_Get_CMap_Format */ 1.739 + /* */ 1.740 + /* <Description> */ 1.741 + /* Return TrueType/sfnt specific cmap format. */ 1.742 + /* */ 1.743 + /* <Input> */ 1.744 + /* charmap :: */ 1.745 + /* The target charmap. */ 1.746 + /* */ 1.747 + /* <Return> */ 1.748 + /* The format of `charmap'. If `charmap' doesn't belong to a */ 1.749 + /* TrueType/sfnt face, return -1. */ 1.750 + /* */ 1.751 + FT_EXPORT( FT_Long ) 1.752 + FT_Get_CMap_Format( FT_CharMap charmap ); 1.753 + 1.754 + /* */ 1.755 + 1.756 + 1.757 +FT_END_HEADER 1.758 + 1.759 +#endif /* __TTTABLES_H__ */ 1.760 + 1.761 + 1.762 +/* END */