00001 /***************************************************************************/ 00002 /* */ 00003 /* tttables.h */ 00004 /* */ 00005 /* Basic SFNT/TrueType tables definitions and interface */ 00006 /* (specification only). */ 00007 /* */ 00008 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 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 __TTTABLES_H__ 00021 #define __TTTABLES_H__ 00022 00023 00024 #include <ft2build.h> 00025 #include FT_FREETYPE_H 00026 00027 #ifdef FREETYPE_H 00028 #error "freetype.h of FreeType 1 has been loaded!" 00029 #error "Please fix the directory search order for header files" 00030 #error "so that freetype.h of FreeType 2 is found first." 00031 #endif 00032 00033 00034 FT_BEGIN_HEADER 00035 00036 /*************************************************************************/ 00037 /* */ 00038 /* <Section> */ 00039 /* truetype_tables */ 00040 /* */ 00041 /* <Title> */ 00042 /* TrueType Tables */ 00043 /* */ 00044 /* <Abstract> */ 00045 /* TrueType specific table types and functions. */ 00046 /* */ 00047 /* <Description> */ 00048 /* This section contains the definition of TrueType-specific tables */ 00049 /* as well as some routines used to access and process them. */ 00050 /* */ 00051 /*************************************************************************/ 00052 00053 00054 /*************************************************************************/ 00055 /* */ 00056 /* <Struct> */ 00057 /* TT_Header */ 00058 /* */ 00059 /* <Description> */ 00060 /* A structure used to model a TrueType font header table. All */ 00061 /* fields follow the TrueType specification. */ 00062 /* */ 00063 typedef struct TT_Header_ 00064 { 00065 FT_Fixed Table_Version; 00066 FT_Fixed Font_Revision; 00067 00068 FT_Long CheckSum_Adjust; 00069 FT_Long Magic_Number; 00070 00071 FT_UShort Flags; 00072 FT_UShort Units_Per_EM; 00073 00074 FT_Long Created [2]; 00075 FT_Long Modified[2]; 00076 00077 FT_Short xMin; 00078 FT_Short yMin; 00079 FT_Short xMax; 00080 FT_Short yMax; 00081 00082 FT_UShort Mac_Style; 00083 FT_UShort Lowest_Rec_PPEM; 00084 00085 FT_Short Font_Direction; 00086 FT_Short Index_To_Loc_Format; 00087 FT_Short Glyph_Data_Format; 00088 00089 } TT_Header; 00090 00091 00092 /*************************************************************************/ 00093 /* */ 00094 /* <Struct> */ 00095 /* TT_HoriHeader */ 00096 /* */ 00097 /* <Description> */ 00098 /* A structure used to model a TrueType horizontal header, the `hhea' */ 00099 /* table, as well as the corresponding horizontal metrics table, */ 00100 /* i.e., the `hmtx' table. */ 00101 /* */ 00102 /* <Fields> */ 00103 /* Version :: The table version. */ 00104 /* */ 00105 /* Ascender :: The font's ascender, i.e., the distance */ 00106 /* from the baseline to the top-most of all */ 00107 /* glyph points found in the font. */ 00108 /* */ 00109 /* This value is invalid in many fonts, as */ 00110 /* it is usually set by the font designer, */ 00111 /* and often reflects only a portion of the */ 00112 /* glyphs found in the font (maybe ASCII). */ 00113 /* */ 00114 /* You should use the `sTypoAscender' field */ 00115 /* of the OS/2 table instead if you want */ 00116 /* the correct one. */ 00117 /* */ 00118 /* Descender :: The font's descender, i.e., the distance */ 00119 /* from the baseline to the bottom-most of */ 00120 /* all glyph points found in the font. It */ 00121 /* is negative. */ 00122 /* */ 00123 /* This value is invalid in many fonts, as */ 00124 /* it is usually set by the font designer, */ 00125 /* and often reflects only a portion of the */ 00126 /* glyphs found in the font (maybe ASCII). */ 00127 /* */ 00128 /* You should use the `sTypoDescender' */ 00129 /* field of the OS/2 table instead if you */ 00130 /* want the correct one. */ 00131 /* */ 00132 /* Line_Gap :: The font's line gap, i.e., the distance */ 00133 /* to add to the ascender and descender to */ 00134 /* get the BTB, i.e., the */ 00135 /* baseline-to-baseline distance for the */ 00136 /* font. */ 00137 /* */ 00138 /* advance_Width_Max :: This field is the maximum of all advance */ 00139 /* widths found in the font. It can be */ 00140 /* used to compute the maximum width of an */ 00141 /* arbitrary string of text. */ 00142 /* */ 00143 /* min_Left_Side_Bearing :: The minimum left side bearing of all */ 00144 /* glyphs within the font. */ 00145 /* */ 00146 /* min_Right_Side_Bearing :: The minimum right side bearing of all */ 00147 /* glyphs within the font. */ 00148 /* */ 00149 /* xMax_Extent :: The maximum horizontal extent (i.e., the */ 00150 /* `width' of a glyph's bounding box) for */ 00151 /* all glyphs in the font. */ 00152 /* */ 00153 /* caret_Slope_Rise :: The rise coefficient of the cursor's */ 00154 /* slope of the cursor (slope=rise/run). */ 00155 /* */ 00156 /* caret_Slope_Run :: The run coefficient of the cursor's */ 00157 /* slope. */ 00158 /* */ 00159 /* Reserved :: 8~reserved bytes. */ 00160 /* */ 00161 /* metric_Data_Format :: Always~0. */ 00162 /* */ 00163 /* number_Of_HMetrics :: Number of HMetrics entries in the `hmtx' */ 00164 /* table -- this value can be smaller than */ 00165 /* the total number of glyphs in the font. */ 00166 /* */ 00167 /* long_metrics :: A pointer into the `hmtx' table. */ 00168 /* */ 00169 /* short_metrics :: A pointer into the `hmtx' table. */ 00170 /* */ 00171 /* <Note> */ 00172 /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ 00173 /* be identical except for the names of their fields which */ 00174 /* are different. */ 00175 /* */ 00176 /* This ensures that a single function in the `ttload' */ 00177 /* module is able to read both the horizontal and vertical */ 00178 /* headers. */ 00179 /* */ 00180 typedef struct TT_HoriHeader_ 00181 { 00182 FT_Fixed Version; 00183 FT_Short Ascender; 00184 FT_Short Descender; 00185 FT_Short Line_Gap; 00186 00187 FT_UShort advance_Width_Max; /* advance width maximum */ 00188 00189 FT_Short min_Left_Side_Bearing; /* minimum left-sb */ 00190 FT_Short min_Right_Side_Bearing; /* minimum right-sb */ 00191 FT_Short xMax_Extent; /* xmax extents */ 00192 FT_Short caret_Slope_Rise; 00193 FT_Short caret_Slope_Run; 00194 FT_Short caret_Offset; 00195 00196 FT_Short Reserved[4]; 00197 00198 FT_Short metric_Data_Format; 00199 FT_UShort number_Of_HMetrics; 00200 00201 /* The following fields are not defined by the TrueType specification */ 00202 /* but they are used to connect the metrics header to the relevant */ 00203 /* `HMTX' table. */ 00204 00205 void* long_metrics; 00206 void* short_metrics; 00207 00208 } TT_HoriHeader; 00209 00210 00211 /*************************************************************************/ 00212 /* */ 00213 /* <Struct> */ 00214 /* TT_VertHeader */ 00215 /* */ 00216 /* <Description> */ 00217 /* A structure used to model a TrueType vertical header, the `vhea' */ 00218 /* table, as well as the corresponding vertical metrics table, i.e., */ 00219 /* the `vmtx' table. */ 00220 /* */ 00221 /* <Fields> */ 00222 /* Version :: The table version. */ 00223 /* */ 00224 /* Ascender :: The font's ascender, i.e., the distance */ 00225 /* from the baseline to the top-most of */ 00226 /* all glyph points found in the font. */ 00227 /* */ 00228 /* This value is invalid in many fonts, as */ 00229 /* it is usually set by the font designer, */ 00230 /* and often reflects only a portion of */ 00231 /* the glyphs found in the font (maybe */ 00232 /* ASCII). */ 00233 /* */ 00234 /* You should use the `sTypoAscender' */ 00235 /* field of the OS/2 table instead if you */ 00236 /* want the correct one. */ 00237 /* */ 00238 /* Descender :: The font's descender, i.e., the */ 00239 /* distance from the baseline to the */ 00240 /* bottom-most of all glyph points found */ 00241 /* in the font. It is negative. */ 00242 /* */ 00243 /* This value is invalid in many fonts, as */ 00244 /* it is usually set by the font designer, */ 00245 /* and often reflects only a portion of */ 00246 /* the glyphs found in the font (maybe */ 00247 /* ASCII). */ 00248 /* */ 00249 /* You should use the `sTypoDescender' */ 00250 /* field of the OS/2 table instead if you */ 00251 /* want the correct one. */ 00252 /* */ 00253 /* Line_Gap :: The font's line gap, i.e., the distance */ 00254 /* to add to the ascender and descender to */ 00255 /* get the BTB, i.e., the */ 00256 /* baseline-to-baseline distance for the */ 00257 /* font. */ 00258 /* */ 00259 /* advance_Height_Max :: This field is the maximum of all */ 00260 /* advance heights found in the font. It */ 00261 /* can be used to compute the maximum */ 00262 /* height of an arbitrary string of text. */ 00263 /* */ 00264 /* min_Top_Side_Bearing :: The minimum top side bearing of all */ 00265 /* glyphs within the font. */ 00266 /* */ 00267 /* min_Bottom_Side_Bearing :: The minimum bottom side bearing of all */ 00268 /* glyphs within the font. */ 00269 /* */ 00270 /* yMax_Extent :: The maximum vertical extent (i.e., the */ 00271 /* `height' of a glyph's bounding box) for */ 00272 /* all glyphs in the font. */ 00273 /* */ 00274 /* caret_Slope_Rise :: The rise coefficient of the cursor's */ 00275 /* slope of the cursor (slope=rise/run). */ 00276 /* */ 00277 /* caret_Slope_Run :: The run coefficient of the cursor's */ 00278 /* slope. */ 00279 /* */ 00280 /* caret_Offset :: The cursor's offset for slanted fonts. */ 00281 /* This value is `reserved' in vmtx */ 00282 /* version 1.0. */ 00283 /* */ 00284 /* Reserved :: 8~reserved bytes. */ 00285 /* */ 00286 /* metric_Data_Format :: Always~0. */ 00287 /* */ 00288 /* number_Of_HMetrics :: Number of VMetrics entries in the */ 00289 /* `vmtx' table -- this value can be */ 00290 /* smaller than the total number of glyphs */ 00291 /* in the font. */ 00292 /* */ 00293 /* long_metrics :: A pointer into the `vmtx' table. */ 00294 /* */ 00295 /* short_metrics :: A pointer into the `vmtx' table. */ 00296 /* */ 00297 /* <Note> */ 00298 /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ 00299 /* be identical except for the names of their fields which */ 00300 /* are different. */ 00301 /* */ 00302 /* This ensures that a single function in the `ttload' */ 00303 /* module is able to read both the horizontal and vertical */ 00304 /* headers. */ 00305 /* */ 00306 typedef struct TT_VertHeader_ 00307 { 00308 FT_Fixed Version; 00309 FT_Short Ascender; 00310 FT_Short Descender; 00311 FT_Short Line_Gap; 00312 00313 FT_UShort advance_Height_Max; /* advance height maximum */ 00314 00315 FT_Short min_Top_Side_Bearing; /* minimum left-sb or top-sb */ 00316 FT_Short min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb */ 00317 FT_Short yMax_Extent; /* xmax or ymax extents */ 00318 FT_Short caret_Slope_Rise; 00319 FT_Short caret_Slope_Run; 00320 FT_Short caret_Offset; 00321 00322 FT_Short Reserved[4]; 00323 00324 FT_Short metric_Data_Format; 00325 FT_UShort number_Of_VMetrics; 00326 00327 /* The following fields are not defined by the TrueType specification */ 00328 /* but they're used to connect the metrics header to the relevant */ 00329 /* `HMTX' or `VMTX' table. */ 00330 00331 void* long_metrics; 00332 void* short_metrics; 00333 00334 } TT_VertHeader; 00335 00336 00337 /*************************************************************************/ 00338 /* */ 00339 /* <Struct> */ 00340 /* TT_OS2 */ 00341 /* */ 00342 /* <Description> */ 00343 /* A structure used to model a TrueType OS/2 table. This is the long */ 00344 /* table version. All fields comply to the TrueType specification. */ 00345 /* */ 00346 /* Note that we now support old Mac fonts which do not include an */ 00347 /* OS/2 table. In this case, the `version' field is always set to */ 00348 /* 0xFFFF. */ 00349 /* */ 00350 typedef struct TT_OS2_ 00351 { 00352 FT_UShort version; /* 0x0001 - more or 0xFFFF */ 00353 FT_Short xAvgCharWidth; 00354 FT_UShort usWeightClass; 00355 FT_UShort usWidthClass; 00356 FT_Short fsType; 00357 FT_Short ySubscriptXSize; 00358 FT_Short ySubscriptYSize; 00359 FT_Short ySubscriptXOffset; 00360 FT_Short ySubscriptYOffset; 00361 FT_Short ySuperscriptXSize; 00362 FT_Short ySuperscriptYSize; 00363 FT_Short ySuperscriptXOffset; 00364 FT_Short ySuperscriptYOffset; 00365 FT_Short yStrikeoutSize; 00366 FT_Short yStrikeoutPosition; 00367 FT_Short sFamilyClass; 00368 00369 FT_Byte panose[10]; 00370 00371 FT_ULong ulUnicodeRange1; /* Bits 0-31 */ 00372 FT_ULong ulUnicodeRange2; /* Bits 32-63 */ 00373 FT_ULong ulUnicodeRange3; /* Bits 64-95 */ 00374 FT_ULong ulUnicodeRange4; /* Bits 96-127 */ 00375 00376 FT_Char achVendID[4]; 00377 00378 FT_UShort fsSelection; 00379 FT_UShort usFirstCharIndex; 00380 FT_UShort usLastCharIndex; 00381 FT_Short sTypoAscender; 00382 FT_Short sTypoDescender; 00383 FT_Short sTypoLineGap; 00384 FT_UShort usWinAscent; 00385 FT_UShort usWinDescent; 00386 00387 /* only version 1 tables: */ 00388 00389 FT_ULong ulCodePageRange1; /* Bits 0-31 */ 00390 FT_ULong ulCodePageRange2; /* Bits 32-63 */ 00391 00392 /* only version 2 tables: */ 00393 00394 FT_Short sxHeight; 00395 FT_Short sCapHeight; 00396 FT_UShort usDefaultChar; 00397 FT_UShort usBreakChar; 00398 FT_UShort usMaxContext; 00399 00400 } TT_OS2; 00401 00402 00403 /*************************************************************************/ 00404 /* */ 00405 /* <Struct> */ 00406 /* TT_Postscript */ 00407 /* */ 00408 /* <Description> */ 00409 /* A structure used to model a TrueType PostScript table. All fields */ 00410 /* comply to the TrueType specification. This structure does not */ 00411 /* reference the PostScript glyph names, which can be nevertheless */ 00412 /* accessed with the `ttpost' module. */ 00413 /* */ 00414 typedef struct TT_Postscript_ 00415 { 00416 FT_Fixed FormatType; 00417 FT_Fixed italicAngle; 00418 FT_Short underlinePosition; 00419 FT_Short underlineThickness; 00420 FT_ULong isFixedPitch; 00421 FT_ULong minMemType42; 00422 FT_ULong maxMemType42; 00423 FT_ULong minMemType1; 00424 FT_ULong maxMemType1; 00425 00426 /* Glyph names follow in the file, but we don't */ 00427 /* load them by default. See the ttpost.c file. */ 00428 00429 } TT_Postscript; 00430 00431 00432 /*************************************************************************/ 00433 /* */ 00434 /* <Struct> */ 00435 /* TT_PCLT */ 00436 /* */ 00437 /* <Description> */ 00438 /* A structure used to model a TrueType PCLT table. All fields */ 00439 /* comply to the TrueType specification. */ 00440 /* */ 00441 typedef struct TT_PCLT_ 00442 { 00443 FT_Fixed Version; 00444 FT_ULong FontNumber; 00445 FT_UShort Pitch; 00446 FT_UShort xHeight; 00447 FT_UShort Style; 00448 FT_UShort TypeFamily; 00449 FT_UShort CapHeight; 00450 FT_UShort SymbolSet; 00451 FT_Char TypeFace[16]; 00452 FT_Char CharacterComplement[8]; 00453 FT_Char FileName[6]; 00454 FT_Char StrokeWeight; 00455 FT_Char WidthType; 00456 FT_Byte SerifStyle; 00457 FT_Byte Reserved; 00458 00459 } TT_PCLT; 00460 00461 00462 /*************************************************************************/ 00463 /* */ 00464 /* <Struct> */ 00465 /* TT_MaxProfile */ 00466 /* */ 00467 /* <Description> */ 00468 /* The maximum profile is a table containing many max values which */ 00469 /* can be used to pre-allocate arrays. This ensures that no memory */ 00470 /* allocation occurs during a glyph load. */ 00471 /* */ 00472 /* <Fields> */ 00473 /* version :: The version number. */ 00474 /* */ 00475 /* numGlyphs :: The number of glyphs in this TrueType */ 00476 /* font. */ 00477 /* */ 00478 /* maxPoints :: The maximum number of points in a */ 00479 /* non-composite TrueType glyph. See also */ 00480 /* the structure element */ 00481 /* `maxCompositePoints'. */ 00482 /* */ 00483 /* maxContours :: The maximum number of contours in a */ 00484 /* non-composite TrueType glyph. See also */ 00485 /* the structure element */ 00486 /* `maxCompositeContours'. */ 00487 /* */ 00488 /* maxCompositePoints :: The maximum number of points in a */ 00489 /* composite TrueType glyph. See also the */ 00490 /* structure element `maxPoints'. */ 00491 /* */ 00492 /* maxCompositeContours :: The maximum number of contours in a */ 00493 /* composite TrueType glyph. See also the */ 00494 /* structure element `maxContours'. */ 00495 /* */ 00496 /* maxZones :: The maximum number of zones used for */ 00497 /* glyph hinting. */ 00498 /* */ 00499 /* maxTwilightPoints :: The maximum number of points in the */ 00500 /* twilight zone used for glyph hinting. */ 00501 /* */ 00502 /* maxStorage :: The maximum number of elements in the */ 00503 /* storage area used for glyph hinting. */ 00504 /* */ 00505 /* maxFunctionDefs :: The maximum number of function */ 00506 /* definitions in the TrueType bytecode for */ 00507 /* this font. */ 00508 /* */ 00509 /* maxInstructionDefs :: The maximum number of instruction */ 00510 /* definitions in the TrueType bytecode for */ 00511 /* this font. */ 00512 /* */ 00513 /* maxStackElements :: The maximum number of stack elements used */ 00514 /* during bytecode interpretation. */ 00515 /* */ 00516 /* maxSizeOfInstructions :: The maximum number of TrueType opcodes */ 00517 /* used for glyph hinting. */ 00518 /* */ 00519 /* maxComponentElements :: The maximum number of simple (i.e., non- */ 00520 /* composite) glyphs in a composite glyph. */ 00521 /* */ 00522 /* maxComponentDepth :: The maximum nesting depth of composite */ 00523 /* glyphs. */ 00524 /* */ 00525 /* <Note> */ 00526 /* This structure is only used during font loading. */ 00527 /* */ 00528 typedef struct TT_MaxProfile_ 00529 { 00530 FT_Fixed version; 00531 FT_UShort numGlyphs; 00532 FT_UShort maxPoints; 00533 FT_UShort maxContours; 00534 FT_UShort maxCompositePoints; 00535 FT_UShort maxCompositeContours; 00536 FT_UShort maxZones; 00537 FT_UShort maxTwilightPoints; 00538 FT_UShort maxStorage; 00539 FT_UShort maxFunctionDefs; 00540 FT_UShort maxInstructionDefs; 00541 FT_UShort maxStackElements; 00542 FT_UShort maxSizeOfInstructions; 00543 FT_UShort maxComponentElements; 00544 FT_UShort maxComponentDepth; 00545 00546 } TT_MaxProfile; 00547 00548 00549 /*************************************************************************/ 00550 /* */ 00551 /* <Enum> */ 00552 /* FT_Sfnt_Tag */ 00553 /* */ 00554 /* <Description> */ 00555 /* An enumeration used to specify the index of an SFNT table. */ 00556 /* Used in the @FT_Get_Sfnt_Table API function. */ 00557 /* */ 00558 typedef enum FT_Sfnt_Tag_ 00559 { 00560 ft_sfnt_head = 0, 00561 ft_sfnt_maxp = 1, 00562 ft_sfnt_os2 = 2, 00563 ft_sfnt_hhea = 3, 00564 ft_sfnt_vhea = 4, 00565 ft_sfnt_post = 5, 00566 ft_sfnt_pclt = 6, 00567 00568 sfnt_max /* internal end mark */ 00569 00570 } FT_Sfnt_Tag; 00571 00572 /* */ 00573 00574 00575 /*************************************************************************/ 00576 /* */ 00577 /* <Function> */ 00578 /* FT_Get_Sfnt_Table */ 00579 /* */ 00580 /* <Description> */ 00581 /* Return a pointer to a given SFNT table within a face. */ 00582 /* */ 00583 /* <Input> */ 00584 /* face :: A handle to the source. */ 00585 /* */ 00586 /* tag :: The index of the SFNT table. */ 00587 /* */ 00588 /* <Return> */ 00589 /* A type-less pointer to the table. This will be~0 in case of */ 00590 /* error, or if the corresponding table was not found *OR* loaded */ 00591 /* from the file. */ 00592 /* */ 00593 /* <Note> */ 00594 /* The table is owned by the face object and disappears with it. */ 00595 /* */ 00596 /* This function is only useful to access SFNT tables that are loaded */ 00597 /* by the sfnt, truetype, and opentype drivers. See @FT_Sfnt_Tag for */ 00598 /* a list. */ 00599 /* */ 00600 FT_EXPORT( void* ) 00601 FT_Get_Sfnt_Table( FT_Face face, 00602 FT_Sfnt_Tag tag ); 00603 00604 00605 /************************************************************************** 00606 * 00607 * @function: 00608 * FT_Load_Sfnt_Table 00609 * 00610 * @description: 00611 * Load any font table into client memory. 00612 * 00613 * @input: 00614 * face :: 00615 * A handle to the source face. 00616 * 00617 * tag :: 00618 * The four-byte tag of the table to load. Use the value~0 if you want 00619 * to access the whole font file. Otherwise, you can use one of the 00620 * definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new 00621 * one with @FT_MAKE_TAG. 00622 * 00623 * offset :: 00624 * The starting offset in the table (or file if tag == 0). 00625 * 00626 * @output: 00627 * buffer :: 00628 * The target buffer address. The client must ensure that the memory 00629 * array is big enough to hold the data. 00630 * 00631 * @inout: 00632 * length :: 00633 * If the `length' parameter is NULL, then try to load the whole table. 00634 * Return an error code if it fails. 00635 * 00636 * Else, if `*length' is~0, exit immediately while returning the 00637 * table's (or file) full size in it. 00638 * 00639 * Else the number of bytes to read from the table or file, from the 00640 * starting offset. 00641 * 00642 * @return: 00643 * FreeType error code. 0~means success. 00644 * 00645 * @note: 00646 * If you need to determine the table's length you should first call this 00647 * function with `*length' set to~0, as in the following example: 00648 * 00649 * { 00650 * FT_ULong length = 0; 00651 * 00652 * 00653 * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); 00654 * if ( error ) { ... table does not exist ... } 00655 * 00656 * buffer = malloc( length ); 00657 * if ( buffer == NULL ) { ... not enough memory ... } 00658 * 00659 * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); 00660 * if ( error ) { ... could not load table ... } 00661 * } 00662 */ 00663 FT_EXPORT( FT_Error ) 00664 FT_Load_Sfnt_Table( FT_Face face, 00665 FT_ULong tag, 00666 FT_Long offset, 00667 FT_Byte* buffer, 00668 FT_ULong* length ); 00669 00670 00671 /************************************************************************** 00672 * 00673 * @function: 00674 * FT_Sfnt_Table_Info 00675 * 00676 * @description: 00677 * Return information on an SFNT table. 00678 * 00679 * @input: 00680 * face :: 00681 * A handle to the source face. 00682 * 00683 * table_index :: 00684 * The index of an SFNT table. The function returns 00685 * FT_Err_Table_Missing for an invalid value. 00686 * 00687 * @output: 00688 * tag :: 00689 * The name tag of the SFNT table. 00690 * 00691 * length :: 00692 * The length of the SFNT table. 00693 * 00694 * @return: 00695 * FreeType error code. 0~means success. 00696 * 00697 * @note: 00698 * SFNT tables with length zero are treated as missing. 00699 * 00700 */ 00701 FT_EXPORT( FT_Error ) 00702 FT_Sfnt_Table_Info( FT_Face face, 00703 FT_UInt table_index, 00704 FT_ULong *tag, 00705 FT_ULong *length ); 00706 00707 00708 /*************************************************************************/ 00709 /* */ 00710 /* <Function> */ 00711 /* FT_Get_CMap_Language_ID */ 00712 /* */ 00713 /* <Description> */ 00714 /* Return TrueType/sfnt specific cmap language ID. Definitions of */ 00715 /* language ID values are in `freetype/ttnameid.h'. */ 00716 /* */ 00717 /* <Input> */ 00718 /* charmap :: */ 00719 /* The target charmap. */ 00720 /* */ 00721 /* <Return> */ 00722 /* The language ID of `charmap'. If `charmap' doesn't belong to a */ 00723 /* TrueType/sfnt face, just return~0 as the default value. */ 00724 /* */ 00725 FT_EXPORT( FT_ULong ) 00726 FT_Get_CMap_Language_ID( FT_CharMap charmap ); 00727 00728 00729 /*************************************************************************/ 00730 /* */ 00731 /* <Function> */ 00732 /* FT_Get_CMap_Format */ 00733 /* */ 00734 /* <Description> */ 00735 /* Return TrueType/sfnt specific cmap format. */ 00736 /* */ 00737 /* <Input> */ 00738 /* charmap :: */ 00739 /* The target charmap. */ 00740 /* */ 00741 /* <Return> */ 00742 /* The format of `charmap'. If `charmap' doesn't belong to a */ 00743 /* TrueType/sfnt face, return -1. */ 00744 /* */ 00745 FT_EXPORT( FT_Long ) 00746 FT_Get_CMap_Format( FT_CharMap charmap ); 00747 00748 /* */ 00749 00750 00751 FT_END_HEADER 00752 00753 #endif /* __TTTABLES_H__ */ 00754 00755 00756 /* END */