1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/freetype2/include/freetype.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,4076 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* freetype.h */ 1.7 +/* */ 1.8 +/* FreeType high-level API and common types (specification only). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2014 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FREETYPE_H__ 1.23 +#define __FREETYPE_H__ 1.24 + 1.25 + 1.26 +#ifndef FT_FREETYPE_H 1.27 +#error "`ft2build.h' hasn't been included yet!" 1.28 +#error "Please always use macros to include FreeType header files." 1.29 +#error "Example:" 1.30 +#error " #include <ft2build.h>" 1.31 +#error " #include FT_FREETYPE_H" 1.32 +#endif 1.33 + 1.34 + 1.35 +#include <ft2build.h> 1.36 +#include FT_CONFIG_CONFIG_H 1.37 +#include FT_TYPES_H 1.38 +#include FT_ERRORS_H 1.39 + 1.40 + 1.41 +FT_BEGIN_HEADER 1.42 + 1.43 + 1.44 + 1.45 + /*************************************************************************/ 1.46 + /* */ 1.47 + /* <Section> */ 1.48 + /* header_inclusion */ 1.49 + /* */ 1.50 + /* <Title> */ 1.51 + /* FreeType's header inclusion scheme */ 1.52 + /* */ 1.53 + /* <Abstract> */ 1.54 + /* How client applications should include FreeType header files. */ 1.55 + /* */ 1.56 + /* <Description> */ 1.57 + /* To be as flexible as possible (and for historical reasons), */ 1.58 + /* FreeType uses a very special inclusion scheme to load header */ 1.59 + /* files, for example */ 1.60 + /* */ 1.61 + /* { */ 1.62 + /* #include <ft2build.h> */ 1.63 + /* */ 1.64 + /* #include FT_FREETYPE_H */ 1.65 + /* #include FT_OUTLINE_H */ 1.66 + /* } */ 1.67 + /* */ 1.68 + /* A compiler and its preprocessor only needs an include path to find */ 1.69 + /* the file `ft2build.h'; the exact locations and names of the other */ 1.70 + /* FreeType header files are hidden by preprocessor macro names, */ 1.71 + /* loaded by `ft2build.h'. The API documentation always gives the */ 1.72 + /* header macro name needed for a particular function. */ 1.73 + /* */ 1.74 + /*************************************************************************/ 1.75 + 1.76 + 1.77 + /*************************************************************************/ 1.78 + /* */ 1.79 + /* <Section> */ 1.80 + /* user_allocation */ 1.81 + /* */ 1.82 + /* <Title> */ 1.83 + /* User allocation */ 1.84 + /* */ 1.85 + /* <Abstract> */ 1.86 + /* How client applications should allocate FreeType data structures. */ 1.87 + /* */ 1.88 + /* <Description> */ 1.89 + /* FreeType assumes that structures allocated by the user and passed */ 1.90 + /* as arguments are zeroed out except for the actual data. In other */ 1.91 + /* words, it is recommended to use `calloc' (or variants of it) */ 1.92 + /* instead of `malloc' for allocation. */ 1.93 + /* */ 1.94 + /*************************************************************************/ 1.95 + 1.96 + 1.97 + 1.98 + /*************************************************************************/ 1.99 + /*************************************************************************/ 1.100 + /* */ 1.101 + /* B A S I C T Y P E S */ 1.102 + /* */ 1.103 + /*************************************************************************/ 1.104 + /*************************************************************************/ 1.105 + 1.106 + 1.107 + /*************************************************************************/ 1.108 + /* */ 1.109 + /* <Section> */ 1.110 + /* base_interface */ 1.111 + /* */ 1.112 + /* <Title> */ 1.113 + /* Base Interface */ 1.114 + /* */ 1.115 + /* <Abstract> */ 1.116 + /* The FreeType~2 base font interface. */ 1.117 + /* */ 1.118 + /* <Description> */ 1.119 + /* This section describes the public high-level API of FreeType~2. */ 1.120 + /* */ 1.121 + /* <Order> */ 1.122 + /* FT_Library */ 1.123 + /* FT_Face */ 1.124 + /* FT_Size */ 1.125 + /* FT_GlyphSlot */ 1.126 + /* FT_CharMap */ 1.127 + /* FT_Encoding */ 1.128 + /* */ 1.129 + /* FT_FaceRec */ 1.130 + /* */ 1.131 + /* FT_FACE_FLAG_SCALABLE */ 1.132 + /* FT_FACE_FLAG_FIXED_SIZES */ 1.133 + /* FT_FACE_FLAG_FIXED_WIDTH */ 1.134 + /* FT_FACE_FLAG_HORIZONTAL */ 1.135 + /* FT_FACE_FLAG_VERTICAL */ 1.136 + /* FT_FACE_FLAG_COLOR */ 1.137 + /* FT_FACE_FLAG_SFNT */ 1.138 + /* FT_FACE_FLAG_CID_KEYED */ 1.139 + /* FT_FACE_FLAG_TRICKY */ 1.140 + /* FT_FACE_FLAG_KERNING */ 1.141 + /* FT_FACE_FLAG_MULTIPLE_MASTERS */ 1.142 + /* FT_FACE_FLAG_GLYPH_NAMES */ 1.143 + /* FT_FACE_FLAG_EXTERNAL_STREAM */ 1.144 + /* FT_FACE_FLAG_FAST_GLYPHS */ 1.145 + /* FT_FACE_FLAG_HINTER */ 1.146 + /* */ 1.147 + /* FT_STYLE_FLAG_BOLD */ 1.148 + /* FT_STYLE_FLAG_ITALIC */ 1.149 + /* */ 1.150 + /* FT_SizeRec */ 1.151 + /* FT_Size_Metrics */ 1.152 + /* */ 1.153 + /* FT_GlyphSlotRec */ 1.154 + /* FT_Glyph_Metrics */ 1.155 + /* FT_SubGlyph */ 1.156 + /* */ 1.157 + /* FT_Bitmap_Size */ 1.158 + /* */ 1.159 + /* FT_Init_FreeType */ 1.160 + /* FT_Done_FreeType */ 1.161 + /* */ 1.162 + /* FT_New_Face */ 1.163 + /* FT_Done_Face */ 1.164 + /* FT_New_Memory_Face */ 1.165 + /* FT_Open_Face */ 1.166 + /* FT_Open_Args */ 1.167 + /* FT_Parameter */ 1.168 + /* FT_Attach_File */ 1.169 + /* FT_Attach_Stream */ 1.170 + /* */ 1.171 + /* FT_Set_Char_Size */ 1.172 + /* FT_Set_Pixel_Sizes */ 1.173 + /* FT_Request_Size */ 1.174 + /* FT_Select_Size */ 1.175 + /* FT_Size_Request_Type */ 1.176 + /* FT_Size_Request */ 1.177 + /* FT_Set_Transform */ 1.178 + /* FT_Load_Glyph */ 1.179 + /* FT_Get_Char_Index */ 1.180 + /* FT_Get_Name_Index */ 1.181 + /* FT_Load_Char */ 1.182 + /* */ 1.183 + /* FT_OPEN_MEMORY */ 1.184 + /* FT_OPEN_STREAM */ 1.185 + /* FT_OPEN_PATHNAME */ 1.186 + /* FT_OPEN_DRIVER */ 1.187 + /* FT_OPEN_PARAMS */ 1.188 + /* */ 1.189 + /* FT_LOAD_DEFAULT */ 1.190 + /* FT_LOAD_RENDER */ 1.191 + /* FT_LOAD_MONOCHROME */ 1.192 + /* FT_LOAD_LINEAR_DESIGN */ 1.193 + /* FT_LOAD_NO_SCALE */ 1.194 + /* FT_LOAD_NO_HINTING */ 1.195 + /* FT_LOAD_NO_BITMAP */ 1.196 + /* FT_LOAD_CROP_BITMAP */ 1.197 + /* */ 1.198 + /* FT_LOAD_VERTICAL_LAYOUT */ 1.199 + /* FT_LOAD_IGNORE_TRANSFORM */ 1.200 + /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ 1.201 + /* FT_LOAD_FORCE_AUTOHINT */ 1.202 + /* FT_LOAD_NO_RECURSE */ 1.203 + /* FT_LOAD_PEDANTIC */ 1.204 + /* */ 1.205 + /* FT_LOAD_TARGET_NORMAL */ 1.206 + /* FT_LOAD_TARGET_LIGHT */ 1.207 + /* FT_LOAD_TARGET_MONO */ 1.208 + /* FT_LOAD_TARGET_LCD */ 1.209 + /* FT_LOAD_TARGET_LCD_V */ 1.210 + /* */ 1.211 + /* FT_Render_Glyph */ 1.212 + /* FT_Render_Mode */ 1.213 + /* FT_Get_Kerning */ 1.214 + /* FT_Kerning_Mode */ 1.215 + /* FT_Get_Track_Kerning */ 1.216 + /* FT_Get_Glyph_Name */ 1.217 + /* FT_Get_Postscript_Name */ 1.218 + /* */ 1.219 + /* FT_CharMapRec */ 1.220 + /* FT_Select_Charmap */ 1.221 + /* FT_Set_Charmap */ 1.222 + /* FT_Get_Charmap_Index */ 1.223 + /* */ 1.224 + /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ 1.225 + /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ 1.226 + /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ 1.227 + /* FT_FSTYPE_EDITABLE_EMBEDDING */ 1.228 + /* FT_FSTYPE_NO_SUBSETTING */ 1.229 + /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ 1.230 + /* */ 1.231 + /* FT_Get_FSType_Flags */ 1.232 + /* */ 1.233 + /*************************************************************************/ 1.234 + 1.235 + 1.236 + /*************************************************************************/ 1.237 + /* */ 1.238 + /* <Struct> */ 1.239 + /* FT_Glyph_Metrics */ 1.240 + /* */ 1.241 + /* <Description> */ 1.242 + /* A structure used to model the metrics of a single glyph. The */ 1.243 + /* values are expressed in 26.6 fractional pixel format; if the flag */ 1.244 + /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */ 1.245 + /* are expressed in font units instead. */ 1.246 + /* */ 1.247 + /* <Fields> */ 1.248 + /* width :: */ 1.249 + /* The glyph's width. */ 1.250 + /* */ 1.251 + /* height :: */ 1.252 + /* The glyph's height. */ 1.253 + /* */ 1.254 + /* horiBearingX :: */ 1.255 + /* Left side bearing for horizontal layout. */ 1.256 + /* */ 1.257 + /* horiBearingY :: */ 1.258 + /* Top side bearing for horizontal layout. */ 1.259 + /* */ 1.260 + /* horiAdvance :: */ 1.261 + /* Advance width for horizontal layout. */ 1.262 + /* */ 1.263 + /* vertBearingX :: */ 1.264 + /* Left side bearing for vertical layout. */ 1.265 + /* */ 1.266 + /* vertBearingY :: */ 1.267 + /* Top side bearing for vertical layout. Larger positive values */ 1.268 + /* mean further below the vertical glyph origin. */ 1.269 + /* */ 1.270 + /* vertAdvance :: */ 1.271 + /* Advance height for vertical layout. Positive values mean the */ 1.272 + /* glyph has a positive advance downward. */ 1.273 + /* */ 1.274 + /* <Note> */ 1.275 + /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */ 1.276 + /* dimensions of the hinted glyph (in case hinting is applicable). */ 1.277 + /* */ 1.278 + /* Stroking a glyph with an outside border does not increase */ 1.279 + /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */ 1.280 + /* values to account for the added width and height. */ 1.281 + /* */ 1.282 + typedef struct FT_Glyph_Metrics_ 1.283 + { 1.284 + FT_Pos width; 1.285 + FT_Pos height; 1.286 + 1.287 + FT_Pos horiBearingX; 1.288 + FT_Pos horiBearingY; 1.289 + FT_Pos horiAdvance; 1.290 + 1.291 + FT_Pos vertBearingX; 1.292 + FT_Pos vertBearingY; 1.293 + FT_Pos vertAdvance; 1.294 + 1.295 + } FT_Glyph_Metrics; 1.296 + 1.297 + 1.298 + /*************************************************************************/ 1.299 + /* */ 1.300 + /* <Struct> */ 1.301 + /* FT_Bitmap_Size */ 1.302 + /* */ 1.303 + /* <Description> */ 1.304 + /* This structure models the metrics of a bitmap strike (i.e., a set */ 1.305 + /* of glyphs for a given point size and resolution) in a bitmap font. */ 1.306 + /* It is used for the `available_sizes' field of @FT_Face. */ 1.307 + /* */ 1.308 + /* <Fields> */ 1.309 + /* height :: The vertical distance, in pixels, between two */ 1.310 + /* consecutive baselines. It is always positive. */ 1.311 + /* */ 1.312 + /* width :: The average width, in pixels, of all glyphs in the */ 1.313 + /* strike. */ 1.314 + /* */ 1.315 + /* size :: The nominal size of the strike in 26.6 fractional */ 1.316 + /* points. This field is not very useful. */ 1.317 + /* */ 1.318 + /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */ 1.319 + /* pixels. */ 1.320 + /* */ 1.321 + /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */ 1.322 + /* pixels. */ 1.323 + /* */ 1.324 + /* <Note> */ 1.325 + /* Windows FNT: */ 1.326 + /* The nominal size given in a FNT font is not reliable. Thus when */ 1.327 + /* the driver finds it incorrect, it sets `size' to some calculated */ 1.328 + /* values and sets `x_ppem' and `y_ppem' to the pixel width and */ 1.329 + /* height given in the font, respectively. */ 1.330 + /* */ 1.331 + /* TrueType embedded bitmaps: */ 1.332 + /* `size', `width', and `height' values are not contained in the */ 1.333 + /* bitmap strike itself. They are computed from the global font */ 1.334 + /* parameters. */ 1.335 + /* */ 1.336 + typedef struct FT_Bitmap_Size_ 1.337 + { 1.338 + FT_Short height; 1.339 + FT_Short width; 1.340 + 1.341 + FT_Pos size; 1.342 + 1.343 + FT_Pos x_ppem; 1.344 + FT_Pos y_ppem; 1.345 + 1.346 + } FT_Bitmap_Size; 1.347 + 1.348 + 1.349 + /*************************************************************************/ 1.350 + /*************************************************************************/ 1.351 + /* */ 1.352 + /* O B J E C T C L A S S E S */ 1.353 + /* */ 1.354 + /*************************************************************************/ 1.355 + /*************************************************************************/ 1.356 + 1.357 + /*************************************************************************/ 1.358 + /* */ 1.359 + /* <Type> */ 1.360 + /* FT_Library */ 1.361 + /* */ 1.362 + /* <Description> */ 1.363 + /* A handle to a FreeType library instance. Each `library' is */ 1.364 + /* completely independent from the others; it is the `root' of a set */ 1.365 + /* of objects like fonts, faces, sizes, etc. */ 1.366 + /* */ 1.367 + /* It also embeds a memory manager (see @FT_Memory), as well as a */ 1.368 + /* scan-line converter object (see @FT_Raster). */ 1.369 + /* */ 1.370 + /* In multi-threaded applications, make sure that the same FT_Library */ 1.371 + /* object or any of its children doesn't get accessed in parallel. */ 1.372 + /* */ 1.373 + /* <Note> */ 1.374 + /* Library objects are normally created by @FT_Init_FreeType, and */ 1.375 + /* destroyed with @FT_Done_FreeType. If you need reference-counting */ 1.376 + /* (cf. @FT_Reference_Library), use @FT_New_Library and */ 1.377 + /* @FT_Done_Library. */ 1.378 + /* */ 1.379 + typedef struct FT_LibraryRec_ *FT_Library; 1.380 + 1.381 + 1.382 + /*************************************************************************/ 1.383 + /* */ 1.384 + /* <Type> */ 1.385 + /* FT_Module */ 1.386 + /* */ 1.387 + /* <Description> */ 1.388 + /* A handle to a given FreeType module object. Each module can be a */ 1.389 + /* font driver, a renderer, or anything else that provides services */ 1.390 + /* to the formers. */ 1.391 + /* */ 1.392 + typedef struct FT_ModuleRec_* FT_Module; 1.393 + 1.394 + 1.395 + /*************************************************************************/ 1.396 + /* */ 1.397 + /* <Type> */ 1.398 + /* FT_Driver */ 1.399 + /* */ 1.400 + /* <Description> */ 1.401 + /* A handle to a given FreeType font driver object. Each font driver */ 1.402 + /* is a special module capable of creating faces from font files. */ 1.403 + /* */ 1.404 + typedef struct FT_DriverRec_* FT_Driver; 1.405 + 1.406 + 1.407 + /*************************************************************************/ 1.408 + /* */ 1.409 + /* <Type> */ 1.410 + /* FT_Renderer */ 1.411 + /* */ 1.412 + /* <Description> */ 1.413 + /* A handle to a given FreeType renderer. A renderer is a special */ 1.414 + /* module in charge of converting a glyph image to a bitmap, when */ 1.415 + /* necessary. Each renderer supports a given glyph image format, and */ 1.416 + /* one or more target surface depths. */ 1.417 + /* */ 1.418 + typedef struct FT_RendererRec_* FT_Renderer; 1.419 + 1.420 + 1.421 + /*************************************************************************/ 1.422 + /* */ 1.423 + /* <Type> */ 1.424 + /* FT_Face */ 1.425 + /* */ 1.426 + /* <Description> */ 1.427 + /* A handle to a given typographic face object. A face object models */ 1.428 + /* a given typeface, in a given style. */ 1.429 + /* */ 1.430 + /* <Note> */ 1.431 + /* Each face object also owns a single @FT_GlyphSlot object, as well */ 1.432 + /* as one or more @FT_Size objects. */ 1.433 + /* */ 1.434 + /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */ 1.435 + /* a given filepathname or a custom input stream. */ 1.436 + /* */ 1.437 + /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */ 1.438 + /* */ 1.439 + /* <Also> */ 1.440 + /* See @FT_FaceRec for the publicly accessible fields of a given face */ 1.441 + /* object. */ 1.442 + /* */ 1.443 + typedef struct FT_FaceRec_* FT_Face; 1.444 + 1.445 + 1.446 + /*************************************************************************/ 1.447 + /* */ 1.448 + /* <Type> */ 1.449 + /* FT_Size */ 1.450 + /* */ 1.451 + /* <Description> */ 1.452 + /* A handle to an object used to model a face scaled to a given */ 1.453 + /* character size. */ 1.454 + /* */ 1.455 + /* <Note> */ 1.456 + /* Each @FT_Face has an _active_ @FT_Size object that is used by */ 1.457 + /* functions like @FT_Load_Glyph to determine the scaling */ 1.458 + /* transformation that in turn is used to load and hint glyphs and */ 1.459 + /* metrics. */ 1.460 + /* */ 1.461 + /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ 1.462 + /* @FT_Request_Size or even @FT_Select_Size to change the content */ 1.463 + /* (i.e., the scaling values) of the active @FT_Size. */ 1.464 + /* */ 1.465 + /* You can use @FT_New_Size to create additional size objects for a */ 1.466 + /* given @FT_Face, but they won't be used by other functions until */ 1.467 + /* you activate it through @FT_Activate_Size. Only one size can be */ 1.468 + /* activated at any given time per face. */ 1.469 + /* */ 1.470 + /* <Also> */ 1.471 + /* See @FT_SizeRec for the publicly accessible fields of a given size */ 1.472 + /* object. */ 1.473 + /* */ 1.474 + typedef struct FT_SizeRec_* FT_Size; 1.475 + 1.476 + 1.477 + /*************************************************************************/ 1.478 + /* */ 1.479 + /* <Type> */ 1.480 + /* FT_GlyphSlot */ 1.481 + /* */ 1.482 + /* <Description> */ 1.483 + /* A handle to a given `glyph slot'. A slot is a container where it */ 1.484 + /* is possible to load any of the glyphs contained in its parent */ 1.485 + /* face. */ 1.486 + /* */ 1.487 + /* In other words, each time you call @FT_Load_Glyph or */ 1.488 + /* @FT_Load_Char, the slot's content is erased by the new glyph data, */ 1.489 + /* i.e., the glyph's metrics, its image (bitmap or outline), and */ 1.490 + /* other control information. */ 1.491 + /* */ 1.492 + /* <Also> */ 1.493 + /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */ 1.494 + /* */ 1.495 + typedef struct FT_GlyphSlotRec_* FT_GlyphSlot; 1.496 + 1.497 + 1.498 + /*************************************************************************/ 1.499 + /* */ 1.500 + /* <Type> */ 1.501 + /* FT_CharMap */ 1.502 + /* */ 1.503 + /* <Description> */ 1.504 + /* A handle to a given character map. A charmap is used to translate */ 1.505 + /* character codes in a given encoding into glyph indexes for its */ 1.506 + /* parent's face. Some font formats may provide several charmaps per */ 1.507 + /* font. */ 1.508 + /* */ 1.509 + /* Each face object owns zero or more charmaps, but only one of them */ 1.510 + /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */ 1.511 + /* */ 1.512 + /* The list of available charmaps in a face is available through the */ 1.513 + /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */ 1.514 + /* */ 1.515 + /* The currently active charmap is available as `face->charmap'. */ 1.516 + /* You should call @FT_Set_Charmap to change it. */ 1.517 + /* */ 1.518 + /* <Note> */ 1.519 + /* When a new face is created (either through @FT_New_Face or */ 1.520 + /* @FT_Open_Face), the library looks for a Unicode charmap within */ 1.521 + /* the list and automatically activates it. */ 1.522 + /* */ 1.523 + /* <Also> */ 1.524 + /* See @FT_CharMapRec for the publicly accessible fields of a given */ 1.525 + /* character map. */ 1.526 + /* */ 1.527 + typedef struct FT_CharMapRec_* FT_CharMap; 1.528 + 1.529 + 1.530 + /*************************************************************************/ 1.531 + /* */ 1.532 + /* <Macro> */ 1.533 + /* FT_ENC_TAG */ 1.534 + /* */ 1.535 + /* <Description> */ 1.536 + /* This macro converts four-letter tags into an unsigned long. It is */ 1.537 + /* used to define `encoding' identifiers (see @FT_Encoding). */ 1.538 + /* */ 1.539 + /* <Note> */ 1.540 + /* Since many 16-bit compilers don't like 32-bit enumerations, you */ 1.541 + /* should redefine this macro in case of problems to something like */ 1.542 + /* this: */ 1.543 + /* */ 1.544 + /* { */ 1.545 + /* #define FT_ENC_TAG( value, a, b, c, d ) value */ 1.546 + /* } */ 1.547 + /* */ 1.548 + /* to get a simple enumeration without assigning special numbers. */ 1.549 + /* */ 1.550 + 1.551 +#ifndef FT_ENC_TAG 1.552 +#define FT_ENC_TAG( value, a, b, c, d ) \ 1.553 + value = ( ( (FT_UInt32)(a) << 24 ) | \ 1.554 + ( (FT_UInt32)(b) << 16 ) | \ 1.555 + ( (FT_UInt32)(c) << 8 ) | \ 1.556 + (FT_UInt32)(d) ) 1.557 + 1.558 +#endif /* FT_ENC_TAG */ 1.559 + 1.560 + 1.561 + /*************************************************************************/ 1.562 + /* */ 1.563 + /* <Enum> */ 1.564 + /* FT_Encoding */ 1.565 + /* */ 1.566 + /* <Description> */ 1.567 + /* An enumeration used to specify character sets supported by */ 1.568 + /* charmaps. Used in the @FT_Select_Charmap API function. */ 1.569 + /* */ 1.570 + /* <Note> */ 1.571 + /* Despite the name, this enumeration lists specific character */ 1.572 + /* repertories (i.e., charsets), and not text encoding methods (e.g., */ 1.573 + /* UTF-8, UTF-16, etc.). */ 1.574 + /* */ 1.575 + /* Other encodings might be defined in the future. */ 1.576 + /* */ 1.577 + /* <Values> */ 1.578 + /* FT_ENCODING_NONE :: */ 1.579 + /* The encoding value~0 is reserved. */ 1.580 + /* */ 1.581 + /* FT_ENCODING_UNICODE :: */ 1.582 + /* Corresponds to the Unicode character set. This value covers */ 1.583 + /* all versions of the Unicode repertoire, including ASCII and */ 1.584 + /* Latin-1. Most fonts include a Unicode charmap, but not all */ 1.585 + /* of them. */ 1.586 + /* */ 1.587 + /* For example, if you want to access Unicode value U+1F028 (and */ 1.588 + /* the font contains it), use value 0x1F028 as the input value for */ 1.589 + /* @FT_Get_Char_Index. */ 1.590 + /* */ 1.591 + /* FT_ENCODING_MS_SYMBOL :: */ 1.592 + /* Corresponds to the Microsoft Symbol encoding, used to encode */ 1.593 + /* mathematical symbols in the 32..255 character code range. For */ 1.594 + /* more information, see */ 1.595 + /* `http://www.kostis.net/charsets/symbol.htm'. */ 1.596 + /* */ 1.597 + /* FT_ENCODING_SJIS :: */ 1.598 + /* Corresponds to Japanese SJIS encoding. More info at */ 1.599 + /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */ 1.600 + /* See note on multi-byte encodings below. */ 1.601 + /* */ 1.602 + /* FT_ENCODING_GB2312 :: */ 1.603 + /* Corresponds to an encoding system for Simplified Chinese as used */ 1.604 + /* used in mainland China. */ 1.605 + /* */ 1.606 + /* FT_ENCODING_BIG5 :: */ 1.607 + /* Corresponds to an encoding system for Traditional Chinese as */ 1.608 + /* used in Taiwan and Hong Kong. */ 1.609 + /* */ 1.610 + /* FT_ENCODING_WANSUNG :: */ 1.611 + /* Corresponds to the Korean encoding system known as Wansung. */ 1.612 + /* For more information see */ 1.613 + /* `http://msdn.microsoft.com/en-US/goglobal/cc305154'. */ 1.614 + /* */ 1.615 + /* FT_ENCODING_JOHAB :: */ 1.616 + /* The Korean standard character set (KS~C 5601-1992), which */ 1.617 + /* corresponds to MS Windows code page 1361. This character set */ 1.618 + /* includes all possible Hangeul character combinations. */ 1.619 + /* */ 1.620 + /* FT_ENCODING_ADOBE_LATIN_1 :: */ 1.621 + /* Corresponds to a Latin-1 encoding as defined in a Type~1 */ 1.622 + /* PostScript font. It is limited to 256 character codes. */ 1.623 + /* */ 1.624 + /* FT_ENCODING_ADOBE_STANDARD :: */ 1.625 + /* Corresponds to the Adobe Standard encoding, as found in Type~1, */ 1.626 + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ 1.627 + /* codes. */ 1.628 + /* */ 1.629 + /* FT_ENCODING_ADOBE_EXPERT :: */ 1.630 + /* Corresponds to the Adobe Expert encoding, as found in Type~1, */ 1.631 + /* CFF, and OpenType/CFF fonts. It is limited to 256 character */ 1.632 + /* codes. */ 1.633 + /* */ 1.634 + /* FT_ENCODING_ADOBE_CUSTOM :: */ 1.635 + /* Corresponds to a custom encoding, as found in Type~1, CFF, and */ 1.636 + /* OpenType/CFF fonts. It is limited to 256 character codes. */ 1.637 + /* */ 1.638 + /* FT_ENCODING_APPLE_ROMAN :: */ 1.639 + /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */ 1.640 + /* and OpenType fonts contain a charmap for this encoding, since */ 1.641 + /* older versions of Mac OS are able to use it. */ 1.642 + /* */ 1.643 + /* FT_ENCODING_OLD_LATIN_2 :: */ 1.644 + /* This value is deprecated and was never used nor reported by */ 1.645 + /* FreeType. Don't use or test for it. */ 1.646 + /* */ 1.647 + /* FT_ENCODING_MS_SJIS :: */ 1.648 + /* Same as FT_ENCODING_SJIS. Deprecated. */ 1.649 + /* */ 1.650 + /* FT_ENCODING_MS_GB2312 :: */ 1.651 + /* Same as FT_ENCODING_GB2312. Deprecated. */ 1.652 + /* */ 1.653 + /* FT_ENCODING_MS_BIG5 :: */ 1.654 + /* Same as FT_ENCODING_BIG5. Deprecated. */ 1.655 + /* */ 1.656 + /* FT_ENCODING_MS_WANSUNG :: */ 1.657 + /* Same as FT_ENCODING_WANSUNG. Deprecated. */ 1.658 + /* */ 1.659 + /* FT_ENCODING_MS_JOHAB :: */ 1.660 + /* Same as FT_ENCODING_JOHAB. Deprecated. */ 1.661 + /* */ 1.662 + /* <Note> */ 1.663 + /* By default, FreeType automatically synthesizes a Unicode charmap */ 1.664 + /* for PostScript fonts, using their glyph names dictionaries. */ 1.665 + /* However, it also reports the encodings defined explicitly in the */ 1.666 + /* font file, for the cases when they are needed, with the Adobe */ 1.667 + /* values as well. */ 1.668 + /* */ 1.669 + /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */ 1.670 + /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */ 1.671 + /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */ 1.672 + /* which encoding is really present. If, for example, the */ 1.673 + /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */ 1.674 + /* the font is encoded in KOI8-R. */ 1.675 + /* */ 1.676 + /* FT_ENCODING_NONE is always set (with a single exception) by the */ 1.677 + /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */ 1.678 + /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */ 1.679 + /* which encoding is really present. For example, */ 1.680 + /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */ 1.681 + /* Russian). */ 1.682 + /* */ 1.683 + /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */ 1.684 + /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */ 1.685 + /* FT_ENCODING_APPLE_ROMAN). */ 1.686 + /* */ 1.687 + /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ 1.688 + /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */ 1.689 + /* be needed to be able to distinguish Apple encoding variants. See */ 1.690 + /* */ 1.691 + /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */ 1.692 + /* */ 1.693 + /* to get an idea how to do that. Basically, if the language ID */ 1.694 + /* is~0, don't use it, otherwise subtract 1 from the language ID. */ 1.695 + /* Then examine `encoding_id'. If, for example, `encoding_id' is */ 1.696 + /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */ 1.697 + /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */ 1.698 + /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */ 1.699 + /* variant the Arabic encoding. */ 1.700 + /* */ 1.701 + typedef enum FT_Encoding_ 1.702 + { 1.703 + FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ), 1.704 + 1.705 + FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ), 1.706 + FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ), 1.707 + 1.708 + FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ), 1.709 + FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ), 1.710 + FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ), 1.711 + FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ), 1.712 + FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ), 1.713 + 1.714 + /* for backwards compatibility */ 1.715 + FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS, 1.716 + FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312, 1.717 + FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5, 1.718 + FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG, 1.719 + FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB, 1.720 + 1.721 + FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ), 1.722 + FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ), 1.723 + FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ), 1.724 + FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ), 1.725 + 1.726 + FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ), 1.727 + 1.728 + FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' ) 1.729 + 1.730 + } FT_Encoding; 1.731 + 1.732 + 1.733 + /*************************************************************************/ 1.734 + /* */ 1.735 + /* <Enum> */ 1.736 + /* ft_encoding_xxx */ 1.737 + /* */ 1.738 + /* <Description> */ 1.739 + /* These constants are deprecated; use the corresponding @FT_Encoding */ 1.740 + /* values instead. */ 1.741 + /* */ 1.742 +#define ft_encoding_none FT_ENCODING_NONE 1.743 +#define ft_encoding_unicode FT_ENCODING_UNICODE 1.744 +#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL 1.745 +#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 1.746 +#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 1.747 +#define ft_encoding_sjis FT_ENCODING_SJIS 1.748 +#define ft_encoding_gb2312 FT_ENCODING_GB2312 1.749 +#define ft_encoding_big5 FT_ENCODING_BIG5 1.750 +#define ft_encoding_wansung FT_ENCODING_WANSUNG 1.751 +#define ft_encoding_johab FT_ENCODING_JOHAB 1.752 + 1.753 +#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD 1.754 +#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT 1.755 +#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM 1.756 +#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN 1.757 + 1.758 + 1.759 + /*************************************************************************/ 1.760 + /* */ 1.761 + /* <Struct> */ 1.762 + /* FT_CharMapRec */ 1.763 + /* */ 1.764 + /* <Description> */ 1.765 + /* The base charmap structure. */ 1.766 + /* */ 1.767 + /* <Fields> */ 1.768 + /* face :: A handle to the parent face object. */ 1.769 + /* */ 1.770 + /* encoding :: An @FT_Encoding tag identifying the charmap. Use */ 1.771 + /* this with @FT_Select_Charmap. */ 1.772 + /* */ 1.773 + /* platform_id :: An ID number describing the platform for the */ 1.774 + /* following encoding ID. This comes directly from */ 1.775 + /* the TrueType specification and should be emulated */ 1.776 + /* for other formats. */ 1.777 + /* */ 1.778 + /* encoding_id :: A platform specific encoding number. This also */ 1.779 + /* comes from the TrueType specification and should be */ 1.780 + /* emulated similarly. */ 1.781 + /* */ 1.782 + typedef struct FT_CharMapRec_ 1.783 + { 1.784 + FT_Face face; 1.785 + FT_Encoding encoding; 1.786 + FT_UShort platform_id; 1.787 + FT_UShort encoding_id; 1.788 + 1.789 + } FT_CharMapRec; 1.790 + 1.791 + 1.792 + /*************************************************************************/ 1.793 + /*************************************************************************/ 1.794 + /* */ 1.795 + /* B A S E O B J E C T C L A S S E S */ 1.796 + /* */ 1.797 + /*************************************************************************/ 1.798 + /*************************************************************************/ 1.799 + 1.800 + 1.801 + /*************************************************************************/ 1.802 + /* */ 1.803 + /* <Type> */ 1.804 + /* FT_Face_Internal */ 1.805 + /* */ 1.806 + /* <Description> */ 1.807 + /* An opaque handle to an `FT_Face_InternalRec' structure, used to */ 1.808 + /* model private data of a given @FT_Face object. */ 1.809 + /* */ 1.810 + /* This structure might change between releases of FreeType~2 and is */ 1.811 + /* not generally available to client applications. */ 1.812 + /* */ 1.813 + typedef struct FT_Face_InternalRec_* FT_Face_Internal; 1.814 + 1.815 + 1.816 + /*************************************************************************/ 1.817 + /* */ 1.818 + /* <Struct> */ 1.819 + /* FT_FaceRec */ 1.820 + /* */ 1.821 + /* <Description> */ 1.822 + /* FreeType root face class structure. A face object models a */ 1.823 + /* typeface in a font file. */ 1.824 + /* */ 1.825 + /* <Fields> */ 1.826 + /* num_faces :: The number of faces in the font file. Some */ 1.827 + /* font formats can have multiple faces in */ 1.828 + /* a font file. */ 1.829 + /* */ 1.830 + /* face_index :: The index of the face in the font file. It */ 1.831 + /* is set to~0 if there is only one face in */ 1.832 + /* the font file. */ 1.833 + /* */ 1.834 + /* face_flags :: A set of bit flags that give important */ 1.835 + /* information about the face; see */ 1.836 + /* @FT_FACE_FLAG_XXX for the details. */ 1.837 + /* */ 1.838 + /* style_flags :: A set of bit flags indicating the style of */ 1.839 + /* the face; see @FT_STYLE_FLAG_XXX for the */ 1.840 + /* details. */ 1.841 + /* */ 1.842 + /* num_glyphs :: The number of glyphs in the face. If the */ 1.843 + /* face is scalable and has sbits (see */ 1.844 + /* `num_fixed_sizes'), it is set to the number */ 1.845 + /* of outline glyphs. */ 1.846 + /* */ 1.847 + /* For CID-keyed fonts, this value gives the */ 1.848 + /* highest CID used in the font. */ 1.849 + /* */ 1.850 + /* family_name :: The face's family name. This is an ASCII */ 1.851 + /* string, usually in English, that describes */ 1.852 + /* the typeface's family (like `Times New */ 1.853 + /* Roman', `Bodoni', `Garamond', etc). This */ 1.854 + /* is a least common denominator used to list */ 1.855 + /* fonts. Some formats (TrueType & OpenType) */ 1.856 + /* provide localized and Unicode versions of */ 1.857 + /* this string. Applications should use the */ 1.858 + /* format specific interface to access them. */ 1.859 + /* Can be NULL (e.g., in fonts embedded in a */ 1.860 + /* PDF file). */ 1.861 + /* */ 1.862 + /* style_name :: The face's style name. This is an ASCII */ 1.863 + /* string, usually in English, that describes */ 1.864 + /* the typeface's style (like `Italic', */ 1.865 + /* `Bold', `Condensed', etc). Not all font */ 1.866 + /* formats provide a style name, so this field */ 1.867 + /* is optional, and can be set to NULL. As */ 1.868 + /* for `family_name', some formats provide */ 1.869 + /* localized and Unicode versions of this */ 1.870 + /* string. Applications should use the format */ 1.871 + /* specific interface to access them. */ 1.872 + /* */ 1.873 + /* num_fixed_sizes :: The number of bitmap strikes in the face. */ 1.874 + /* Even if the face is scalable, there might */ 1.875 + /* still be bitmap strikes, which are called */ 1.876 + /* `sbits' in that case. */ 1.877 + /* */ 1.878 + /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */ 1.879 + /* strikes in the face. It is set to NULL if */ 1.880 + /* there is no bitmap strike. */ 1.881 + /* */ 1.882 + /* num_charmaps :: The number of charmaps in the face. */ 1.883 + /* */ 1.884 + /* charmaps :: An array of the charmaps of the face. */ 1.885 + /* */ 1.886 + /* generic :: A field reserved for client uses. See the */ 1.887 + /* @FT_Generic type description. */ 1.888 + /* */ 1.889 + /* bbox :: The font bounding box. Coordinates are */ 1.890 + /* expressed in font units (see */ 1.891 + /* `units_per_EM'). The box is large enough */ 1.892 + /* to contain any glyph from the font. Thus, */ 1.893 + /* `bbox.yMax' can be seen as the `maximum */ 1.894 + /* ascender', and `bbox.yMin' as the `minimum */ 1.895 + /* descender'. Only relevant for scalable */ 1.896 + /* formats. */ 1.897 + /* */ 1.898 + /* Note that the bounding box might be off by */ 1.899 + /* (at least) one pixel for hinted fonts. See */ 1.900 + /* @FT_Size_Metrics for further discussion. */ 1.901 + /* */ 1.902 + /* units_per_EM :: The number of font units per EM square for */ 1.903 + /* this face. This is typically 2048 for */ 1.904 + /* TrueType fonts, and 1000 for Type~1 fonts. */ 1.905 + /* Only relevant for scalable formats. */ 1.906 + /* */ 1.907 + /* ascender :: The typographic ascender of the face, */ 1.908 + /* expressed in font units. For font formats */ 1.909 + /* not having this information, it is set to */ 1.910 + /* `bbox.yMax'. Only relevant for scalable */ 1.911 + /* formats. */ 1.912 + /* */ 1.913 + /* descender :: The typographic descender of the face, */ 1.914 + /* expressed in font units. For font formats */ 1.915 + /* not having this information, it is set to */ 1.916 + /* `bbox.yMin'. Note that this field is */ 1.917 + /* usually negative. Only relevant for */ 1.918 + /* scalable formats. */ 1.919 + /* */ 1.920 + /* height :: This value is the vertical distance */ 1.921 + /* between two consecutive baselines, */ 1.922 + /* expressed in font units. It is always */ 1.923 + /* positive. Only relevant for scalable */ 1.924 + /* formats. */ 1.925 + /* */ 1.926 + /* If you want the global glyph height, use */ 1.927 + /* `ascender - descender'. */ 1.928 + /* */ 1.929 + /* max_advance_width :: The maximum advance width, in font units, */ 1.930 + /* for all glyphs in this face. This can be */ 1.931 + /* used to make word wrapping computations */ 1.932 + /* faster. Only relevant for scalable */ 1.933 + /* formats. */ 1.934 + /* */ 1.935 + /* max_advance_height :: The maximum advance height, in font units, */ 1.936 + /* for all glyphs in this face. This is only */ 1.937 + /* relevant for vertical layouts, and is set */ 1.938 + /* to `height' for fonts that do not provide */ 1.939 + /* vertical metrics. Only relevant for */ 1.940 + /* scalable formats. */ 1.941 + /* */ 1.942 + /* underline_position :: The position, in font units, of the */ 1.943 + /* underline line for this face. It is the */ 1.944 + /* center of the underlining stem. Only */ 1.945 + /* relevant for scalable formats. */ 1.946 + /* */ 1.947 + /* underline_thickness :: The thickness, in font units, of the */ 1.948 + /* underline for this face. Only relevant for */ 1.949 + /* scalable formats. */ 1.950 + /* */ 1.951 + /* glyph :: The face's associated glyph slot(s). */ 1.952 + /* */ 1.953 + /* size :: The current active size for this face. */ 1.954 + /* */ 1.955 + /* charmap :: The current active charmap for this face. */ 1.956 + /* */ 1.957 + /* <Note> */ 1.958 + /* Fields may be changed after a call to @FT_Attach_File or */ 1.959 + /* @FT_Attach_Stream. */ 1.960 + /* */ 1.961 + typedef struct FT_FaceRec_ 1.962 + { 1.963 + FT_Long num_faces; 1.964 + FT_Long face_index; 1.965 + 1.966 + FT_Long face_flags; 1.967 + FT_Long style_flags; 1.968 + 1.969 + FT_Long num_glyphs; 1.970 + 1.971 + FT_String* family_name; 1.972 + FT_String* style_name; 1.973 + 1.974 + FT_Int num_fixed_sizes; 1.975 + FT_Bitmap_Size* available_sizes; 1.976 + 1.977 + FT_Int num_charmaps; 1.978 + FT_CharMap* charmaps; 1.979 + 1.980 + FT_Generic generic; 1.981 + 1.982 + /*# The following member variables (down to `underline_thickness') */ 1.983 + /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ 1.984 + /*# for bitmap fonts. */ 1.985 + FT_BBox bbox; 1.986 + 1.987 + FT_UShort units_per_EM; 1.988 + FT_Short ascender; 1.989 + FT_Short descender; 1.990 + FT_Short height; 1.991 + 1.992 + FT_Short max_advance_width; 1.993 + FT_Short max_advance_height; 1.994 + 1.995 + FT_Short underline_position; 1.996 + FT_Short underline_thickness; 1.997 + 1.998 + FT_GlyphSlot glyph; 1.999 + FT_Size size; 1.1000 + FT_CharMap charmap; 1.1001 + 1.1002 + /*@private begin */ 1.1003 + 1.1004 + FT_Driver driver; 1.1005 + FT_Memory memory; 1.1006 + FT_Stream stream; 1.1007 + 1.1008 + FT_ListRec sizes_list; 1.1009 + 1.1010 + FT_Generic autohint; /* face-specific auto-hinter data */ 1.1011 + void* extensions; /* unused */ 1.1012 + 1.1013 + FT_Face_Internal internal; 1.1014 + 1.1015 + /*@private end */ 1.1016 + 1.1017 + } FT_FaceRec; 1.1018 + 1.1019 + 1.1020 + /*************************************************************************/ 1.1021 + /* */ 1.1022 + /* <Enum> */ 1.1023 + /* FT_FACE_FLAG_XXX */ 1.1024 + /* */ 1.1025 + /* <Description> */ 1.1026 + /* A list of bit flags used in the `face_flags' field of the */ 1.1027 + /* @FT_FaceRec structure. They inform client applications of */ 1.1028 + /* properties of the corresponding face. */ 1.1029 + /* */ 1.1030 + /* <Values> */ 1.1031 + /* FT_FACE_FLAG_SCALABLE :: */ 1.1032 + /* Indicates that the face contains outline glyphs. This doesn't */ 1.1033 + /* prevent bitmap strikes, i.e., a face can have both this and */ 1.1034 + /* and @FT_FACE_FLAG_FIXED_SIZES set. */ 1.1035 + /* */ 1.1036 + /* FT_FACE_FLAG_FIXED_SIZES :: */ 1.1037 + /* Indicates that the face contains bitmap strikes. See also the */ 1.1038 + /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */ 1.1039 + /* */ 1.1040 + /* FT_FACE_FLAG_FIXED_WIDTH :: */ 1.1041 + /* Indicates that the face contains fixed-width characters (like */ 1.1042 + /* Courier, Lucido, MonoType, etc.). */ 1.1043 + /* */ 1.1044 + /* FT_FACE_FLAG_SFNT :: */ 1.1045 + /* Indicates that the face uses the `sfnt' storage scheme. For */ 1.1046 + /* now, this means TrueType and OpenType. */ 1.1047 + /* */ 1.1048 + /* FT_FACE_FLAG_HORIZONTAL :: */ 1.1049 + /* Indicates that the face contains horizontal glyph metrics. This */ 1.1050 + /* should be set for all common formats. */ 1.1051 + /* */ 1.1052 + /* FT_FACE_FLAG_VERTICAL :: */ 1.1053 + /* Indicates that the face contains vertical glyph metrics. This */ 1.1054 + /* is only available in some formats, not all of them. */ 1.1055 + /* */ 1.1056 + /* FT_FACE_FLAG_KERNING :: */ 1.1057 + /* Indicates that the face contains kerning information. If set, */ 1.1058 + /* the kerning distance can be retrieved through the function */ 1.1059 + /* @FT_Get_Kerning. Otherwise the function always return the */ 1.1060 + /* vector (0,0). Note that FreeType doesn't handle kerning data */ 1.1061 + /* from the `GPOS' table (as present in some OpenType fonts). */ 1.1062 + /* */ 1.1063 + /* FT_FACE_FLAG_FAST_GLYPHS :: */ 1.1064 + /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */ 1.1065 + /* */ 1.1066 + /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */ 1.1067 + /* Indicates that the font contains multiple masters and is capable */ 1.1068 + /* of interpolating between them. See the multiple-masters */ 1.1069 + /* specific API for details. */ 1.1070 + /* */ 1.1071 + /* FT_FACE_FLAG_GLYPH_NAMES :: */ 1.1072 + /* Indicates that the font contains glyph names that can be */ 1.1073 + /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */ 1.1074 + /* fonts contain broken glyph name tables. Use the function */ 1.1075 + /* @FT_Has_PS_Glyph_Names when needed. */ 1.1076 + /* */ 1.1077 + /* FT_FACE_FLAG_EXTERNAL_STREAM :: */ 1.1078 + /* Used internally by FreeType to indicate that a face's stream was */ 1.1079 + /* provided by the client application and should not be destroyed */ 1.1080 + /* when @FT_Done_Face is called. Don't read or test this flag. */ 1.1081 + /* */ 1.1082 + /* FT_FACE_FLAG_HINTER :: */ 1.1083 + /* Set if the font driver has a hinting machine of its own. For */ 1.1084 + /* example, with TrueType fonts, it makes sense to use data from */ 1.1085 + /* the SFNT `gasp' table only if the native TrueType hinting engine */ 1.1086 + /* (with the bytecode interpreter) is available and active. */ 1.1087 + /* */ 1.1088 + /* FT_FACE_FLAG_CID_KEYED :: */ 1.1089 + /* Set if the font is CID-keyed. In that case, the font is not */ 1.1090 + /* accessed by glyph indices but by CID values. For subsetted */ 1.1091 + /* CID-keyed fonts this has the consequence that not all index */ 1.1092 + /* values are a valid argument to FT_Load_Glyph. Only the CID */ 1.1093 + /* values for which corresponding glyphs in the subsetted font */ 1.1094 + /* exist make FT_Load_Glyph return successfully; in all other cases */ 1.1095 + /* you get an `FT_Err_Invalid_Argument' error. */ 1.1096 + /* */ 1.1097 + /* Note that CID-keyed fonts that are in an SFNT wrapper don't */ 1.1098 + /* have this flag set since the glyphs are accessed in the normal */ 1.1099 + /* way (using contiguous indices); the `CID-ness' isn't visible to */ 1.1100 + /* the application. */ 1.1101 + /* */ 1.1102 + /* FT_FACE_FLAG_TRICKY :: */ 1.1103 + /* Set if the font is `tricky', this is, it always needs the */ 1.1104 + /* font format's native hinting engine to get a reasonable result. */ 1.1105 + /* A typical example is the Chinese font `mingli.ttf' that uses */ 1.1106 + /* TrueType bytecode instructions to move and scale all of its */ 1.1107 + /* subglyphs. */ 1.1108 + /* */ 1.1109 + /* It is not possible to autohint such fonts using */ 1.1110 + /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */ 1.1111 + /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */ 1.1112 + /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */ 1.1113 + /* probably never want this except for demonstration purposes. */ 1.1114 + /* */ 1.1115 + /* Currently, there are about a dozen TrueType fonts in the list of */ 1.1116 + /* tricky fonts; they are hard-coded in file `ttobjs.c'. */ 1.1117 + /* */ 1.1118 + /* FT_FACE_FLAG_COLOR :: */ 1.1119 + /* Set if the font has color glyph tables. To access color glyphs */ 1.1120 + /* use @FT_LOAD_COLOR. */ 1.1121 + /* */ 1.1122 +#define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) 1.1123 +#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) 1.1124 +#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) 1.1125 +#define FT_FACE_FLAG_SFNT ( 1L << 3 ) 1.1126 +#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 ) 1.1127 +#define FT_FACE_FLAG_VERTICAL ( 1L << 5 ) 1.1128 +#define FT_FACE_FLAG_KERNING ( 1L << 6 ) 1.1129 +#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 ) 1.1130 +#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 ) 1.1131 +#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 ) 1.1132 +#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 ) 1.1133 +#define FT_FACE_FLAG_HINTER ( 1L << 11 ) 1.1134 +#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) 1.1135 +#define FT_FACE_FLAG_TRICKY ( 1L << 13 ) 1.1136 +#define FT_FACE_FLAG_COLOR ( 1L << 14 ) 1.1137 + 1.1138 + 1.1139 + /************************************************************************* 1.1140 + * 1.1141 + * @macro: 1.1142 + * FT_HAS_HORIZONTAL( face ) 1.1143 + * 1.1144 + * @description: 1.1145 + * A macro that returns true whenever a face object contains 1.1146 + * horizontal metrics (this is true for all font formats though). 1.1147 + * 1.1148 + * @also: 1.1149 + * @FT_HAS_VERTICAL can be used to check for vertical metrics. 1.1150 + * 1.1151 + */ 1.1152 +#define FT_HAS_HORIZONTAL( face ) \ 1.1153 + ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) 1.1154 + 1.1155 + 1.1156 + /************************************************************************* 1.1157 + * 1.1158 + * @macro: 1.1159 + * FT_HAS_VERTICAL( face ) 1.1160 + * 1.1161 + * @description: 1.1162 + * A macro that returns true whenever a face object contains real 1.1163 + * vertical metrics (and not only synthesized ones). 1.1164 + * 1.1165 + */ 1.1166 +#define FT_HAS_VERTICAL( face ) \ 1.1167 + ( face->face_flags & FT_FACE_FLAG_VERTICAL ) 1.1168 + 1.1169 + 1.1170 + /************************************************************************* 1.1171 + * 1.1172 + * @macro: 1.1173 + * FT_HAS_KERNING( face ) 1.1174 + * 1.1175 + * @description: 1.1176 + * A macro that returns true whenever a face object contains kerning 1.1177 + * data that can be accessed with @FT_Get_Kerning. 1.1178 + * 1.1179 + */ 1.1180 +#define FT_HAS_KERNING( face ) \ 1.1181 + ( face->face_flags & FT_FACE_FLAG_KERNING ) 1.1182 + 1.1183 + 1.1184 + /************************************************************************* 1.1185 + * 1.1186 + * @macro: 1.1187 + * FT_IS_SCALABLE( face ) 1.1188 + * 1.1189 + * @description: 1.1190 + * A macro that returns true whenever a face object contains a scalable 1.1191 + * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF, 1.1192 + * and PFR font formats. 1.1193 + * 1.1194 + */ 1.1195 +#define FT_IS_SCALABLE( face ) \ 1.1196 + ( face->face_flags & FT_FACE_FLAG_SCALABLE ) 1.1197 + 1.1198 + 1.1199 + /************************************************************************* 1.1200 + * 1.1201 + * @macro: 1.1202 + * FT_IS_SFNT( face ) 1.1203 + * 1.1204 + * @description: 1.1205 + * A macro that returns true whenever a face object contains a font 1.1206 + * whose format is based on the SFNT storage scheme. This usually 1.1207 + * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded 1.1208 + * bitmap fonts. 1.1209 + * 1.1210 + * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and 1.1211 + * @FT_TRUETYPE_TABLES_H are available. 1.1212 + * 1.1213 + */ 1.1214 +#define FT_IS_SFNT( face ) \ 1.1215 + ( face->face_flags & FT_FACE_FLAG_SFNT ) 1.1216 + 1.1217 + 1.1218 + /************************************************************************* 1.1219 + * 1.1220 + * @macro: 1.1221 + * FT_IS_FIXED_WIDTH( face ) 1.1222 + * 1.1223 + * @description: 1.1224 + * A macro that returns true whenever a face object contains a font face 1.1225 + * that contains fixed-width (or `monospace', `fixed-pitch', etc.) 1.1226 + * glyphs. 1.1227 + * 1.1228 + */ 1.1229 +#define FT_IS_FIXED_WIDTH( face ) \ 1.1230 + ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) 1.1231 + 1.1232 + 1.1233 + /************************************************************************* 1.1234 + * 1.1235 + * @macro: 1.1236 + * FT_HAS_FIXED_SIZES( face ) 1.1237 + * 1.1238 + * @description: 1.1239 + * A macro that returns true whenever a face object contains some 1.1240 + * embedded bitmaps. See the `available_sizes' field of the 1.1241 + * @FT_FaceRec structure. 1.1242 + * 1.1243 + */ 1.1244 +#define FT_HAS_FIXED_SIZES( face ) \ 1.1245 + ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) 1.1246 + 1.1247 + 1.1248 + /************************************************************************* 1.1249 + * 1.1250 + * @macro: 1.1251 + * FT_HAS_FAST_GLYPHS( face ) 1.1252 + * 1.1253 + * @description: 1.1254 + * Deprecated. 1.1255 + * 1.1256 + */ 1.1257 +#define FT_HAS_FAST_GLYPHS( face ) 0 1.1258 + 1.1259 + 1.1260 + /************************************************************************* 1.1261 + * 1.1262 + * @macro: 1.1263 + * FT_HAS_GLYPH_NAMES( face ) 1.1264 + * 1.1265 + * @description: 1.1266 + * A macro that returns true whenever a face object contains some glyph 1.1267 + * names that can be accessed through @FT_Get_Glyph_Name. 1.1268 + * 1.1269 + */ 1.1270 +#define FT_HAS_GLYPH_NAMES( face ) \ 1.1271 + ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) 1.1272 + 1.1273 + 1.1274 + /************************************************************************* 1.1275 + * 1.1276 + * @macro: 1.1277 + * FT_HAS_MULTIPLE_MASTERS( face ) 1.1278 + * 1.1279 + * @description: 1.1280 + * A macro that returns true whenever a face object contains some 1.1281 + * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H 1.1282 + * are then available to choose the exact design you want. 1.1283 + * 1.1284 + */ 1.1285 +#define FT_HAS_MULTIPLE_MASTERS( face ) \ 1.1286 + ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) 1.1287 + 1.1288 + 1.1289 + /************************************************************************* 1.1290 + * 1.1291 + * @macro: 1.1292 + * FT_IS_CID_KEYED( face ) 1.1293 + * 1.1294 + * @description: 1.1295 + * A macro that returns true whenever a face object contains a CID-keyed 1.1296 + * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more 1.1297 + * details. 1.1298 + * 1.1299 + * If this macro is true, all functions defined in @FT_CID_H are 1.1300 + * available. 1.1301 + * 1.1302 + */ 1.1303 +#define FT_IS_CID_KEYED( face ) \ 1.1304 + ( face->face_flags & FT_FACE_FLAG_CID_KEYED ) 1.1305 + 1.1306 + 1.1307 + /************************************************************************* 1.1308 + * 1.1309 + * @macro: 1.1310 + * FT_IS_TRICKY( face ) 1.1311 + * 1.1312 + * @description: 1.1313 + * A macro that returns true whenever a face represents a `tricky' font. 1.1314 + * See the discussion of @FT_FACE_FLAG_TRICKY for more details. 1.1315 + * 1.1316 + */ 1.1317 +#define FT_IS_TRICKY( face ) \ 1.1318 + ( face->face_flags & FT_FACE_FLAG_TRICKY ) 1.1319 + 1.1320 + 1.1321 + /************************************************************************* 1.1322 + * 1.1323 + * @macro: 1.1324 + * FT_HAS_COLOR( face ) 1.1325 + * 1.1326 + * @description: 1.1327 + * A macro that returns true whenever a face object contains 1.1328 + * tables for color glyphs. 1.1329 + * 1.1330 + */ 1.1331 +#define FT_HAS_COLOR( face ) \ 1.1332 + ( face->face_flags & FT_FACE_FLAG_COLOR ) 1.1333 + 1.1334 + 1.1335 + /*************************************************************************/ 1.1336 + /* */ 1.1337 + /* <Const> */ 1.1338 + /* FT_STYLE_FLAG_XXX */ 1.1339 + /* */ 1.1340 + /* <Description> */ 1.1341 + /* A list of bit-flags used to indicate the style of a given face. */ 1.1342 + /* These are used in the `style_flags' field of @FT_FaceRec. */ 1.1343 + /* */ 1.1344 + /* <Values> */ 1.1345 + /* FT_STYLE_FLAG_ITALIC :: */ 1.1346 + /* Indicates that a given face style is italic or oblique. */ 1.1347 + /* */ 1.1348 + /* FT_STYLE_FLAG_BOLD :: */ 1.1349 + /* Indicates that a given face is bold. */ 1.1350 + /* */ 1.1351 + /* <Note> */ 1.1352 + /* The style information as provided by FreeType is very basic. More */ 1.1353 + /* details are beyond the scope and should be done on a higher level */ 1.1354 + /* (for example, by analyzing various fields of the `OS/2' table in */ 1.1355 + /* SFNT based fonts). */ 1.1356 + /* */ 1.1357 +#define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) 1.1358 +#define FT_STYLE_FLAG_BOLD ( 1 << 1 ) 1.1359 + 1.1360 + 1.1361 + /*************************************************************************/ 1.1362 + /* */ 1.1363 + /* <Type> */ 1.1364 + /* FT_Size_Internal */ 1.1365 + /* */ 1.1366 + /* <Description> */ 1.1367 + /* An opaque handle to an `FT_Size_InternalRec' structure, used to */ 1.1368 + /* model private data of a given @FT_Size object. */ 1.1369 + /* */ 1.1370 + typedef struct FT_Size_InternalRec_* FT_Size_Internal; 1.1371 + 1.1372 + 1.1373 + /*************************************************************************/ 1.1374 + /* */ 1.1375 + /* <Struct> */ 1.1376 + /* FT_Size_Metrics */ 1.1377 + /* */ 1.1378 + /* <Description> */ 1.1379 + /* The size metrics structure gives the metrics of a size object. */ 1.1380 + /* */ 1.1381 + /* <Fields> */ 1.1382 + /* x_ppem :: The width of the scaled EM square in pixels, hence */ 1.1383 + /* the term `ppem' (pixels per EM). It is also */ 1.1384 + /* referred to as `nominal width'. */ 1.1385 + /* */ 1.1386 + /* y_ppem :: The height of the scaled EM square in pixels, */ 1.1387 + /* hence the term `ppem' (pixels per EM). It is also */ 1.1388 + /* referred to as `nominal height'. */ 1.1389 + /* */ 1.1390 + /* x_scale :: A 16.16 fractional scaling value used to convert */ 1.1391 + /* horizontal metrics from font units to 26.6 */ 1.1392 + /* fractional pixels. Only relevant for scalable */ 1.1393 + /* font formats. */ 1.1394 + /* */ 1.1395 + /* y_scale :: A 16.16 fractional scaling value used to convert */ 1.1396 + /* vertical metrics from font units to 26.6 */ 1.1397 + /* fractional pixels. Only relevant for scalable */ 1.1398 + /* font formats. */ 1.1399 + /* */ 1.1400 + /* ascender :: The ascender in 26.6 fractional pixels. See */ 1.1401 + /* @FT_FaceRec for the details. */ 1.1402 + /* */ 1.1403 + /* descender :: The descender in 26.6 fractional pixels. See */ 1.1404 + /* @FT_FaceRec for the details. */ 1.1405 + /* */ 1.1406 + /* height :: The height in 26.6 fractional pixels. See */ 1.1407 + /* @FT_FaceRec for the details. */ 1.1408 + /* */ 1.1409 + /* max_advance :: The maximum advance width in 26.6 fractional */ 1.1410 + /* pixels. See @FT_FaceRec for the details. */ 1.1411 + /* */ 1.1412 + /* <Note> */ 1.1413 + /* The scaling values, if relevant, are determined first during a */ 1.1414 + /* size changing operation. The remaining fields are then set by the */ 1.1415 + /* driver. For scalable formats, they are usually set to scaled */ 1.1416 + /* values of the corresponding fields in @FT_FaceRec. */ 1.1417 + /* */ 1.1418 + /* Note that due to glyph hinting, these values might not be exact */ 1.1419 + /* for certain fonts. Thus they must be treated as unreliable */ 1.1420 + /* with an error margin of at least one pixel! */ 1.1421 + /* */ 1.1422 + /* Indeed, the only way to get the exact metrics is to render _all_ */ 1.1423 + /* glyphs. As this would be a definite performance hit, it is up to */ 1.1424 + /* client applications to perform such computations. */ 1.1425 + /* */ 1.1426 + /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ 1.1427 + /* */ 1.1428 + typedef struct FT_Size_Metrics_ 1.1429 + { 1.1430 + FT_UShort x_ppem; /* horizontal pixels per EM */ 1.1431 + FT_UShort y_ppem; /* vertical pixels per EM */ 1.1432 + 1.1433 + FT_Fixed x_scale; /* scaling values used to convert font */ 1.1434 + FT_Fixed y_scale; /* units to 26.6 fractional pixels */ 1.1435 + 1.1436 + FT_Pos ascender; /* ascender in 26.6 frac. pixels */ 1.1437 + FT_Pos descender; /* descender in 26.6 frac. pixels */ 1.1438 + FT_Pos height; /* text height in 26.6 frac. pixels */ 1.1439 + FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */ 1.1440 + 1.1441 + } FT_Size_Metrics; 1.1442 + 1.1443 + 1.1444 + /*************************************************************************/ 1.1445 + /* */ 1.1446 + /* <Struct> */ 1.1447 + /* FT_SizeRec */ 1.1448 + /* */ 1.1449 + /* <Description> */ 1.1450 + /* FreeType root size class structure. A size object models a face */ 1.1451 + /* object at a given size. */ 1.1452 + /* */ 1.1453 + /* <Fields> */ 1.1454 + /* face :: Handle to the parent face object. */ 1.1455 + /* */ 1.1456 + /* generic :: A typeless pointer, unused by the FreeType library or */ 1.1457 + /* any of its drivers. It can be used by client */ 1.1458 + /* applications to link their own data to each size */ 1.1459 + /* object. */ 1.1460 + /* */ 1.1461 + /* metrics :: Metrics for this size object. This field is read-only. */ 1.1462 + /* */ 1.1463 + typedef struct FT_SizeRec_ 1.1464 + { 1.1465 + FT_Face face; /* parent face object */ 1.1466 + FT_Generic generic; /* generic pointer for client uses */ 1.1467 + FT_Size_Metrics metrics; /* size metrics */ 1.1468 + FT_Size_Internal internal; 1.1469 + 1.1470 + } FT_SizeRec; 1.1471 + 1.1472 + 1.1473 + /*************************************************************************/ 1.1474 + /* */ 1.1475 + /* <Struct> */ 1.1476 + /* FT_SubGlyph */ 1.1477 + /* */ 1.1478 + /* <Description> */ 1.1479 + /* The subglyph structure is an internal object used to describe */ 1.1480 + /* subglyphs (for example, in the case of composites). */ 1.1481 + /* */ 1.1482 + /* <Note> */ 1.1483 + /* The subglyph implementation is not part of the high-level API, */ 1.1484 + /* hence the forward structure declaration. */ 1.1485 + /* */ 1.1486 + /* You can however retrieve subglyph information with */ 1.1487 + /* @FT_Get_SubGlyph_Info. */ 1.1488 + /* */ 1.1489 + typedef struct FT_SubGlyphRec_* FT_SubGlyph; 1.1490 + 1.1491 + 1.1492 + /*************************************************************************/ 1.1493 + /* */ 1.1494 + /* <Type> */ 1.1495 + /* FT_Slot_Internal */ 1.1496 + /* */ 1.1497 + /* <Description> */ 1.1498 + /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */ 1.1499 + /* model private data of a given @FT_GlyphSlot object. */ 1.1500 + /* */ 1.1501 + typedef struct FT_Slot_InternalRec_* FT_Slot_Internal; 1.1502 + 1.1503 + 1.1504 + /*************************************************************************/ 1.1505 + /* */ 1.1506 + /* <Struct> */ 1.1507 + /* FT_GlyphSlotRec */ 1.1508 + /* */ 1.1509 + /* <Description> */ 1.1510 + /* FreeType root glyph slot class structure. A glyph slot is a */ 1.1511 + /* container where individual glyphs can be loaded, be they in */ 1.1512 + /* outline or bitmap format. */ 1.1513 + /* */ 1.1514 + /* <Fields> */ 1.1515 + /* library :: A handle to the FreeType library instance */ 1.1516 + /* this slot belongs to. */ 1.1517 + /* */ 1.1518 + /* face :: A handle to the parent face object. */ 1.1519 + /* */ 1.1520 + /* next :: In some cases (like some font tools), several */ 1.1521 + /* glyph slots per face object can be a good */ 1.1522 + /* thing. As this is rare, the glyph slots are */ 1.1523 + /* listed through a direct, single-linked list */ 1.1524 + /* using its `next' field. */ 1.1525 + /* */ 1.1526 + /* generic :: A typeless pointer unused by the FreeType */ 1.1527 + /* library or any of its drivers. It can be */ 1.1528 + /* used by client applications to link their own */ 1.1529 + /* data to each glyph slot object. */ 1.1530 + /* */ 1.1531 + /* metrics :: The metrics of the last loaded glyph in the */ 1.1532 + /* slot. The returned values depend on the last */ 1.1533 + /* load flags (see the @FT_Load_Glyph API */ 1.1534 + /* function) and can be expressed either in 26.6 */ 1.1535 + /* fractional pixels or font units. */ 1.1536 + /* */ 1.1537 + /* Note that even when the glyph image is */ 1.1538 + /* transformed, the metrics are not. */ 1.1539 + /* */ 1.1540 + /* linearHoriAdvance :: The advance width of the unhinted glyph. */ 1.1541 + /* Its value is expressed in 16.16 fractional */ 1.1542 + /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ 1.1543 + /* when loading the glyph. This field can be */ 1.1544 + /* important to perform correct WYSIWYG layout. */ 1.1545 + /* Only relevant for outline glyphs. */ 1.1546 + /* */ 1.1547 + /* linearVertAdvance :: The advance height of the unhinted glyph. */ 1.1548 + /* Its value is expressed in 16.16 fractional */ 1.1549 + /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */ 1.1550 + /* when loading the glyph. This field can be */ 1.1551 + /* important to perform correct WYSIWYG layout. */ 1.1552 + /* Only relevant for outline glyphs. */ 1.1553 + /* */ 1.1554 + /* advance :: This shorthand is, depending on */ 1.1555 + /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */ 1.1556 + /* (hinted) advance width for the glyph, in 26.6 */ 1.1557 + /* fractional pixel format. As specified with */ 1.1558 + /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */ 1.1559 + /* `horiAdvance' or the `vertAdvance' value of */ 1.1560 + /* `metrics' field. */ 1.1561 + /* */ 1.1562 + /* format :: This field indicates the format of the image */ 1.1563 + /* contained in the glyph slot. Typically */ 1.1564 + /* @FT_GLYPH_FORMAT_BITMAP, */ 1.1565 + /* @FT_GLYPH_FORMAT_OUTLINE, or */ 1.1566 + /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */ 1.1567 + /* possible. */ 1.1568 + /* */ 1.1569 + /* bitmap :: This field is used as a bitmap descriptor */ 1.1570 + /* when the slot format is */ 1.1571 + /* @FT_GLYPH_FORMAT_BITMAP. Note that the */ 1.1572 + /* address and content of the bitmap buffer can */ 1.1573 + /* change between calls of @FT_Load_Glyph and a */ 1.1574 + /* few other functions. */ 1.1575 + /* */ 1.1576 + /* bitmap_left :: This is the bitmap's left bearing expressed */ 1.1577 + /* in integer pixels. Of course, this is only */ 1.1578 + /* valid if the format is */ 1.1579 + /* @FT_GLYPH_FORMAT_BITMAP. */ 1.1580 + /* */ 1.1581 + /* bitmap_top :: This is the bitmap's top bearing expressed in */ 1.1582 + /* integer pixels. Remember that this is the */ 1.1583 + /* distance from the baseline to the top-most */ 1.1584 + /* glyph scanline, upwards y~coordinates being */ 1.1585 + /* *positive*. */ 1.1586 + /* */ 1.1587 + /* outline :: The outline descriptor for the current glyph */ 1.1588 + /* image if its format is */ 1.1589 + /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */ 1.1590 + /* loaded, `outline' can be transformed, */ 1.1591 + /* distorted, embolded, etc. However, it must */ 1.1592 + /* not be freed. */ 1.1593 + /* */ 1.1594 + /* num_subglyphs :: The number of subglyphs in a composite glyph. */ 1.1595 + /* This field is only valid for the composite */ 1.1596 + /* glyph format that should normally only be */ 1.1597 + /* loaded with the @FT_LOAD_NO_RECURSE flag. */ 1.1598 + /* For now this is internal to FreeType. */ 1.1599 + /* */ 1.1600 + /* subglyphs :: An array of subglyph descriptors for */ 1.1601 + /* composite glyphs. There are `num_subglyphs' */ 1.1602 + /* elements in there. Currently internal to */ 1.1603 + /* FreeType. */ 1.1604 + /* */ 1.1605 + /* control_data :: Certain font drivers can also return the */ 1.1606 + /* control data for a given glyph image (e.g. */ 1.1607 + /* TrueType bytecode, Type~1 charstrings, etc.). */ 1.1608 + /* This field is a pointer to such data. */ 1.1609 + /* */ 1.1610 + /* control_len :: This is the length in bytes of the control */ 1.1611 + /* data. */ 1.1612 + /* */ 1.1613 + /* other :: Really wicked formats can use this pointer to */ 1.1614 + /* present their own glyph image to client */ 1.1615 + /* applications. Note that the application */ 1.1616 + /* needs to know about the image format. */ 1.1617 + /* */ 1.1618 + /* lsb_delta :: The difference between hinted and unhinted */ 1.1619 + /* left side bearing while autohinting is */ 1.1620 + /* active. Zero otherwise. */ 1.1621 + /* */ 1.1622 + /* rsb_delta :: The difference between hinted and unhinted */ 1.1623 + /* right side bearing while autohinting is */ 1.1624 + /* active. Zero otherwise. */ 1.1625 + /* */ 1.1626 + /* <Note> */ 1.1627 + /* If @FT_Load_Glyph is called with default flags (see */ 1.1628 + /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */ 1.1629 + /* its native format (e.g., an outline glyph for TrueType and Type~1 */ 1.1630 + /* formats). */ 1.1631 + /* */ 1.1632 + /* This image can later be converted into a bitmap by calling */ 1.1633 + /* @FT_Render_Glyph. This function finds the current renderer for */ 1.1634 + /* the native image's format, then invokes it. */ 1.1635 + /* */ 1.1636 + /* The renderer is in charge of transforming the native image through */ 1.1637 + /* the slot's face transformation fields, then converting it into a */ 1.1638 + /* bitmap that is returned in `slot->bitmap'. */ 1.1639 + /* */ 1.1640 + /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */ 1.1641 + /* to specify the position of the bitmap relative to the current pen */ 1.1642 + /* position (e.g., coordinates (0,0) on the baseline). Of course, */ 1.1643 + /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ 1.1644 + /* */ 1.1645 + /* <Note> */ 1.1646 + /* Here a small pseudo code fragment that shows how to use */ 1.1647 + /* `lsb_delta' and `rsb_delta': */ 1.1648 + /* */ 1.1649 + /* { */ 1.1650 + /* FT_Pos origin_x = 0; */ 1.1651 + /* FT_Pos prev_rsb_delta = 0; */ 1.1652 + /* */ 1.1653 + /* */ 1.1654 + /* for all glyphs do */ 1.1655 + /* <compute kern between current and previous glyph and add it to */ 1.1656 + /* `origin_x'> */ 1.1657 + /* */ 1.1658 + /* <load glyph with `FT_Load_Glyph'> */ 1.1659 + /* */ 1.1660 + /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ 1.1661 + /* origin_x -= 64; */ 1.1662 + /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ 1.1663 + /* origin_x += 64; */ 1.1664 + /* */ 1.1665 + /* prev_rsb_delta = face->glyph->rsb_delta; */ 1.1666 + /* */ 1.1667 + /* <save glyph image, or render glyph, or ...> */ 1.1668 + /* */ 1.1669 + /* origin_x += face->glyph->advance.x; */ 1.1670 + /* endfor */ 1.1671 + /* } */ 1.1672 + /* */ 1.1673 + typedef struct FT_GlyphSlotRec_ 1.1674 + { 1.1675 + FT_Library library; 1.1676 + FT_Face face; 1.1677 + FT_GlyphSlot next; 1.1678 + FT_UInt reserved; /* retained for binary compatibility */ 1.1679 + FT_Generic generic; 1.1680 + 1.1681 + FT_Glyph_Metrics metrics; 1.1682 + FT_Fixed linearHoriAdvance; 1.1683 + FT_Fixed linearVertAdvance; 1.1684 + FT_Vector advance; 1.1685 + 1.1686 + FT_Glyph_Format format; 1.1687 + 1.1688 + FT_Bitmap bitmap; 1.1689 + FT_Int bitmap_left; 1.1690 + FT_Int bitmap_top; 1.1691 + 1.1692 + FT_Outline outline; 1.1693 + 1.1694 + FT_UInt num_subglyphs; 1.1695 + FT_SubGlyph subglyphs; 1.1696 + 1.1697 + void* control_data; 1.1698 + long control_len; 1.1699 + 1.1700 + FT_Pos lsb_delta; 1.1701 + FT_Pos rsb_delta; 1.1702 + 1.1703 + void* other; 1.1704 + 1.1705 + FT_Slot_Internal internal; 1.1706 + 1.1707 + } FT_GlyphSlotRec; 1.1708 + 1.1709 + 1.1710 + /*************************************************************************/ 1.1711 + /*************************************************************************/ 1.1712 + /* */ 1.1713 + /* F U N C T I O N S */ 1.1714 + /* */ 1.1715 + /*************************************************************************/ 1.1716 + /*************************************************************************/ 1.1717 + 1.1718 + 1.1719 + /*************************************************************************/ 1.1720 + /* */ 1.1721 + /* <Function> */ 1.1722 + /* FT_Init_FreeType */ 1.1723 + /* */ 1.1724 + /* <Description> */ 1.1725 + /* Initialize a new FreeType library object. The set of modules */ 1.1726 + /* that are registered by this function is determined at build time. */ 1.1727 + /* */ 1.1728 + /* <Output> */ 1.1729 + /* alibrary :: A handle to a new library object. */ 1.1730 + /* */ 1.1731 + /* <Return> */ 1.1732 + /* FreeType error code. 0~means success. */ 1.1733 + /* */ 1.1734 + /* <Note> */ 1.1735 + /* In case you want to provide your own memory allocating routines, */ 1.1736 + /* use @FT_New_Library instead, followed by a call to */ 1.1737 + /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */ 1.1738 + /* */ 1.1739 + /* For multi-threading applications each thread should have its own */ 1.1740 + /* FT_Library object. */ 1.1741 + /* */ 1.1742 + /* If you need reference-counting (cf. @FT_Reference_Library), use */ 1.1743 + /* @FT_New_Library and @FT_Done_Library. */ 1.1744 + /* */ 1.1745 + FT_EXPORT( FT_Error ) 1.1746 + FT_Init_FreeType( FT_Library *alibrary ); 1.1747 + 1.1748 + 1.1749 + /*************************************************************************/ 1.1750 + /* */ 1.1751 + /* <Function> */ 1.1752 + /* FT_Done_FreeType */ 1.1753 + /* */ 1.1754 + /* <Description> */ 1.1755 + /* Destroy a given FreeType library object and all of its children, */ 1.1756 + /* including resources, drivers, faces, sizes, etc. */ 1.1757 + /* */ 1.1758 + /* <Input> */ 1.1759 + /* library :: A handle to the target library object. */ 1.1760 + /* */ 1.1761 + /* <Return> */ 1.1762 + /* FreeType error code. 0~means success. */ 1.1763 + /* */ 1.1764 + FT_EXPORT( FT_Error ) 1.1765 + FT_Done_FreeType( FT_Library library ); 1.1766 + 1.1767 + 1.1768 + /*************************************************************************/ 1.1769 + /* */ 1.1770 + /* <Enum> */ 1.1771 + /* FT_OPEN_XXX */ 1.1772 + /* */ 1.1773 + /* <Description> */ 1.1774 + /* A list of bit-field constants used within the `flags' field of the */ 1.1775 + /* @FT_Open_Args structure. */ 1.1776 + /* */ 1.1777 + /* <Values> */ 1.1778 + /* FT_OPEN_MEMORY :: This is a memory-based stream. */ 1.1779 + /* */ 1.1780 + /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */ 1.1781 + /* */ 1.1782 + /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */ 1.1783 + /* name. */ 1.1784 + /* */ 1.1785 + /* FT_OPEN_DRIVER :: Use the `driver' field. */ 1.1786 + /* */ 1.1787 + /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ 1.1788 + /* */ 1.1789 + /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ 1.1790 + /* */ 1.1791 + /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ 1.1792 + /* */ 1.1793 + /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ 1.1794 + /* */ 1.1795 + /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ 1.1796 + /* */ 1.1797 + /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ 1.1798 + /* */ 1.1799 + /* <Note> */ 1.1800 + /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ 1.1801 + /* flags are mutually exclusive. */ 1.1802 + /* */ 1.1803 +#define FT_OPEN_MEMORY 0x1 1.1804 +#define FT_OPEN_STREAM 0x2 1.1805 +#define FT_OPEN_PATHNAME 0x4 1.1806 +#define FT_OPEN_DRIVER 0x8 1.1807 +#define FT_OPEN_PARAMS 0x10 1.1808 + 1.1809 +#define ft_open_memory FT_OPEN_MEMORY /* deprecated */ 1.1810 +#define ft_open_stream FT_OPEN_STREAM /* deprecated */ 1.1811 +#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ 1.1812 +#define ft_open_driver FT_OPEN_DRIVER /* deprecated */ 1.1813 +#define ft_open_params FT_OPEN_PARAMS /* deprecated */ 1.1814 + 1.1815 + 1.1816 + /*************************************************************************/ 1.1817 + /* */ 1.1818 + /* <Struct> */ 1.1819 + /* FT_Parameter */ 1.1820 + /* */ 1.1821 + /* <Description> */ 1.1822 + /* A simple structure used to pass more or less generic parameters to */ 1.1823 + /* @FT_Open_Face. */ 1.1824 + /* */ 1.1825 + /* <Fields> */ 1.1826 + /* tag :: A four-byte identification tag. */ 1.1827 + /* */ 1.1828 + /* data :: A pointer to the parameter data. */ 1.1829 + /* */ 1.1830 + /* <Note> */ 1.1831 + /* The ID and function of parameters are driver-specific. See the */ 1.1832 + /* various FT_PARAM_TAG_XXX flags for more information. */ 1.1833 + /* */ 1.1834 + typedef struct FT_Parameter_ 1.1835 + { 1.1836 + FT_ULong tag; 1.1837 + FT_Pointer data; 1.1838 + 1.1839 + } FT_Parameter; 1.1840 + 1.1841 + 1.1842 + /*************************************************************************/ 1.1843 + /* */ 1.1844 + /* <Struct> */ 1.1845 + /* FT_Open_Args */ 1.1846 + /* */ 1.1847 + /* <Description> */ 1.1848 + /* A structure used to indicate how to open a new font file or */ 1.1849 + /* stream. A pointer to such a structure can be used as a parameter */ 1.1850 + /* for the functions @FT_Open_Face and @FT_Attach_Stream. */ 1.1851 + /* */ 1.1852 + /* <Fields> */ 1.1853 + /* flags :: A set of bit flags indicating how to use the */ 1.1854 + /* structure. */ 1.1855 + /* */ 1.1856 + /* memory_base :: The first byte of the file in memory. */ 1.1857 + /* */ 1.1858 + /* memory_size :: The size in bytes of the file in memory. */ 1.1859 + /* */ 1.1860 + /* pathname :: A pointer to an 8-bit file pathname. */ 1.1861 + /* */ 1.1862 + /* stream :: A handle to a source stream object. */ 1.1863 + /* */ 1.1864 + /* driver :: This field is exclusively used by @FT_Open_Face; */ 1.1865 + /* it simply specifies the font driver to use to open */ 1.1866 + /* the face. If set to~0, FreeType tries to load the */ 1.1867 + /* face with each one of the drivers in its list. */ 1.1868 + /* */ 1.1869 + /* num_params :: The number of extra parameters. */ 1.1870 + /* */ 1.1871 + /* params :: Extra parameters passed to the font driver when */ 1.1872 + /* opening a new face. */ 1.1873 + /* */ 1.1874 + /* <Note> */ 1.1875 + /* The stream type is determined by the contents of `flags' that */ 1.1876 + /* are tested in the following order by @FT_Open_Face: */ 1.1877 + /* */ 1.1878 + /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ 1.1879 + /* memory file of `memory_size' bytes, located at `memory_address'. */ 1.1880 + /* The data are are not copied, and the client is responsible for */ 1.1881 + /* releasing and destroying them _after_ the corresponding call to */ 1.1882 + /* @FT_Done_Face. */ 1.1883 + /* */ 1.1884 + /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ 1.1885 + /* custom input stream `stream' is used. */ 1.1886 + /* */ 1.1887 + /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ 1.1888 + /* is a normal file and use `pathname' to open it. */ 1.1889 + /* */ 1.1890 + /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */ 1.1891 + /* open the file with the driver whose handler is in `driver'. */ 1.1892 + /* */ 1.1893 + /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ 1.1894 + /* `num_params' and `params' is used. They are ignored otherwise. */ 1.1895 + /* */ 1.1896 + /* Ideally, both the `pathname' and `params' fields should be tagged */ 1.1897 + /* as `const'; this is missing for API backwards compatibility. In */ 1.1898 + /* other words, applications should treat them as read-only. */ 1.1899 + /* */ 1.1900 + typedef struct FT_Open_Args_ 1.1901 + { 1.1902 + FT_UInt flags; 1.1903 + const FT_Byte* memory_base; 1.1904 + FT_Long memory_size; 1.1905 + FT_String* pathname; 1.1906 + FT_Stream stream; 1.1907 + FT_Module driver; 1.1908 + FT_Int num_params; 1.1909 + FT_Parameter* params; 1.1910 + 1.1911 + } FT_Open_Args; 1.1912 + 1.1913 + 1.1914 + /*************************************************************************/ 1.1915 + /* */ 1.1916 + /* <Function> */ 1.1917 + /* FT_New_Face */ 1.1918 + /* */ 1.1919 + /* <Description> */ 1.1920 + /* This function calls @FT_Open_Face to open a font by its pathname. */ 1.1921 + /* */ 1.1922 + /* <InOut> */ 1.1923 + /* library :: A handle to the library resource. */ 1.1924 + /* */ 1.1925 + /* <Input> */ 1.1926 + /* pathname :: A path to the font file. */ 1.1927 + /* */ 1.1928 + /* face_index :: The index of the face within the font. The first */ 1.1929 + /* face has index~0. */ 1.1930 + /* */ 1.1931 + /* <Output> */ 1.1932 + /* aface :: A handle to a new face object. If `face_index' is */ 1.1933 + /* greater than or equal to zero, it must be non-NULL. */ 1.1934 + /* See @FT_Open_Face for more details. */ 1.1935 + /* */ 1.1936 + /* <Return> */ 1.1937 + /* FreeType error code. 0~means success. */ 1.1938 + /* */ 1.1939 + /* <Note> */ 1.1940 + /* Use @FT_Done_Face to destroy the created @FT_Face object (along */ 1.1941 + /* with its slot and sizes). */ 1.1942 + /* */ 1.1943 + FT_EXPORT( FT_Error ) 1.1944 + FT_New_Face( FT_Library library, 1.1945 + const char* filepathname, 1.1946 + FT_Long face_index, 1.1947 + FT_Face *aface ); 1.1948 + 1.1949 + 1.1950 + /*************************************************************************/ 1.1951 + /* */ 1.1952 + /* <Function> */ 1.1953 + /* FT_New_Memory_Face */ 1.1954 + /* */ 1.1955 + /* <Description> */ 1.1956 + /* This function calls @FT_Open_Face to open a font that has been */ 1.1957 + /* loaded into memory. */ 1.1958 + /* */ 1.1959 + /* <InOut> */ 1.1960 + /* library :: A handle to the library resource. */ 1.1961 + /* */ 1.1962 + /* <Input> */ 1.1963 + /* file_base :: A pointer to the beginning of the font data. */ 1.1964 + /* */ 1.1965 + /* file_size :: The size of the memory chunk used by the font data. */ 1.1966 + /* */ 1.1967 + /* face_index :: The index of the face within the font. The first */ 1.1968 + /* face has index~0. */ 1.1969 + /* */ 1.1970 + /* <Output> */ 1.1971 + /* aface :: A handle to a new face object. If `face_index' is */ 1.1972 + /* greater than or equal to zero, it must be non-NULL. */ 1.1973 + /* See @FT_Open_Face for more details. */ 1.1974 + /* */ 1.1975 + /* <Return> */ 1.1976 + /* FreeType error code. 0~means success. */ 1.1977 + /* */ 1.1978 + /* <Note> */ 1.1979 + /* You must not deallocate the memory before calling @FT_Done_Face. */ 1.1980 + /* */ 1.1981 + FT_EXPORT( FT_Error ) 1.1982 + FT_New_Memory_Face( FT_Library library, 1.1983 + const FT_Byte* file_base, 1.1984 + FT_Long file_size, 1.1985 + FT_Long face_index, 1.1986 + FT_Face *aface ); 1.1987 + 1.1988 + 1.1989 + /*************************************************************************/ 1.1990 + /* */ 1.1991 + /* <Function> */ 1.1992 + /* FT_Open_Face */ 1.1993 + /* */ 1.1994 + /* <Description> */ 1.1995 + /* Create a face object from a given resource described by */ 1.1996 + /* @FT_Open_Args. */ 1.1997 + /* */ 1.1998 + /* <InOut> */ 1.1999 + /* library :: A handle to the library resource. */ 1.2000 + /* */ 1.2001 + /* <Input> */ 1.2002 + /* args :: A pointer to an `FT_Open_Args' structure that must */ 1.2003 + /* be filled by the caller. */ 1.2004 + /* */ 1.2005 + /* face_index :: The index of the face within the font. The first */ 1.2006 + /* face has index~0. */ 1.2007 + /* */ 1.2008 + /* <Output> */ 1.2009 + /* aface :: A handle to a new face object. If `face_index' is */ 1.2010 + /* greater than or equal to zero, it must be non-NULL. */ 1.2011 + /* See note below. */ 1.2012 + /* */ 1.2013 + /* <Return> */ 1.2014 + /* FreeType error code. 0~means success. */ 1.2015 + /* */ 1.2016 + /* <Note> */ 1.2017 + /* Unlike FreeType 1.x, this function automatically creates a glyph */ 1.2018 + /* slot for the face object that can be accessed directly through */ 1.2019 + /* `face->glyph'. */ 1.2020 + /* */ 1.2021 + /* FT_Open_Face can be used to quickly check whether the font */ 1.2022 + /* format of a given font resource is supported by FreeType. If the */ 1.2023 + /* `face_index' field is negative, the function's return value is~0 */ 1.2024 + /* if the font format is recognized, or non-zero otherwise; */ 1.2025 + /* the function returns a more or less empty face handle in `*aface' */ 1.2026 + /* (if `aface' isn't NULL). The only useful field in this special */ 1.2027 + /* case is `face->num_faces' that gives the number of faces within */ 1.2028 + /* the font file. After examination, the returned @FT_Face structure */ 1.2029 + /* should be deallocated with a call to @FT_Done_Face. */ 1.2030 + /* */ 1.2031 + /* Each new face object created with this function also owns a */ 1.2032 + /* default @FT_Size object, accessible as `face->size'. */ 1.2033 + /* */ 1.2034 + /* One @FT_Library instance can have multiple face objects, this is, */ 1.2035 + /* @FT_Open_Face and its siblings can be called multiple times using */ 1.2036 + /* the same `library' argument. */ 1.2037 + /* */ 1.2038 + /* See the discussion of reference counters in the description of */ 1.2039 + /* @FT_Reference_Face. */ 1.2040 + /* */ 1.2041 + FT_EXPORT( FT_Error ) 1.2042 + FT_Open_Face( FT_Library library, 1.2043 + const FT_Open_Args* args, 1.2044 + FT_Long face_index, 1.2045 + FT_Face *aface ); 1.2046 + 1.2047 + 1.2048 + /*************************************************************************/ 1.2049 + /* */ 1.2050 + /* <Function> */ 1.2051 + /* FT_Attach_File */ 1.2052 + /* */ 1.2053 + /* <Description> */ 1.2054 + /* This function calls @FT_Attach_Stream to attach a file. */ 1.2055 + /* */ 1.2056 + /* <InOut> */ 1.2057 + /* face :: The target face object. */ 1.2058 + /* */ 1.2059 + /* <Input> */ 1.2060 + /* filepathname :: The pathname. */ 1.2061 + /* */ 1.2062 + /* <Return> */ 1.2063 + /* FreeType error code. 0~means success. */ 1.2064 + /* */ 1.2065 + FT_EXPORT( FT_Error ) 1.2066 + FT_Attach_File( FT_Face face, 1.2067 + const char* filepathname ); 1.2068 + 1.2069 + 1.2070 + /*************************************************************************/ 1.2071 + /* */ 1.2072 + /* <Function> */ 1.2073 + /* FT_Attach_Stream */ 1.2074 + /* */ 1.2075 + /* <Description> */ 1.2076 + /* `Attach' data to a face object. Normally, this is used to read */ 1.2077 + /* additional information for the face object. For example, you can */ 1.2078 + /* attach an AFM file that comes with a Type~1 font to get the */ 1.2079 + /* kerning values and other metrics. */ 1.2080 + /* */ 1.2081 + /* <InOut> */ 1.2082 + /* face :: The target face object. */ 1.2083 + /* */ 1.2084 + /* <Input> */ 1.2085 + /* parameters :: A pointer to @FT_Open_Args that must be filled by */ 1.2086 + /* the caller. */ 1.2087 + /* */ 1.2088 + /* <Return> */ 1.2089 + /* FreeType error code. 0~means success. */ 1.2090 + /* */ 1.2091 + /* <Note> */ 1.2092 + /* The meaning of the `attach' (i.e., what really happens when the */ 1.2093 + /* new file is read) is not fixed by FreeType itself. It really */ 1.2094 + /* depends on the font format (and thus the font driver). */ 1.2095 + /* */ 1.2096 + /* Client applications are expected to know what they are doing */ 1.2097 + /* when invoking this function. Most drivers simply do not implement */ 1.2098 + /* file attachments. */ 1.2099 + /* */ 1.2100 + FT_EXPORT( FT_Error ) 1.2101 + FT_Attach_Stream( FT_Face face, 1.2102 + FT_Open_Args* parameters ); 1.2103 + 1.2104 + 1.2105 + /*************************************************************************/ 1.2106 + /* */ 1.2107 + /* <Function> */ 1.2108 + /* FT_Reference_Face */ 1.2109 + /* */ 1.2110 + /* <Description> */ 1.2111 + /* A counter gets initialized to~1 at the time an @FT_Face structure */ 1.2112 + /* is created. This function increments the counter. @FT_Done_Face */ 1.2113 + /* then only destroys a face if the counter is~1, otherwise it simply */ 1.2114 + /* decrements the counter. */ 1.2115 + /* */ 1.2116 + /* This function helps in managing life-cycles of structures that */ 1.2117 + /* reference @FT_Face objects. */ 1.2118 + /* */ 1.2119 + /* <Input> */ 1.2120 + /* face :: A handle to a target face object. */ 1.2121 + /* */ 1.2122 + /* <Return> */ 1.2123 + /* FreeType error code. 0~means success. */ 1.2124 + /* */ 1.2125 + /* <Since> */ 1.2126 + /* 2.4.2 */ 1.2127 + /* */ 1.2128 + FT_EXPORT( FT_Error ) 1.2129 + FT_Reference_Face( FT_Face face ); 1.2130 + 1.2131 + 1.2132 + /*************************************************************************/ 1.2133 + /* */ 1.2134 + /* <Function> */ 1.2135 + /* FT_Done_Face */ 1.2136 + /* */ 1.2137 + /* <Description> */ 1.2138 + /* Discard a given face object, as well as all of its child slots and */ 1.2139 + /* sizes. */ 1.2140 + /* */ 1.2141 + /* <Input> */ 1.2142 + /* face :: A handle to a target face object. */ 1.2143 + /* */ 1.2144 + /* <Return> */ 1.2145 + /* FreeType error code. 0~means success. */ 1.2146 + /* */ 1.2147 + /* <Note> */ 1.2148 + /* See the discussion of reference counters in the description of */ 1.2149 + /* @FT_Reference_Face. */ 1.2150 + /* */ 1.2151 + FT_EXPORT( FT_Error ) 1.2152 + FT_Done_Face( FT_Face face ); 1.2153 + 1.2154 + 1.2155 + /*************************************************************************/ 1.2156 + /* */ 1.2157 + /* <Function> */ 1.2158 + /* FT_Select_Size */ 1.2159 + /* */ 1.2160 + /* <Description> */ 1.2161 + /* Select a bitmap strike. */ 1.2162 + /* */ 1.2163 + /* <InOut> */ 1.2164 + /* face :: A handle to a target face object. */ 1.2165 + /* */ 1.2166 + /* <Input> */ 1.2167 + /* strike_index :: The index of the bitmap strike in the */ 1.2168 + /* `available_sizes' field of @FT_FaceRec structure. */ 1.2169 + /* */ 1.2170 + /* <Return> */ 1.2171 + /* FreeType error code. 0~means success. */ 1.2172 + /* */ 1.2173 + FT_EXPORT( FT_Error ) 1.2174 + FT_Select_Size( FT_Face face, 1.2175 + FT_Int strike_index ); 1.2176 + 1.2177 + 1.2178 + /*************************************************************************/ 1.2179 + /* */ 1.2180 + /* <Enum> */ 1.2181 + /* FT_Size_Request_Type */ 1.2182 + /* */ 1.2183 + /* <Description> */ 1.2184 + /* An enumeration type that lists the supported size request types. */ 1.2185 + /* */ 1.2186 + /* <Values> */ 1.2187 + /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ 1.2188 + /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ 1.2189 + /* used to determine both scaling values. */ 1.2190 + /* */ 1.2191 + /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ 1.2192 + /* The real dimension. The sum of the the `ascender' and (minus */ 1.2193 + /* of) the `descender' fields of @FT_FaceRec are used to determine */ 1.2194 + /* both scaling values. */ 1.2195 + /* */ 1.2196 + /* FT_SIZE_REQUEST_TYPE_BBOX :: */ 1.2197 + /* The font bounding box. The width and height of the `bbox' field */ 1.2198 + /* of @FT_FaceRec are used to determine the horizontal and vertical */ 1.2199 + /* scaling value, respectively. */ 1.2200 + /* */ 1.2201 + /* FT_SIZE_REQUEST_TYPE_CELL :: */ 1.2202 + /* The `max_advance_width' field of @FT_FaceRec is used to */ 1.2203 + /* determine the horizontal scaling value; the vertical scaling */ 1.2204 + /* value is determined the same way as */ 1.2205 + /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */ 1.2206 + /* values are set to the smaller one. This type is useful if you */ 1.2207 + /* want to specify the font size for, say, a window of a given */ 1.2208 + /* dimension and 80x24 cells. */ 1.2209 + /* */ 1.2210 + /* FT_SIZE_REQUEST_TYPE_SCALES :: */ 1.2211 + /* Specify the scaling values directly. */ 1.2212 + /* */ 1.2213 + /* <Note> */ 1.2214 + /* The above descriptions only apply to scalable formats. For bitmap */ 1.2215 + /* formats, the behaviour is up to the driver. */ 1.2216 + /* */ 1.2217 + /* See the note section of @FT_Size_Metrics if you wonder how size */ 1.2218 + /* requesting relates to scaling values. */ 1.2219 + /* */ 1.2220 + typedef enum FT_Size_Request_Type_ 1.2221 + { 1.2222 + FT_SIZE_REQUEST_TYPE_NOMINAL, 1.2223 + FT_SIZE_REQUEST_TYPE_REAL_DIM, 1.2224 + FT_SIZE_REQUEST_TYPE_BBOX, 1.2225 + FT_SIZE_REQUEST_TYPE_CELL, 1.2226 + FT_SIZE_REQUEST_TYPE_SCALES, 1.2227 + 1.2228 + FT_SIZE_REQUEST_TYPE_MAX 1.2229 + 1.2230 + } FT_Size_Request_Type; 1.2231 + 1.2232 + 1.2233 + /*************************************************************************/ 1.2234 + /* */ 1.2235 + /* <Struct> */ 1.2236 + /* FT_Size_RequestRec */ 1.2237 + /* */ 1.2238 + /* <Description> */ 1.2239 + /* A structure used to model a size request. */ 1.2240 + /* */ 1.2241 + /* <Fields> */ 1.2242 + /* type :: See @FT_Size_Request_Type. */ 1.2243 + /* */ 1.2244 + /* width :: The desired width. */ 1.2245 + /* */ 1.2246 + /* height :: The desired height. */ 1.2247 + /* */ 1.2248 + /* horiResolution :: The horizontal resolution. If set to zero, */ 1.2249 + /* `width' is treated as a 26.6 fractional pixel */ 1.2250 + /* value. */ 1.2251 + /* */ 1.2252 + /* vertResolution :: The vertical resolution. If set to zero, */ 1.2253 + /* `height' is treated as a 26.6 fractional pixel */ 1.2254 + /* value. */ 1.2255 + /* */ 1.2256 + /* <Note> */ 1.2257 + /* If `width' is zero, then the horizontal scaling value is set equal */ 1.2258 + /* to the vertical scaling value, and vice versa. */ 1.2259 + /* */ 1.2260 + typedef struct FT_Size_RequestRec_ 1.2261 + { 1.2262 + FT_Size_Request_Type type; 1.2263 + FT_Long width; 1.2264 + FT_Long height; 1.2265 + FT_UInt horiResolution; 1.2266 + FT_UInt vertResolution; 1.2267 + 1.2268 + } FT_Size_RequestRec; 1.2269 + 1.2270 + 1.2271 + /*************************************************************************/ 1.2272 + /* */ 1.2273 + /* <Struct> */ 1.2274 + /* FT_Size_Request */ 1.2275 + /* */ 1.2276 + /* <Description> */ 1.2277 + /* A handle to a size request structure. */ 1.2278 + /* */ 1.2279 + typedef struct FT_Size_RequestRec_ *FT_Size_Request; 1.2280 + 1.2281 + 1.2282 + /*************************************************************************/ 1.2283 + /* */ 1.2284 + /* <Function> */ 1.2285 + /* FT_Request_Size */ 1.2286 + /* */ 1.2287 + /* <Description> */ 1.2288 + /* Resize the scale of the active @FT_Size object in a face. */ 1.2289 + /* */ 1.2290 + /* <InOut> */ 1.2291 + /* face :: A handle to a target face object. */ 1.2292 + /* */ 1.2293 + /* <Input> */ 1.2294 + /* req :: A pointer to a @FT_Size_RequestRec. */ 1.2295 + /* */ 1.2296 + /* <Return> */ 1.2297 + /* FreeType error code. 0~means success. */ 1.2298 + /* */ 1.2299 + /* <Note> */ 1.2300 + /* Although drivers may select the bitmap strike matching the */ 1.2301 + /* request, you should not rely on this if you intend to select a */ 1.2302 + /* particular bitmap strike. Use @FT_Select_Size instead in that */ 1.2303 + /* case. */ 1.2304 + /* */ 1.2305 + /* The relation between the requested size and the resulting glyph */ 1.2306 + /* size is dependent entirely on how the size is defined in the */ 1.2307 + /* source face. The font designer chooses the final size of each */ 1.2308 + /* glyph relative to this size. For more information refer to */ 1.2309 + /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */ 1.2310 + /* */ 1.2311 + /* Don't use this function if you are using the FreeType cache API. */ 1.2312 + /* */ 1.2313 + FT_EXPORT( FT_Error ) 1.2314 + FT_Request_Size( FT_Face face, 1.2315 + FT_Size_Request req ); 1.2316 + 1.2317 + 1.2318 + /*************************************************************************/ 1.2319 + /* */ 1.2320 + /* <Function> */ 1.2321 + /* FT_Set_Char_Size */ 1.2322 + /* */ 1.2323 + /* <Description> */ 1.2324 + /* This function calls @FT_Request_Size to request the nominal size */ 1.2325 + /* (in points). */ 1.2326 + /* */ 1.2327 + /* <InOut> */ 1.2328 + /* face :: A handle to a target face object. */ 1.2329 + /* */ 1.2330 + /* <Input> */ 1.2331 + /* char_width :: The nominal width, in 26.6 fractional points. */ 1.2332 + /* */ 1.2333 + /* char_height :: The nominal height, in 26.6 fractional points. */ 1.2334 + /* */ 1.2335 + /* horz_resolution :: The horizontal resolution in dpi. */ 1.2336 + /* */ 1.2337 + /* vert_resolution :: The vertical resolution in dpi. */ 1.2338 + /* */ 1.2339 + /* <Return> */ 1.2340 + /* FreeType error code. 0~means success. */ 1.2341 + /* */ 1.2342 + /* <Note> */ 1.2343 + /* If either the character width or height is zero, it is set equal */ 1.2344 + /* to the other value. */ 1.2345 + /* */ 1.2346 + /* If either the horizontal or vertical resolution is zero, it is set */ 1.2347 + /* equal to the other value. */ 1.2348 + /* */ 1.2349 + /* A character width or height smaller than 1pt is set to 1pt; if */ 1.2350 + /* both resolution values are zero, they are set to 72dpi. */ 1.2351 + /* */ 1.2352 + /* Don't use this function if you are using the FreeType cache API. */ 1.2353 + /* */ 1.2354 + FT_EXPORT( FT_Error ) 1.2355 + FT_Set_Char_Size( FT_Face face, 1.2356 + FT_F26Dot6 char_width, 1.2357 + FT_F26Dot6 char_height, 1.2358 + FT_UInt horz_resolution, 1.2359 + FT_UInt vert_resolution ); 1.2360 + 1.2361 + 1.2362 + /*************************************************************************/ 1.2363 + /* */ 1.2364 + /* <Function> */ 1.2365 + /* FT_Set_Pixel_Sizes */ 1.2366 + /* */ 1.2367 + /* <Description> */ 1.2368 + /* This function calls @FT_Request_Size to request the nominal size */ 1.2369 + /* (in pixels). */ 1.2370 + /* */ 1.2371 + /* <InOut> */ 1.2372 + /* face :: A handle to the target face object. */ 1.2373 + /* */ 1.2374 + /* <Input> */ 1.2375 + /* pixel_width :: The nominal width, in pixels. */ 1.2376 + /* */ 1.2377 + /* pixel_height :: The nominal height, in pixels. */ 1.2378 + /* */ 1.2379 + /* <Return> */ 1.2380 + /* FreeType error code. 0~means success. */ 1.2381 + /* */ 1.2382 + /* <Note> */ 1.2383 + /* You should not rely on the resulting glyphs matching, or being */ 1.2384 + /* constrained, to this pixel size. Refer to @FT_Request_Size to */ 1.2385 + /* understand how requested sizes relate to actual sizes. */ 1.2386 + /* */ 1.2387 + /* Don't use this function if you are using the FreeType cache API. */ 1.2388 + /* */ 1.2389 + FT_EXPORT( FT_Error ) 1.2390 + FT_Set_Pixel_Sizes( FT_Face face, 1.2391 + FT_UInt pixel_width, 1.2392 + FT_UInt pixel_height ); 1.2393 + 1.2394 + 1.2395 + /*************************************************************************/ 1.2396 + /* */ 1.2397 + /* <Function> */ 1.2398 + /* FT_Load_Glyph */ 1.2399 + /* */ 1.2400 + /* <Description> */ 1.2401 + /* A function used to load a single glyph into the glyph slot of a */ 1.2402 + /* face object. */ 1.2403 + /* */ 1.2404 + /* <InOut> */ 1.2405 + /* face :: A handle to the target face object where the glyph */ 1.2406 + /* is loaded. */ 1.2407 + /* */ 1.2408 + /* <Input> */ 1.2409 + /* glyph_index :: The index of the glyph in the font file. For */ 1.2410 + /* CID-keyed fonts (either in PS or in CFF format) */ 1.2411 + /* this argument specifies the CID value. */ 1.2412 + /* */ 1.2413 + /* load_flags :: A flag indicating what to load for this glyph. The */ 1.2414 + /* @FT_LOAD_XXX constants can be used to control the */ 1.2415 + /* glyph loading process (e.g., whether the outline */ 1.2416 + /* should be scaled, whether to load bitmaps or not, */ 1.2417 + /* whether to hint the outline, etc). */ 1.2418 + /* */ 1.2419 + /* <Return> */ 1.2420 + /* FreeType error code. 0~means success. */ 1.2421 + /* */ 1.2422 + /* <Note> */ 1.2423 + /* The loaded glyph may be transformed. See @FT_Set_Transform for */ 1.2424 + /* the details. */ 1.2425 + /* */ 1.2426 + /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ 1.2427 + /* returned for invalid CID values (this is, for CID values that */ 1.2428 + /* don't have a corresponding glyph in the font). See the discussion */ 1.2429 + /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ 1.2430 + /* */ 1.2431 + FT_EXPORT( FT_Error ) 1.2432 + FT_Load_Glyph( FT_Face face, 1.2433 + FT_UInt glyph_index, 1.2434 + FT_Int32 load_flags ); 1.2435 + 1.2436 + 1.2437 + /*************************************************************************/ 1.2438 + /* */ 1.2439 + /* <Function> */ 1.2440 + /* FT_Load_Char */ 1.2441 + /* */ 1.2442 + /* <Description> */ 1.2443 + /* A function used to load a single glyph into the glyph slot of a */ 1.2444 + /* face object, according to its character code. */ 1.2445 + /* */ 1.2446 + /* <InOut> */ 1.2447 + /* face :: A handle to a target face object where the glyph */ 1.2448 + /* is loaded. */ 1.2449 + /* */ 1.2450 + /* <Input> */ 1.2451 + /* char_code :: The glyph's character code, according to the */ 1.2452 + /* current charmap used in the face. */ 1.2453 + /* */ 1.2454 + /* load_flags :: A flag indicating what to load for this glyph. The */ 1.2455 + /* @FT_LOAD_XXX constants can be used to control the */ 1.2456 + /* glyph loading process (e.g., whether the outline */ 1.2457 + /* should be scaled, whether to load bitmaps or not, */ 1.2458 + /* whether to hint the outline, etc). */ 1.2459 + /* */ 1.2460 + /* <Return> */ 1.2461 + /* FreeType error code. 0~means success. */ 1.2462 + /* */ 1.2463 + /* <Note> */ 1.2464 + /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */ 1.2465 + /* */ 1.2466 + FT_EXPORT( FT_Error ) 1.2467 + FT_Load_Char( FT_Face face, 1.2468 + FT_ULong char_code, 1.2469 + FT_Int32 load_flags ); 1.2470 + 1.2471 + 1.2472 + /************************************************************************* 1.2473 + * 1.2474 + * @enum: 1.2475 + * FT_LOAD_XXX 1.2476 + * 1.2477 + * @description: 1.2478 + * A list of bit-field constants used with @FT_Load_Glyph to indicate 1.2479 + * what kind of operations to perform during glyph loading. 1.2480 + * 1.2481 + * @values: 1.2482 + * FT_LOAD_DEFAULT :: 1.2483 + * Corresponding to~0, this value is used as the default glyph load 1.2484 + * operation. In this case, the following happens: 1.2485 + * 1.2486 + * 1. FreeType looks for a bitmap for the glyph corresponding to the 1.2487 + * face's current size. If one is found, the function returns. 1.2488 + * The bitmap data can be accessed from the glyph slot (see note 1.2489 + * below). 1.2490 + * 1.2491 + * 2. If no embedded bitmap is searched or found, FreeType looks for a 1.2492 + * scalable outline. If one is found, it is loaded from the font 1.2493 + * file, scaled to device pixels, then `hinted' to the pixel grid 1.2494 + * in order to optimize it. The outline data can be accessed from 1.2495 + * the glyph slot (see note below). 1.2496 + * 1.2497 + * Note that by default, the glyph loader doesn't render outlines into 1.2498 + * bitmaps. The following flags are used to modify this default 1.2499 + * behaviour to more specific and useful cases. 1.2500 + * 1.2501 + * FT_LOAD_NO_SCALE :: 1.2502 + * Don't scale the loaded outline glyph but keep it in font units. 1.2503 + * 1.2504 + * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and 1.2505 + * unsets @FT_LOAD_RENDER. 1.2506 + * 1.2507 + * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using 1.2508 + * FT_LOAD_NO_SCALE usually yields meaningless outlines because the 1.2509 + * subglyphs must be scaled and positioned with hinting instructions. 1.2510 + * This can be solved by loading the font without FT_LOAD_NO_SCALE and 1.2511 + * setting the character size to `font->units_per_EM'. 1.2512 + * 1.2513 + * FT_LOAD_NO_HINTING :: 1.2514 + * Disable hinting. This generally generates `blurrier' bitmap glyphs 1.2515 + * when the glyph are rendered in any of the anti-aliased modes. See 1.2516 + * also the note below. 1.2517 + * 1.2518 + * This flag is implied by @FT_LOAD_NO_SCALE. 1.2519 + * 1.2520 + * FT_LOAD_RENDER :: 1.2521 + * Call @FT_Render_Glyph after the glyph is loaded. By default, the 1.2522 + * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be 1.2523 + * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME. 1.2524 + * 1.2525 + * This flag is unset by @FT_LOAD_NO_SCALE. 1.2526 + * 1.2527 + * FT_LOAD_NO_BITMAP :: 1.2528 + * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this 1.2529 + * flag. 1.2530 + * 1.2531 + * @FT_LOAD_NO_SCALE always sets this flag. 1.2532 + * 1.2533 + * FT_LOAD_VERTICAL_LAYOUT :: 1.2534 + * Load the glyph for vertical text layout. In particular, the 1.2535 + * `advance' value in the @FT_GlyphSlotRec structure is set to the 1.2536 + * `vertAdvance' value of the `metrics' field. 1.2537 + * 1.2538 + * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use 1.2539 + * this flag currently. Reason is that in this case vertical metrics 1.2540 + * get synthesized, and those values are not always consistent across 1.2541 + * various font formats. 1.2542 + * 1.2543 + * FT_LOAD_FORCE_AUTOHINT :: 1.2544 + * Indicates that the auto-hinter is preferred over the font's native 1.2545 + * hinter. See also the note below. 1.2546 + * 1.2547 + * FT_LOAD_CROP_BITMAP :: 1.2548 + * Indicates that the font driver should crop the loaded bitmap glyph 1.2549 + * (i.e., remove all space around its black bits). Not all drivers 1.2550 + * implement this. 1.2551 + * 1.2552 + * FT_LOAD_PEDANTIC :: 1.2553 + * Indicates that the font driver should perform pedantic verifications 1.2554 + * during glyph loading. This is mostly used to detect broken glyphs 1.2555 + * in fonts. By default, FreeType tries to handle broken fonts also. 1.2556 + * 1.2557 + * In particular, errors from the TrueType bytecode engine are not 1.2558 + * passed to the application if this flag is not set; this might 1.2559 + * result in partially hinted or distorted glyphs in case a glyph's 1.2560 + * bytecode is buggy. 1.2561 + * 1.2562 + * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: 1.2563 + * Ignored. Deprecated. 1.2564 + * 1.2565 + * FT_LOAD_NO_RECURSE :: 1.2566 + * This flag is only used internally. It merely indicates that the 1.2567 + * font driver should not load composite glyphs recursively. Instead, 1.2568 + * it should set the `num_subglyph' and `subglyphs' values of the 1.2569 + * glyph slot accordingly, and set `glyph->format' to 1.2570 + * @FT_GLYPH_FORMAT_COMPOSITE. 1.2571 + * 1.2572 + * The description of sub-glyphs is not available to client 1.2573 + * applications for now. 1.2574 + * 1.2575 + * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. 1.2576 + * 1.2577 + * FT_LOAD_IGNORE_TRANSFORM :: 1.2578 + * Indicates that the transform matrix set by @FT_Set_Transform should 1.2579 + * be ignored. 1.2580 + * 1.2581 + * FT_LOAD_MONOCHROME :: 1.2582 + * This flag is used with @FT_LOAD_RENDER to indicate that you want to 1.2583 + * render an outline glyph to a 1-bit monochrome bitmap glyph, with 1.2584 + * 8~pixels packed into each byte of the bitmap data. 1.2585 + * 1.2586 + * Note that this has no effect on the hinting algorithm used. You 1.2587 + * should rather use @FT_LOAD_TARGET_MONO so that the 1.2588 + * monochrome-optimized hinting algorithm is used. 1.2589 + * 1.2590 + * FT_LOAD_LINEAR_DESIGN :: 1.2591 + * Indicates that the `linearHoriAdvance' and `linearVertAdvance' 1.2592 + * fields of @FT_GlyphSlotRec should be kept in font units. See 1.2593 + * @FT_GlyphSlotRec for details. 1.2594 + * 1.2595 + * FT_LOAD_NO_AUTOHINT :: 1.2596 + * Disable auto-hinter. See also the note below. 1.2597 + * 1.2598 + * FT_LOAD_COLOR :: 1.2599 + * This flag is used to request loading of color embedded-bitmap 1.2600 + * images. The resulting color bitmaps, if available, will have the 1.2601 + * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color 1.2602 + * bitmaps are found, they will be converted to 256-level gray 1.2603 + * bitmaps transparently. Those bitmaps will be in the 1.2604 + * @FT_PIXEL_MODE_GRAY format. 1.2605 + * 1.2606 + * @note: 1.2607 + * By default, hinting is enabled and the font's native hinter (see 1.2608 + * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can 1.2609 + * disable hinting by setting @FT_LOAD_NO_HINTING or change the 1.2610 + * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set 1.2611 + * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be 1.2612 + * used at all. 1.2613 + * 1.2614 + * See the description of @FT_FACE_FLAG_TRICKY for a special exception 1.2615 + * (affecting only a handful of Asian fonts). 1.2616 + * 1.2617 + * Besides deciding which hinter to use, you can also decide which 1.2618 + * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details. 1.2619 + * 1.2620 + * Note that the auto-hinter needs a valid Unicode cmap (either a native 1.2621 + * one or synthesized by FreeType) for producing correct results. If a 1.2622 + * font provides an incorrect mapping (for example, assigning the 1.2623 + * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a 1.2624 + * mathematical integral sign), the auto-hinter might produce useless 1.2625 + * results. 1.2626 + * 1.2627 + */ 1.2628 +#define FT_LOAD_DEFAULT 0x0 1.2629 +#define FT_LOAD_NO_SCALE ( 1L << 0 ) 1.2630 +#define FT_LOAD_NO_HINTING ( 1L << 1 ) 1.2631 +#define FT_LOAD_RENDER ( 1L << 2 ) 1.2632 +#define FT_LOAD_NO_BITMAP ( 1L << 3 ) 1.2633 +#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) 1.2634 +#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) 1.2635 +#define FT_LOAD_CROP_BITMAP ( 1L << 6 ) 1.2636 +#define FT_LOAD_PEDANTIC ( 1L << 7 ) 1.2637 +#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) 1.2638 +#define FT_LOAD_NO_RECURSE ( 1L << 10 ) 1.2639 +#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) 1.2640 +#define FT_LOAD_MONOCHROME ( 1L << 12 ) 1.2641 +#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) 1.2642 +#define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) 1.2643 + /* Bits 16..19 are used by `FT_LOAD_TARGET_' */ 1.2644 +#define FT_LOAD_COLOR ( 1L << 20 ) 1.2645 + 1.2646 + /* */ 1.2647 + 1.2648 + /* used internally only by certain font drivers! */ 1.2649 +#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 ) 1.2650 +#define FT_LOAD_SBITS_ONLY ( 1L << 14 ) 1.2651 + 1.2652 + 1.2653 + /************************************************************************** 1.2654 + * 1.2655 + * @enum: 1.2656 + * FT_LOAD_TARGET_XXX 1.2657 + * 1.2658 + * @description: 1.2659 + * A list of values that are used to select a specific hinting algorithm 1.2660 + * to use by the hinter. You should OR one of these values to your 1.2661 + * `load_flags' when calling @FT_Load_Glyph. 1.2662 + * 1.2663 + * Note that font's native hinters may ignore the hinting algorithm you 1.2664 + * have specified (e.g., the TrueType bytecode interpreter). You can set 1.2665 + * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. 1.2666 + * 1.2667 + * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it 1.2668 + * always implies @FT_LOAD_FORCE_AUTOHINT. 1.2669 + * 1.2670 + * @values: 1.2671 + * FT_LOAD_TARGET_NORMAL :: 1.2672 + * This corresponds to the default hinting algorithm, optimized for 1.2673 + * standard gray-level rendering. For monochrome output, use 1.2674 + * @FT_LOAD_TARGET_MONO instead. 1.2675 + * 1.2676 + * FT_LOAD_TARGET_LIGHT :: 1.2677 + * A lighter hinting algorithm for non-monochrome modes. Many 1.2678 + * generated glyphs are more fuzzy but better resemble its original 1.2679 + * shape. A bit like rendering on Mac OS~X. 1.2680 + * 1.2681 + * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. 1.2682 + * 1.2683 + * FT_LOAD_TARGET_MONO :: 1.2684 + * Strong hinting algorithm that should only be used for monochrome 1.2685 + * output. The result is probably unpleasant if the glyph is rendered 1.2686 + * in non-monochrome modes. 1.2687 + * 1.2688 + * FT_LOAD_TARGET_LCD :: 1.2689 + * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally 1.2690 + * decimated LCD displays. 1.2691 + * 1.2692 + * FT_LOAD_TARGET_LCD_V :: 1.2693 + * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically 1.2694 + * decimated LCD displays. 1.2695 + * 1.2696 + * @note: 1.2697 + * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your 1.2698 + * `load_flags'. They can't be ORed. 1.2699 + * 1.2700 + * If @FT_LOAD_RENDER is also set, the glyph is rendered in the 1.2701 + * corresponding mode (i.e., the mode that matches the used algorithm 1.2702 + * best). An exeption is FT_LOAD_TARGET_MONO since it implies 1.2703 + * @FT_LOAD_MONOCHROME. 1.2704 + * 1.2705 + * You can use a hinting algorithm that doesn't correspond to the same 1.2706 + * rendering mode. As an example, it is possible to use the `light' 1.2707 + * hinting algorithm and have the results rendered in horizontal LCD 1.2708 + * pixel mode, with code like 1.2709 + * 1.2710 + * { 1.2711 + * FT_Load_Glyph( face, glyph_index, 1.2712 + * load_flags | FT_LOAD_TARGET_LIGHT ); 1.2713 + * 1.2714 + * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); 1.2715 + * } 1.2716 + * 1.2717 + */ 1.2718 +#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) 1.2719 + 1.2720 +#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) 1.2721 +#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) 1.2722 +#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) 1.2723 +#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) 1.2724 +#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) 1.2725 + 1.2726 + 1.2727 + /************************************************************************** 1.2728 + * 1.2729 + * @macro: 1.2730 + * FT_LOAD_TARGET_MODE 1.2731 + * 1.2732 + * @description: 1.2733 + * Return the @FT_Render_Mode corresponding to a given 1.2734 + * @FT_LOAD_TARGET_XXX value. 1.2735 + * 1.2736 + */ 1.2737 +#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) ) 1.2738 + 1.2739 + 1.2740 + /*************************************************************************/ 1.2741 + /* */ 1.2742 + /* <Function> */ 1.2743 + /* FT_Set_Transform */ 1.2744 + /* */ 1.2745 + /* <Description> */ 1.2746 + /* A function used to set the transformation that is applied to glyph */ 1.2747 + /* images when they are loaded into a glyph slot through */ 1.2748 + /* @FT_Load_Glyph. */ 1.2749 + /* */ 1.2750 + /* <InOut> */ 1.2751 + /* face :: A handle to the source face object. */ 1.2752 + /* */ 1.2753 + /* <Input> */ 1.2754 + /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */ 1.2755 + /* the identity matrix. */ 1.2756 + /* delta :: A pointer to the translation vector. Use~0 for the null */ 1.2757 + /* vector. */ 1.2758 + /* */ 1.2759 + /* <Note> */ 1.2760 + /* The transformation is only applied to scalable image formats after */ 1.2761 + /* the glyph has been loaded. It means that hinting is unaltered by */ 1.2762 + /* the transformation and is performed on the character size given in */ 1.2763 + /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */ 1.2764 + /* */ 1.2765 + /* Note that this also transforms the `face.glyph.advance' field, but */ 1.2766 + /* *not* the values in `face.glyph.metrics'. */ 1.2767 + /* */ 1.2768 + FT_EXPORT( void ) 1.2769 + FT_Set_Transform( FT_Face face, 1.2770 + FT_Matrix* matrix, 1.2771 + FT_Vector* delta ); 1.2772 + 1.2773 + 1.2774 + /*************************************************************************/ 1.2775 + /* */ 1.2776 + /* <Enum> */ 1.2777 + /* FT_Render_Mode */ 1.2778 + /* */ 1.2779 + /* <Description> */ 1.2780 + /* An enumeration type that lists the render modes supported by */ 1.2781 + /* FreeType~2. Each mode corresponds to a specific type of scanline */ 1.2782 + /* conversion performed on the outline. */ 1.2783 + /* */ 1.2784 + /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */ 1.2785 + /* field in the @FT_GlyphSlotRec structure gives the format of the */ 1.2786 + /* returned bitmap. */ 1.2787 + /* */ 1.2788 + /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ 1.2789 + /* */ 1.2790 + /* <Values> */ 1.2791 + /* FT_RENDER_MODE_NORMAL :: */ 1.2792 + /* This is the default render mode; it corresponds to 8-bit */ 1.2793 + /* anti-aliased bitmaps. */ 1.2794 + /* */ 1.2795 + /* FT_RENDER_MODE_LIGHT :: */ 1.2796 + /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */ 1.2797 + /* defined as a separate value because render modes are also used */ 1.2798 + /* indirectly to define hinting algorithm selectors. See */ 1.2799 + /* @FT_LOAD_TARGET_XXX for details. */ 1.2800 + /* */ 1.2801 + /* FT_RENDER_MODE_MONO :: */ 1.2802 + /* This mode corresponds to 1-bit bitmaps (with 2~levels of */ 1.2803 + /* opacity). */ 1.2804 + /* */ 1.2805 + /* FT_RENDER_MODE_LCD :: */ 1.2806 + /* This mode corresponds to horizontal RGB and BGR sub-pixel */ 1.2807 + /* displays like LCD screens. It produces 8-bit bitmaps that are */ 1.2808 + /* 3~times the width of the original glyph outline in pixels, and */ 1.2809 + /* which use the @FT_PIXEL_MODE_LCD mode. */ 1.2810 + /* */ 1.2811 + /* FT_RENDER_MODE_LCD_V :: */ 1.2812 + /* This mode corresponds to vertical RGB and BGR sub-pixel displays */ 1.2813 + /* (like PDA screens, rotated LCD displays, etc.). It produces */ 1.2814 + /* 8-bit bitmaps that are 3~times the height of the original */ 1.2815 + /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */ 1.2816 + /* */ 1.2817 + /* <Note> */ 1.2818 + /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */ 1.2819 + /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */ 1.2820 + /* (not active in the default builds). It is up to the caller to */ 1.2821 + /* either call @FT_Library_SetLcdFilter (if available) or do the */ 1.2822 + /* filtering itself. */ 1.2823 + /* */ 1.2824 + /* The selected render mode only affects vector glyphs of a font. */ 1.2825 + /* Embedded bitmaps often have a different pixel mode like */ 1.2826 + /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */ 1.2827 + /* them into 8-bit pixmaps. */ 1.2828 + /* */ 1.2829 + typedef enum FT_Render_Mode_ 1.2830 + { 1.2831 + FT_RENDER_MODE_NORMAL = 0, 1.2832 + FT_RENDER_MODE_LIGHT, 1.2833 + FT_RENDER_MODE_MONO, 1.2834 + FT_RENDER_MODE_LCD, 1.2835 + FT_RENDER_MODE_LCD_V, 1.2836 + 1.2837 + FT_RENDER_MODE_MAX 1.2838 + 1.2839 + } FT_Render_Mode; 1.2840 + 1.2841 + 1.2842 + /*************************************************************************/ 1.2843 + /* */ 1.2844 + /* <Enum> */ 1.2845 + /* ft_render_mode_xxx */ 1.2846 + /* */ 1.2847 + /* <Description> */ 1.2848 + /* These constants are deprecated. Use the corresponding */ 1.2849 + /* @FT_Render_Mode values instead. */ 1.2850 + /* */ 1.2851 + /* <Values> */ 1.2852 + /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ 1.2853 + /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ 1.2854 + /* */ 1.2855 +#define ft_render_mode_normal FT_RENDER_MODE_NORMAL 1.2856 +#define ft_render_mode_mono FT_RENDER_MODE_MONO 1.2857 + 1.2858 + 1.2859 + /*************************************************************************/ 1.2860 + /* */ 1.2861 + /* <Function> */ 1.2862 + /* FT_Render_Glyph */ 1.2863 + /* */ 1.2864 + /* <Description> */ 1.2865 + /* Convert a given glyph image to a bitmap. It does so by inspecting */ 1.2866 + /* the glyph image format, finding the relevant renderer, and */ 1.2867 + /* invoking it. */ 1.2868 + /* */ 1.2869 + /* <InOut> */ 1.2870 + /* slot :: A handle to the glyph slot containing the image to */ 1.2871 + /* convert. */ 1.2872 + /* */ 1.2873 + /* <Input> */ 1.2874 + /* render_mode :: This is the render mode used to render the glyph */ 1.2875 + /* image into a bitmap. See @FT_Render_Mode for a */ 1.2876 + /* list of possible values. */ 1.2877 + /* */ 1.2878 + /* <Return> */ 1.2879 + /* FreeType error code. 0~means success. */ 1.2880 + /* */ 1.2881 + /* <Note> */ 1.2882 + /* To get meaningful results, font scaling values must be set with */ 1.2883 + /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ 1.2884 + /* */ 1.2885 + FT_EXPORT( FT_Error ) 1.2886 + FT_Render_Glyph( FT_GlyphSlot slot, 1.2887 + FT_Render_Mode render_mode ); 1.2888 + 1.2889 + 1.2890 + /*************************************************************************/ 1.2891 + /* */ 1.2892 + /* <Enum> */ 1.2893 + /* FT_Kerning_Mode */ 1.2894 + /* */ 1.2895 + /* <Description> */ 1.2896 + /* An enumeration used to specify which kerning values to return in */ 1.2897 + /* @FT_Get_Kerning. */ 1.2898 + /* */ 1.2899 + /* <Values> */ 1.2900 + /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */ 1.2901 + /* distances (value is~0). */ 1.2902 + /* */ 1.2903 + /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */ 1.2904 + /* distances. */ 1.2905 + /* */ 1.2906 + /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */ 1.2907 + /* units. */ 1.2908 + /* */ 1.2909 + typedef enum FT_Kerning_Mode_ 1.2910 + { 1.2911 + FT_KERNING_DEFAULT = 0, 1.2912 + FT_KERNING_UNFITTED, 1.2913 + FT_KERNING_UNSCALED 1.2914 + 1.2915 + } FT_Kerning_Mode; 1.2916 + 1.2917 + 1.2918 + /*************************************************************************/ 1.2919 + /* */ 1.2920 + /* <Const> */ 1.2921 + /* ft_kerning_default */ 1.2922 + /* */ 1.2923 + /* <Description> */ 1.2924 + /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ 1.2925 + /* instead. */ 1.2926 + /* */ 1.2927 +#define ft_kerning_default FT_KERNING_DEFAULT 1.2928 + 1.2929 + 1.2930 + /*************************************************************************/ 1.2931 + /* */ 1.2932 + /* <Const> */ 1.2933 + /* ft_kerning_unfitted */ 1.2934 + /* */ 1.2935 + /* <Description> */ 1.2936 + /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ 1.2937 + /* instead. */ 1.2938 + /* */ 1.2939 +#define ft_kerning_unfitted FT_KERNING_UNFITTED 1.2940 + 1.2941 + 1.2942 + /*************************************************************************/ 1.2943 + /* */ 1.2944 + /* <Const> */ 1.2945 + /* ft_kerning_unscaled */ 1.2946 + /* */ 1.2947 + /* <Description> */ 1.2948 + /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ 1.2949 + /* instead. */ 1.2950 + /* */ 1.2951 +#define ft_kerning_unscaled FT_KERNING_UNSCALED 1.2952 + 1.2953 + 1.2954 + /*************************************************************************/ 1.2955 + /* */ 1.2956 + /* <Function> */ 1.2957 + /* FT_Get_Kerning */ 1.2958 + /* */ 1.2959 + /* <Description> */ 1.2960 + /* Return the kerning vector between two glyphs of a same face. */ 1.2961 + /* */ 1.2962 + /* <Input> */ 1.2963 + /* face :: A handle to a source face object. */ 1.2964 + /* */ 1.2965 + /* left_glyph :: The index of the left glyph in the kern pair. */ 1.2966 + /* */ 1.2967 + /* right_glyph :: The index of the right glyph in the kern pair. */ 1.2968 + /* */ 1.2969 + /* kern_mode :: See @FT_Kerning_Mode for more information. */ 1.2970 + /* Determines the scale and dimension of the returned */ 1.2971 + /* kerning vector. */ 1.2972 + /* */ 1.2973 + /* <Output> */ 1.2974 + /* akerning :: The kerning vector. This is either in font units */ 1.2975 + /* or in pixels (26.6 format) for scalable formats, */ 1.2976 + /* and in pixels for fixed-sizes formats. */ 1.2977 + /* */ 1.2978 + /* <Return> */ 1.2979 + /* FreeType error code. 0~means success. */ 1.2980 + /* */ 1.2981 + /* <Note> */ 1.2982 + /* Only horizontal layouts (left-to-right & right-to-left) are */ 1.2983 + /* supported by this method. Other layouts, or more sophisticated */ 1.2984 + /* kernings, are out of the scope of this API function -- they can be */ 1.2985 + /* implemented through format-specific interfaces. */ 1.2986 + /* */ 1.2987 + FT_EXPORT( FT_Error ) 1.2988 + FT_Get_Kerning( FT_Face face, 1.2989 + FT_UInt left_glyph, 1.2990 + FT_UInt right_glyph, 1.2991 + FT_UInt kern_mode, 1.2992 + FT_Vector *akerning ); 1.2993 + 1.2994 + 1.2995 + /*************************************************************************/ 1.2996 + /* */ 1.2997 + /* <Function> */ 1.2998 + /* FT_Get_Track_Kerning */ 1.2999 + /* */ 1.3000 + /* <Description> */ 1.3001 + /* Return the track kerning for a given face object at a given size. */ 1.3002 + /* */ 1.3003 + /* <Input> */ 1.3004 + /* face :: A handle to a source face object. */ 1.3005 + /* */ 1.3006 + /* point_size :: The point size in 16.16 fractional points. */ 1.3007 + /* */ 1.3008 + /* degree :: The degree of tightness. Increasingly negative */ 1.3009 + /* values represent tighter track kerning, while */ 1.3010 + /* increasingly positive values represent looser track */ 1.3011 + /* kerning. Value zero means no track kerning. */ 1.3012 + /* */ 1.3013 + /* <Output> */ 1.3014 + /* akerning :: The kerning in 16.16 fractional points, to be */ 1.3015 + /* uniformly applied between all glyphs. */ 1.3016 + /* */ 1.3017 + /* <Return> */ 1.3018 + /* FreeType error code. 0~means success. */ 1.3019 + /* */ 1.3020 + /* <Note> */ 1.3021 + /* Currently, only the Type~1 font driver supports track kerning, */ 1.3022 + /* using data from AFM files (if attached with @FT_Attach_File or */ 1.3023 + /* @FT_Attach_Stream). */ 1.3024 + /* */ 1.3025 + /* Only very few AFM files come with track kerning data; please refer */ 1.3026 + /* to the Adobe's AFM specification for more details. */ 1.3027 + /* */ 1.3028 + FT_EXPORT( FT_Error ) 1.3029 + FT_Get_Track_Kerning( FT_Face face, 1.3030 + FT_Fixed point_size, 1.3031 + FT_Int degree, 1.3032 + FT_Fixed* akerning ); 1.3033 + 1.3034 + 1.3035 + /*************************************************************************/ 1.3036 + /* */ 1.3037 + /* <Function> */ 1.3038 + /* FT_Get_Glyph_Name */ 1.3039 + /* */ 1.3040 + /* <Description> */ 1.3041 + /* Retrieve the ASCII name of a given glyph in a face. This only */ 1.3042 + /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */ 1.3043 + /* */ 1.3044 + /* <Input> */ 1.3045 + /* face :: A handle to a source face object. */ 1.3046 + /* */ 1.3047 + /* glyph_index :: The glyph index. */ 1.3048 + /* */ 1.3049 + /* buffer_max :: The maximum number of bytes available in the */ 1.3050 + /* buffer. */ 1.3051 + /* */ 1.3052 + /* <Output> */ 1.3053 + /* buffer :: A pointer to a target buffer where the name is */ 1.3054 + /* copied to. */ 1.3055 + /* */ 1.3056 + /* <Return> */ 1.3057 + /* FreeType error code. 0~means success. */ 1.3058 + /* */ 1.3059 + /* <Note> */ 1.3060 + /* An error is returned if the face doesn't provide glyph names or if */ 1.3061 + /* the glyph index is invalid. In all cases of failure, the first */ 1.3062 + /* byte of `buffer' is set to~0 to indicate an empty name. */ 1.3063 + /* */ 1.3064 + /* The glyph name is truncated to fit within the buffer if it is too */ 1.3065 + /* long. The returned string is always zero-terminated. */ 1.3066 + /* */ 1.3067 + /* Be aware that FreeType reorders glyph indices internally so that */ 1.3068 + /* glyph index~0 always corresponds to the `missing glyph' (called */ 1.3069 + /* `.notdef'). */ 1.3070 + /* */ 1.3071 + /* This function is not compiled within the library if the config */ 1.3072 + /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ 1.3073 + /* `ftoptions.h'. */ 1.3074 + /* */ 1.3075 + FT_EXPORT( FT_Error ) 1.3076 + FT_Get_Glyph_Name( FT_Face face, 1.3077 + FT_UInt glyph_index, 1.3078 + FT_Pointer buffer, 1.3079 + FT_UInt buffer_max ); 1.3080 + 1.3081 + 1.3082 + /*************************************************************************/ 1.3083 + /* */ 1.3084 + /* <Function> */ 1.3085 + /* FT_Get_Postscript_Name */ 1.3086 + /* */ 1.3087 + /* <Description> */ 1.3088 + /* Retrieve the ASCII PostScript name of a given face, if available. */ 1.3089 + /* This only works with PostScript and TrueType fonts. */ 1.3090 + /* */ 1.3091 + /* <Input> */ 1.3092 + /* face :: A handle to the source face object. */ 1.3093 + /* */ 1.3094 + /* <Return> */ 1.3095 + /* A pointer to the face's PostScript name. NULL if unavailable. */ 1.3096 + /* */ 1.3097 + /* <Note> */ 1.3098 + /* The returned pointer is owned by the face and is destroyed with */ 1.3099 + /* it. */ 1.3100 + /* */ 1.3101 + FT_EXPORT( const char* ) 1.3102 + FT_Get_Postscript_Name( FT_Face face ); 1.3103 + 1.3104 + 1.3105 + /*************************************************************************/ 1.3106 + /* */ 1.3107 + /* <Function> */ 1.3108 + /* FT_Select_Charmap */ 1.3109 + /* */ 1.3110 + /* <Description> */ 1.3111 + /* Select a given charmap by its encoding tag (as listed in */ 1.3112 + /* `freetype.h'). */ 1.3113 + /* */ 1.3114 + /* <InOut> */ 1.3115 + /* face :: A handle to the source face object. */ 1.3116 + /* */ 1.3117 + /* <Input> */ 1.3118 + /* encoding :: A handle to the selected encoding. */ 1.3119 + /* */ 1.3120 + /* <Return> */ 1.3121 + /* FreeType error code. 0~means success. */ 1.3122 + /* */ 1.3123 + /* <Note> */ 1.3124 + /* This function returns an error if no charmap in the face */ 1.3125 + /* corresponds to the encoding queried here. */ 1.3126 + /* */ 1.3127 + /* Because many fonts contain more than a single cmap for Unicode */ 1.3128 + /* encoding, this function has some special code to select the one */ 1.3129 + /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */ 1.3130 + /* preferred to a UCS-2 cmap). It is thus preferable to */ 1.3131 + /* @FT_Set_Charmap in this case. */ 1.3132 + /* */ 1.3133 + FT_EXPORT( FT_Error ) 1.3134 + FT_Select_Charmap( FT_Face face, 1.3135 + FT_Encoding encoding ); 1.3136 + 1.3137 + 1.3138 + /*************************************************************************/ 1.3139 + /* */ 1.3140 + /* <Function> */ 1.3141 + /* FT_Set_Charmap */ 1.3142 + /* */ 1.3143 + /* <Description> */ 1.3144 + /* Select a given charmap for character code to glyph index mapping. */ 1.3145 + /* */ 1.3146 + /* <InOut> */ 1.3147 + /* face :: A handle to the source face object. */ 1.3148 + /* */ 1.3149 + /* <Input> */ 1.3150 + /* charmap :: A handle to the selected charmap. */ 1.3151 + /* */ 1.3152 + /* <Return> */ 1.3153 + /* FreeType error code. 0~means success. */ 1.3154 + /* */ 1.3155 + /* <Note> */ 1.3156 + /* This function returns an error if the charmap is not part of */ 1.3157 + /* the face (i.e., if it is not listed in the `face->charmaps' */ 1.3158 + /* table). */ 1.3159 + /* */ 1.3160 + /* It also fails if a type~14 charmap is selected. */ 1.3161 + /* */ 1.3162 + FT_EXPORT( FT_Error ) 1.3163 + FT_Set_Charmap( FT_Face face, 1.3164 + FT_CharMap charmap ); 1.3165 + 1.3166 + 1.3167 + /************************************************************************* 1.3168 + * 1.3169 + * @function: 1.3170 + * FT_Get_Charmap_Index 1.3171 + * 1.3172 + * @description: 1.3173 + * Retrieve index of a given charmap. 1.3174 + * 1.3175 + * @input: 1.3176 + * charmap :: 1.3177 + * A handle to a charmap. 1.3178 + * 1.3179 + * @return: 1.3180 + * The index into the array of character maps within the face to which 1.3181 + * `charmap' belongs. If an error occurs, -1 is returned. 1.3182 + * 1.3183 + */ 1.3184 + FT_EXPORT( FT_Int ) 1.3185 + FT_Get_Charmap_Index( FT_CharMap charmap ); 1.3186 + 1.3187 + 1.3188 + /*************************************************************************/ 1.3189 + /* */ 1.3190 + /* <Function> */ 1.3191 + /* FT_Get_Char_Index */ 1.3192 + /* */ 1.3193 + /* <Description> */ 1.3194 + /* Return the glyph index of a given character code. This function */ 1.3195 + /* uses a charmap object to do the mapping. */ 1.3196 + /* */ 1.3197 + /* <Input> */ 1.3198 + /* face :: A handle to the source face object. */ 1.3199 + /* */ 1.3200 + /* charcode :: The character code. */ 1.3201 + /* */ 1.3202 + /* <Return> */ 1.3203 + /* The glyph index. 0~means `undefined character code'. */ 1.3204 + /* */ 1.3205 + /* <Note> */ 1.3206 + /* If you use FreeType to manipulate the contents of font files */ 1.3207 + /* directly, be aware that the glyph index returned by this function */ 1.3208 + /* doesn't always correspond to the internal indices used within the */ 1.3209 + /* file. This is done to ensure that value~0 always corresponds to */ 1.3210 + /* the `missing glyph'. If the first glyph is not named `.notdef', */ 1.3211 + /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */ 1.3212 + /* the glyph ID~0 position, and whatever was there will be moved to */ 1.3213 + /* the position `.notdef' had. For Type~1 fonts, if there is no */ 1.3214 + /* `.notdef' glyph at all, then one will be created at index~0 and */ 1.3215 + /* whatever was there will be moved to the last index -- Type~42 */ 1.3216 + /* fonts are considered invalid under this condition. */ 1.3217 + /* */ 1.3218 + FT_EXPORT( FT_UInt ) 1.3219 + FT_Get_Char_Index( FT_Face face, 1.3220 + FT_ULong charcode ); 1.3221 + 1.3222 + 1.3223 + /*************************************************************************/ 1.3224 + /* */ 1.3225 + /* <Function> */ 1.3226 + /* FT_Get_First_Char */ 1.3227 + /* */ 1.3228 + /* <Description> */ 1.3229 + /* This function is used to return the first character code in the */ 1.3230 + /* current charmap of a given face. It also returns the */ 1.3231 + /* corresponding glyph index. */ 1.3232 + /* */ 1.3233 + /* <Input> */ 1.3234 + /* face :: A handle to the source face object. */ 1.3235 + /* */ 1.3236 + /* <Output> */ 1.3237 + /* agindex :: Glyph index of first character code. 0~if charmap is */ 1.3238 + /* empty. */ 1.3239 + /* */ 1.3240 + /* <Return> */ 1.3241 + /* The charmap's first character code. */ 1.3242 + /* */ 1.3243 + /* <Note> */ 1.3244 + /* You should use this function with @FT_Get_Next_Char to be able to */ 1.3245 + /* parse all character codes available in a given charmap. The code */ 1.3246 + /* should look like this: */ 1.3247 + /* */ 1.3248 + /* { */ 1.3249 + /* FT_ULong charcode; */ 1.3250 + /* FT_UInt gindex; */ 1.3251 + /* */ 1.3252 + /* */ 1.3253 + /* charcode = FT_Get_First_Char( face, &gindex ); */ 1.3254 + /* while ( gindex != 0 ) */ 1.3255 + /* { */ 1.3256 + /* ... do something with (charcode,gindex) pair ... */ 1.3257 + /* */ 1.3258 + /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */ 1.3259 + /* } */ 1.3260 + /* } */ 1.3261 + /* */ 1.3262 + /* Note that `*agindex' is set to~0 if the charmap is empty. The */ 1.3263 + /* result itself can be~0 in two cases: if the charmap is empty or */ 1.3264 + /* if the value~0 is the first valid character code. */ 1.3265 + /* */ 1.3266 + FT_EXPORT( FT_ULong ) 1.3267 + FT_Get_First_Char( FT_Face face, 1.3268 + FT_UInt *agindex ); 1.3269 + 1.3270 + 1.3271 + /*************************************************************************/ 1.3272 + /* */ 1.3273 + /* <Function> */ 1.3274 + /* FT_Get_Next_Char */ 1.3275 + /* */ 1.3276 + /* <Description> */ 1.3277 + /* This function is used to return the next character code in the */ 1.3278 + /* current charmap of a given face following the value `char_code', */ 1.3279 + /* as well as the corresponding glyph index. */ 1.3280 + /* */ 1.3281 + /* <Input> */ 1.3282 + /* face :: A handle to the source face object. */ 1.3283 + /* char_code :: The starting character code. */ 1.3284 + /* */ 1.3285 + /* <Output> */ 1.3286 + /* agindex :: Glyph index of next character code. 0~if charmap */ 1.3287 + /* is empty. */ 1.3288 + /* */ 1.3289 + /* <Return> */ 1.3290 + /* The charmap's next character code. */ 1.3291 + /* */ 1.3292 + /* <Note> */ 1.3293 + /* You should use this function with @FT_Get_First_Char to walk */ 1.3294 + /* over all character codes available in a given charmap. See the */ 1.3295 + /* note for this function for a simple code example. */ 1.3296 + /* */ 1.3297 + /* Note that `*agindex' is set to~0 when there are no more codes in */ 1.3298 + /* the charmap. */ 1.3299 + /* */ 1.3300 + FT_EXPORT( FT_ULong ) 1.3301 + FT_Get_Next_Char( FT_Face face, 1.3302 + FT_ULong char_code, 1.3303 + FT_UInt *agindex ); 1.3304 + 1.3305 + 1.3306 + /*************************************************************************/ 1.3307 + /* */ 1.3308 + /* <Function> */ 1.3309 + /* FT_Get_Name_Index */ 1.3310 + /* */ 1.3311 + /* <Description> */ 1.3312 + /* Return the glyph index of a given glyph name. This function uses */ 1.3313 + /* driver specific objects to do the translation. */ 1.3314 + /* */ 1.3315 + /* <Input> */ 1.3316 + /* face :: A handle to the source face object. */ 1.3317 + /* */ 1.3318 + /* glyph_name :: The glyph name. */ 1.3319 + /* */ 1.3320 + /* <Return> */ 1.3321 + /* The glyph index. 0~means `undefined character code'. */ 1.3322 + /* */ 1.3323 + FT_EXPORT( FT_UInt ) 1.3324 + FT_Get_Name_Index( FT_Face face, 1.3325 + FT_String* glyph_name ); 1.3326 + 1.3327 + 1.3328 + /************************************************************************* 1.3329 + * 1.3330 + * @macro: 1.3331 + * FT_SUBGLYPH_FLAG_XXX 1.3332 + * 1.3333 + * @description: 1.3334 + * A list of constants used to describe subglyphs. Please refer to the 1.3335 + * TrueType specification for the meaning of the various flags. 1.3336 + * 1.3337 + * @values: 1.3338 + * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS :: 1.3339 + * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES :: 1.3340 + * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID :: 1.3341 + * FT_SUBGLYPH_FLAG_SCALE :: 1.3342 + * FT_SUBGLYPH_FLAG_XY_SCALE :: 1.3343 + * FT_SUBGLYPH_FLAG_2X2 :: 1.3344 + * FT_SUBGLYPH_FLAG_USE_MY_METRICS :: 1.3345 + * 1.3346 + */ 1.3347 +#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 1.3348 +#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 1.3349 +#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 1.3350 +#define FT_SUBGLYPH_FLAG_SCALE 8 1.3351 +#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 1.3352 +#define FT_SUBGLYPH_FLAG_2X2 0x80 1.3353 +#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 1.3354 + 1.3355 + 1.3356 + /************************************************************************* 1.3357 + * 1.3358 + * @func: 1.3359 + * FT_Get_SubGlyph_Info 1.3360 + * 1.3361 + * @description: 1.3362 + * Retrieve a description of a given subglyph. Only use it if 1.3363 + * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is 1.3364 + * returned otherwise. 1.3365 + * 1.3366 + * @input: 1.3367 + * glyph :: 1.3368 + * The source glyph slot. 1.3369 + * 1.3370 + * sub_index :: 1.3371 + * The index of the subglyph. Must be less than 1.3372 + * `glyph->num_subglyphs'. 1.3373 + * 1.3374 + * @output: 1.3375 + * p_index :: 1.3376 + * The glyph index of the subglyph. 1.3377 + * 1.3378 + * p_flags :: 1.3379 + * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX. 1.3380 + * 1.3381 + * p_arg1 :: 1.3382 + * The subglyph's first argument (if any). 1.3383 + * 1.3384 + * p_arg2 :: 1.3385 + * The subglyph's second argument (if any). 1.3386 + * 1.3387 + * p_transform :: 1.3388 + * The subglyph transformation (if any). 1.3389 + * 1.3390 + * @return: 1.3391 + * FreeType error code. 0~means success. 1.3392 + * 1.3393 + * @note: 1.3394 + * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be 1.3395 + * interpreted depending on the flags returned in `*p_flags'. See the 1.3396 + * TrueType specification for details. 1.3397 + * 1.3398 + */ 1.3399 + FT_EXPORT( FT_Error ) 1.3400 + FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, 1.3401 + FT_UInt sub_index, 1.3402 + FT_Int *p_index, 1.3403 + FT_UInt *p_flags, 1.3404 + FT_Int *p_arg1, 1.3405 + FT_Int *p_arg2, 1.3406 + FT_Matrix *p_transform ); 1.3407 + 1.3408 + 1.3409 + /*************************************************************************/ 1.3410 + /* */ 1.3411 + /* <Enum> */ 1.3412 + /* FT_FSTYPE_XXX */ 1.3413 + /* */ 1.3414 + /* <Description> */ 1.3415 + /* A list of bit flags used in the `fsType' field of the OS/2 table */ 1.3416 + /* in a TrueType or OpenType font and the `FSType' entry in a */ 1.3417 + /* PostScript font. These bit flags are returned by */ 1.3418 + /* @FT_Get_FSType_Flags; they inform client applications of embedding */ 1.3419 + /* and subsetting restrictions associated with a font. */ 1.3420 + /* */ 1.3421 + /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */ 1.3422 + /* more details. */ 1.3423 + /* */ 1.3424 + /* <Values> */ 1.3425 + /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */ 1.3426 + /* Fonts with no fsType bit set may be embedded and permanently */ 1.3427 + /* installed on the remote system by an application. */ 1.3428 + /* */ 1.3429 + /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */ 1.3430 + /* Fonts that have only this bit set must not be modified, embedded */ 1.3431 + /* or exchanged in any manner without first obtaining permission of */ 1.3432 + /* the font software copyright owner. */ 1.3433 + /* */ 1.3434 + /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */ 1.3435 + /* If this bit is set, the font may be embedded and temporarily */ 1.3436 + /* loaded on the remote system. Documents containing Preview & */ 1.3437 + /* Print fonts must be opened `read-only'; no edits can be applied */ 1.3438 + /* to the document. */ 1.3439 + /* */ 1.3440 + /* FT_FSTYPE_EDITABLE_EMBEDDING :: */ 1.3441 + /* If this bit is set, the font may be embedded but must only be */ 1.3442 + /* installed temporarily on other systems. In contrast to Preview */ 1.3443 + /* & Print fonts, documents containing editable fonts may be opened */ 1.3444 + /* for reading, editing is permitted, and changes may be saved. */ 1.3445 + /* */ 1.3446 + /* FT_FSTYPE_NO_SUBSETTING :: */ 1.3447 + /* If this bit is set, the font may not be subsetted prior to */ 1.3448 + /* embedding. */ 1.3449 + /* */ 1.3450 + /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */ 1.3451 + /* If this bit is set, only bitmaps contained in the font may be */ 1.3452 + /* embedded; no outline data may be embedded. If there are no */ 1.3453 + /* bitmaps available in the font, then the font is unembeddable. */ 1.3454 + /* */ 1.3455 + /* <Note> */ 1.3456 + /* While the fsType flags can indicate that a font may be embedded, a */ 1.3457 + /* license with the font vendor may be separately required to use the */ 1.3458 + /* font in this way. */ 1.3459 + /* */ 1.3460 +#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 1.3461 +#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 1.3462 +#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 1.3463 +#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 1.3464 +#define FT_FSTYPE_NO_SUBSETTING 0x0100 1.3465 +#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 1.3466 + 1.3467 + 1.3468 + /*************************************************************************/ 1.3469 + /* */ 1.3470 + /* <Function> */ 1.3471 + /* FT_Get_FSType_Flags */ 1.3472 + /* */ 1.3473 + /* <Description> */ 1.3474 + /* Return the fsType flags for a font. */ 1.3475 + /* */ 1.3476 + /* <Input> */ 1.3477 + /* face :: A handle to the source face object. */ 1.3478 + /* */ 1.3479 + /* <Return> */ 1.3480 + /* The fsType flags, @FT_FSTYPE_XXX. */ 1.3481 + /* */ 1.3482 + /* <Note> */ 1.3483 + /* Use this function rather than directly reading the `fs_type' field */ 1.3484 + /* in the @PS_FontInfoRec structure, which is only guaranteed to */ 1.3485 + /* return the correct results for Type~1 fonts. */ 1.3486 + /* */ 1.3487 + /* <Since> */ 1.3488 + /* 2.3.8 */ 1.3489 + /* */ 1.3490 + FT_EXPORT( FT_UShort ) 1.3491 + FT_Get_FSType_Flags( FT_Face face ); 1.3492 + 1.3493 + 1.3494 + /*************************************************************************/ 1.3495 + /* */ 1.3496 + /* <Section> */ 1.3497 + /* glyph_variants */ 1.3498 + /* */ 1.3499 + /* <Title> */ 1.3500 + /* Glyph Variants */ 1.3501 + /* */ 1.3502 + /* <Abstract> */ 1.3503 + /* The FreeType~2 interface to Unicode Ideographic Variation */ 1.3504 + /* Sequences (IVS), using the SFNT cmap format~14. */ 1.3505 + /* */ 1.3506 + /* <Description> */ 1.3507 + /* Many CJK characters have variant forms. They are a sort of grey */ 1.3508 + /* area somewhere between being totally irrelevant and semantically */ 1.3509 + /* distinct; for this reason, the Unicode consortium decided to */ 1.3510 + /* introduce Ideographic Variation Sequences (IVS), consisting of a */ 1.3511 + /* Unicode base character and one of 240 variant selectors */ 1.3512 + /* (U+E0100-U+E01EF), instead of further extending the already huge */ 1.3513 + /* code range for CJK characters. */ 1.3514 + /* */ 1.3515 + /* An IVS is registered and unique; for further details please refer */ 1.3516 + /* to Unicode Technical Standard #37, the Ideographic Variation */ 1.3517 + /* Database: */ 1.3518 + /* */ 1.3519 + /* http://www.unicode.org/reports/tr37/ */ 1.3520 + /* */ 1.3521 + /* To date (November 2012), the character with the most variants is */ 1.3522 + /* U+9089, having 31 such IVS. */ 1.3523 + /* */ 1.3524 + /* Adobe and MS decided to support IVS with a new cmap subtable */ 1.3525 + /* (format~14). It is an odd subtable because it is not a mapping of */ 1.3526 + /* input code points to glyphs, but contains lists of all variants */ 1.3527 + /* supported by the font. */ 1.3528 + /* */ 1.3529 + /* A variant may be either `default' or `non-default'. A default */ 1.3530 + /* variant is the one you will get for that code point if you look it */ 1.3531 + /* up in the standard Unicode cmap. A non-default variant is a */ 1.3532 + /* different glyph. */ 1.3533 + /* */ 1.3534 + /*************************************************************************/ 1.3535 + 1.3536 + 1.3537 + /*************************************************************************/ 1.3538 + /* */ 1.3539 + /* <Function> */ 1.3540 + /* FT_Face_GetCharVariantIndex */ 1.3541 + /* */ 1.3542 + /* <Description> */ 1.3543 + /* Return the glyph index of a given character code as modified by */ 1.3544 + /* the variation selector. */ 1.3545 + /* */ 1.3546 + /* <Input> */ 1.3547 + /* face :: */ 1.3548 + /* A handle to the source face object. */ 1.3549 + /* */ 1.3550 + /* charcode :: */ 1.3551 + /* The character code point in Unicode. */ 1.3552 + /* */ 1.3553 + /* variantSelector :: */ 1.3554 + /* The Unicode code point of the variation selector. */ 1.3555 + /* */ 1.3556 + /* <Return> */ 1.3557 + /* The glyph index. 0~means either `undefined character code', or */ 1.3558 + /* `undefined selector code', or `no variation selector cmap */ 1.3559 + /* subtable', or `current CharMap is not Unicode'. */ 1.3560 + /* */ 1.3561 + /* <Note> */ 1.3562 + /* If you use FreeType to manipulate the contents of font files */ 1.3563 + /* directly, be aware that the glyph index returned by this function */ 1.3564 + /* doesn't always correspond to the internal indices used within */ 1.3565 + /* the file. This is done to ensure that value~0 always corresponds */ 1.3566 + /* to the `missing glyph'. */ 1.3567 + /* */ 1.3568 + /* This function is only meaningful if */ 1.3569 + /* a) the font has a variation selector cmap sub table, */ 1.3570 + /* and */ 1.3571 + /* b) the current charmap has a Unicode encoding. */ 1.3572 + /* */ 1.3573 + /* <Since> */ 1.3574 + /* 2.3.6 */ 1.3575 + /* */ 1.3576 + FT_EXPORT( FT_UInt ) 1.3577 + FT_Face_GetCharVariantIndex( FT_Face face, 1.3578 + FT_ULong charcode, 1.3579 + FT_ULong variantSelector ); 1.3580 + 1.3581 + 1.3582 + /*************************************************************************/ 1.3583 + /* */ 1.3584 + /* <Function> */ 1.3585 + /* FT_Face_GetCharVariantIsDefault */ 1.3586 + /* */ 1.3587 + /* <Description> */ 1.3588 + /* Check whether this variant of this Unicode character is the one to */ 1.3589 + /* be found in the `cmap'. */ 1.3590 + /* */ 1.3591 + /* <Input> */ 1.3592 + /* face :: */ 1.3593 + /* A handle to the source face object. */ 1.3594 + /* */ 1.3595 + /* charcode :: */ 1.3596 + /* The character codepoint in Unicode. */ 1.3597 + /* */ 1.3598 + /* variantSelector :: */ 1.3599 + /* The Unicode codepoint of the variation selector. */ 1.3600 + /* */ 1.3601 + /* <Return> */ 1.3602 + /* 1~if found in the standard (Unicode) cmap, 0~if found in the */ 1.3603 + /* variation selector cmap, or -1 if it is not a variant. */ 1.3604 + /* */ 1.3605 + /* <Note> */ 1.3606 + /* This function is only meaningful if the font has a variation */ 1.3607 + /* selector cmap subtable. */ 1.3608 + /* */ 1.3609 + /* <Since> */ 1.3610 + /* 2.3.6 */ 1.3611 + /* */ 1.3612 + FT_EXPORT( FT_Int ) 1.3613 + FT_Face_GetCharVariantIsDefault( FT_Face face, 1.3614 + FT_ULong charcode, 1.3615 + FT_ULong variantSelector ); 1.3616 + 1.3617 + 1.3618 + /*************************************************************************/ 1.3619 + /* */ 1.3620 + /* <Function> */ 1.3621 + /* FT_Face_GetVariantSelectors */ 1.3622 + /* */ 1.3623 + /* <Description> */ 1.3624 + /* Return a zero-terminated list of Unicode variant selectors found */ 1.3625 + /* in the font. */ 1.3626 + /* */ 1.3627 + /* <Input> */ 1.3628 + /* face :: */ 1.3629 + /* A handle to the source face object. */ 1.3630 + /* */ 1.3631 + /* <Return> */ 1.3632 + /* A pointer to an array of selector code points, or NULL if there is */ 1.3633 + /* no valid variant selector cmap subtable. */ 1.3634 + /* */ 1.3635 + /* <Note> */ 1.3636 + /* The last item in the array is~0; the array is owned by the */ 1.3637 + /* @FT_Face object but can be overwritten or released on the next */ 1.3638 + /* call to a FreeType function. */ 1.3639 + /* */ 1.3640 + /* <Since> */ 1.3641 + /* 2.3.6 */ 1.3642 + /* */ 1.3643 + FT_EXPORT( FT_UInt32* ) 1.3644 + FT_Face_GetVariantSelectors( FT_Face face ); 1.3645 + 1.3646 + 1.3647 + /*************************************************************************/ 1.3648 + /* */ 1.3649 + /* <Function> */ 1.3650 + /* FT_Face_GetVariantsOfChar */ 1.3651 + /* */ 1.3652 + /* <Description> */ 1.3653 + /* Return a zero-terminated list of Unicode variant selectors found */ 1.3654 + /* for the specified character code. */ 1.3655 + /* */ 1.3656 + /* <Input> */ 1.3657 + /* face :: */ 1.3658 + /* A handle to the source face object. */ 1.3659 + /* */ 1.3660 + /* charcode :: */ 1.3661 + /* The character codepoint in Unicode. */ 1.3662 + /* */ 1.3663 + /* <Return> */ 1.3664 + /* A pointer to an array of variant selector code points that are */ 1.3665 + /* active for the given character, or NULL if the corresponding list */ 1.3666 + /* is empty. */ 1.3667 + /* */ 1.3668 + /* <Note> */ 1.3669 + /* The last item in the array is~0; the array is owned by the */ 1.3670 + /* @FT_Face object but can be overwritten or released on the next */ 1.3671 + /* call to a FreeType function. */ 1.3672 + /* */ 1.3673 + /* <Since> */ 1.3674 + /* 2.3.6 */ 1.3675 + /* */ 1.3676 + FT_EXPORT( FT_UInt32* ) 1.3677 + FT_Face_GetVariantsOfChar( FT_Face face, 1.3678 + FT_ULong charcode ); 1.3679 + 1.3680 + 1.3681 + /*************************************************************************/ 1.3682 + /* */ 1.3683 + /* <Function> */ 1.3684 + /* FT_Face_GetCharsOfVariant */ 1.3685 + /* */ 1.3686 + /* <Description> */ 1.3687 + /* Return a zero-terminated list of Unicode character codes found for */ 1.3688 + /* the specified variant selector. */ 1.3689 + /* */ 1.3690 + /* <Input> */ 1.3691 + /* face :: */ 1.3692 + /* A handle to the source face object. */ 1.3693 + /* */ 1.3694 + /* variantSelector :: */ 1.3695 + /* The variant selector code point in Unicode. */ 1.3696 + /* */ 1.3697 + /* <Return> */ 1.3698 + /* A list of all the code points that are specified by this selector */ 1.3699 + /* (both default and non-default codes are returned) or NULL if there */ 1.3700 + /* is no valid cmap or the variant selector is invalid. */ 1.3701 + /* */ 1.3702 + /* <Note> */ 1.3703 + /* The last item in the array is~0; the array is owned by the */ 1.3704 + /* @FT_Face object but can be overwritten or released on the next */ 1.3705 + /* call to a FreeType function. */ 1.3706 + /* */ 1.3707 + /* <Since> */ 1.3708 + /* 2.3.6 */ 1.3709 + /* */ 1.3710 + FT_EXPORT( FT_UInt32* ) 1.3711 + FT_Face_GetCharsOfVariant( FT_Face face, 1.3712 + FT_ULong variantSelector ); 1.3713 + 1.3714 + 1.3715 + /*************************************************************************/ 1.3716 + /* */ 1.3717 + /* <Section> */ 1.3718 + /* computations */ 1.3719 + /* */ 1.3720 + /* <Title> */ 1.3721 + /* Computations */ 1.3722 + /* */ 1.3723 + /* <Abstract> */ 1.3724 + /* Crunching fixed numbers and vectors. */ 1.3725 + /* */ 1.3726 + /* <Description> */ 1.3727 + /* This section contains various functions used to perform */ 1.3728 + /* computations on 16.16 fixed-float numbers or 2d vectors. */ 1.3729 + /* */ 1.3730 + /* <Order> */ 1.3731 + /* FT_MulDiv */ 1.3732 + /* FT_MulFix */ 1.3733 + /* FT_DivFix */ 1.3734 + /* FT_RoundFix */ 1.3735 + /* FT_CeilFix */ 1.3736 + /* FT_FloorFix */ 1.3737 + /* FT_Vector_Transform */ 1.3738 + /* FT_Matrix_Multiply */ 1.3739 + /* FT_Matrix_Invert */ 1.3740 + /* */ 1.3741 + /*************************************************************************/ 1.3742 + 1.3743 + 1.3744 + /*************************************************************************/ 1.3745 + /* */ 1.3746 + /* <Function> */ 1.3747 + /* FT_MulDiv */ 1.3748 + /* */ 1.3749 + /* <Description> */ 1.3750 + /* A very simple function used to perform the computation `(a*b)/c' */ 1.3751 + /* with maximum accuracy (it uses a 64-bit intermediate integer */ 1.3752 + /* whenever necessary). */ 1.3753 + /* */ 1.3754 + /* This function isn't necessarily as fast as some processor specific */ 1.3755 + /* operations, but is at least completely portable. */ 1.3756 + /* */ 1.3757 + /* <Input> */ 1.3758 + /* a :: The first multiplier. */ 1.3759 + /* b :: The second multiplier. */ 1.3760 + /* c :: The divisor. */ 1.3761 + /* */ 1.3762 + /* <Return> */ 1.3763 + /* The result of `(a*b)/c'. This function never traps when trying to */ 1.3764 + /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ 1.3765 + /* on the signs of `a' and `b'. */ 1.3766 + /* */ 1.3767 + FT_EXPORT( FT_Long ) 1.3768 + FT_MulDiv( FT_Long a, 1.3769 + FT_Long b, 1.3770 + FT_Long c ); 1.3771 + 1.3772 + 1.3773 + /* */ 1.3774 + 1.3775 + /* The following #if 0 ... #endif is for the documentation formatter, */ 1.3776 + /* hiding the internal `FT_MULFIX_INLINED' macro. */ 1.3777 + 1.3778 +#if 0 1.3779 + /*************************************************************************/ 1.3780 + /* */ 1.3781 + /* <Function> */ 1.3782 + /* FT_MulFix */ 1.3783 + /* */ 1.3784 + /* <Description> */ 1.3785 + /* A very simple function used to perform the computation */ 1.3786 + /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */ 1.3787 + /* used to multiply a given value by a 16.16 fixed-point factor. */ 1.3788 + /* */ 1.3789 + /* <Input> */ 1.3790 + /* a :: The first multiplier. */ 1.3791 + /* b :: The second multiplier. Use a 16.16 factor here whenever */ 1.3792 + /* possible (see note below). */ 1.3793 + /* */ 1.3794 + /* <Return> */ 1.3795 + /* The result of `(a*b)/0x10000'. */ 1.3796 + /* */ 1.3797 + /* <Note> */ 1.3798 + /* This function has been optimized for the case where the absolute */ 1.3799 + /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */ 1.3800 + /* As this happens mainly when scaling from notional units to */ 1.3801 + /* fractional pixels in FreeType, it resulted in noticeable speed */ 1.3802 + /* improvements between versions 2.x and 1.x. */ 1.3803 + /* */ 1.3804 + /* As a conclusion, always try to place a 16.16 factor as the */ 1.3805 + /* _second_ argument of this function; this can make a great */ 1.3806 + /* difference. */ 1.3807 + /* */ 1.3808 + FT_EXPORT( FT_Long ) 1.3809 + FT_MulFix( FT_Long a, 1.3810 + FT_Long b ); 1.3811 + 1.3812 + /* */ 1.3813 +#endif 1.3814 + 1.3815 +#ifdef FT_MULFIX_INLINED 1.3816 +#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) 1.3817 +#else 1.3818 + FT_EXPORT( FT_Long ) 1.3819 + FT_MulFix( FT_Long a, 1.3820 + FT_Long b ); 1.3821 +#endif 1.3822 + 1.3823 + 1.3824 + /*************************************************************************/ 1.3825 + /* */ 1.3826 + /* <Function> */ 1.3827 + /* FT_DivFix */ 1.3828 + /* */ 1.3829 + /* <Description> */ 1.3830 + /* A very simple function used to perform the computation */ 1.3831 + /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */ 1.3832 + /* used to divide a given value by a 16.16 fixed-point factor. */ 1.3833 + /* */ 1.3834 + /* <Input> */ 1.3835 + /* a :: The first multiplier. */ 1.3836 + /* b :: The second multiplier. Use a 16.16 factor here whenever */ 1.3837 + /* possible (see note below). */ 1.3838 + /* */ 1.3839 + /* <Return> */ 1.3840 + /* The result of `(a*0x10000)/b'. */ 1.3841 + /* */ 1.3842 + /* <Note> */ 1.3843 + /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ 1.3844 + /* 32~bits, then the division is computed directly. Otherwise, we */ 1.3845 + /* use a specialized version of @FT_MulDiv. */ 1.3846 + /* */ 1.3847 + FT_EXPORT( FT_Long ) 1.3848 + FT_DivFix( FT_Long a, 1.3849 + FT_Long b ); 1.3850 + 1.3851 + 1.3852 + /*************************************************************************/ 1.3853 + /* */ 1.3854 + /* <Function> */ 1.3855 + /* FT_RoundFix */ 1.3856 + /* */ 1.3857 + /* <Description> */ 1.3858 + /* A very simple function used to round a 16.16 fixed number. */ 1.3859 + /* */ 1.3860 + /* <Input> */ 1.3861 + /* a :: The number to be rounded. */ 1.3862 + /* */ 1.3863 + /* <Return> */ 1.3864 + /* The result of `(a + 0x8000) & -0x10000'. */ 1.3865 + /* */ 1.3866 + FT_EXPORT( FT_Fixed ) 1.3867 + FT_RoundFix( FT_Fixed a ); 1.3868 + 1.3869 + 1.3870 + /*************************************************************************/ 1.3871 + /* */ 1.3872 + /* <Function> */ 1.3873 + /* FT_CeilFix */ 1.3874 + /* */ 1.3875 + /* <Description> */ 1.3876 + /* A very simple function used to compute the ceiling function of a */ 1.3877 + /* 16.16 fixed number. */ 1.3878 + /* */ 1.3879 + /* <Input> */ 1.3880 + /* a :: The number for which the ceiling function is to be computed. */ 1.3881 + /* */ 1.3882 + /* <Return> */ 1.3883 + /* The result of `(a + 0x10000 - 1) & -0x10000'. */ 1.3884 + /* */ 1.3885 + FT_EXPORT( FT_Fixed ) 1.3886 + FT_CeilFix( FT_Fixed a ); 1.3887 + 1.3888 + 1.3889 + /*************************************************************************/ 1.3890 + /* */ 1.3891 + /* <Function> */ 1.3892 + /* FT_FloorFix */ 1.3893 + /* */ 1.3894 + /* <Description> */ 1.3895 + /* A very simple function used to compute the floor function of a */ 1.3896 + /* 16.16 fixed number. */ 1.3897 + /* */ 1.3898 + /* <Input> */ 1.3899 + /* a :: The number for which the floor function is to be computed. */ 1.3900 + /* */ 1.3901 + /* <Return> */ 1.3902 + /* The result of `a & -0x10000'. */ 1.3903 + /* */ 1.3904 + FT_EXPORT( FT_Fixed ) 1.3905 + FT_FloorFix( FT_Fixed a ); 1.3906 + 1.3907 + 1.3908 + /*************************************************************************/ 1.3909 + /* */ 1.3910 + /* <Function> */ 1.3911 + /* FT_Vector_Transform */ 1.3912 + /* */ 1.3913 + /* <Description> */ 1.3914 + /* Transform a single vector through a 2x2 matrix. */ 1.3915 + /* */ 1.3916 + /* <InOut> */ 1.3917 + /* vector :: The target vector to transform. */ 1.3918 + /* */ 1.3919 + /* <Input> */ 1.3920 + /* matrix :: A pointer to the source 2x2 matrix. */ 1.3921 + /* */ 1.3922 + /* <Note> */ 1.3923 + /* The result is undefined if either `vector' or `matrix' is invalid. */ 1.3924 + /* */ 1.3925 + FT_EXPORT( void ) 1.3926 + FT_Vector_Transform( FT_Vector* vec, 1.3927 + const FT_Matrix* matrix ); 1.3928 + 1.3929 + 1.3930 + /*************************************************************************/ 1.3931 + /* */ 1.3932 + /* <Section> */ 1.3933 + /* version */ 1.3934 + /* */ 1.3935 + /* <Title> */ 1.3936 + /* FreeType Version */ 1.3937 + /* */ 1.3938 + /* <Abstract> */ 1.3939 + /* Functions and macros related to FreeType versions. */ 1.3940 + /* */ 1.3941 + /* <Description> */ 1.3942 + /* Note that those functions and macros are of limited use because */ 1.3943 + /* even a new release of FreeType with only documentation changes */ 1.3944 + /* increases the version number. */ 1.3945 + /* */ 1.3946 + /*************************************************************************/ 1.3947 + 1.3948 + 1.3949 + /************************************************************************* 1.3950 + * 1.3951 + * @enum: 1.3952 + * FREETYPE_XXX 1.3953 + * 1.3954 + * @description: 1.3955 + * These three macros identify the FreeType source code version. 1.3956 + * Use @FT_Library_Version to access them at runtime. 1.3957 + * 1.3958 + * @values: 1.3959 + * FREETYPE_MAJOR :: The major version number. 1.3960 + * FREETYPE_MINOR :: The minor version number. 1.3961 + * FREETYPE_PATCH :: The patch level. 1.3962 + * 1.3963 + * @note: 1.3964 + * The version number of FreeType if built as a dynamic link library 1.3965 + * with the `libtool' package is _not_ controlled by these three 1.3966 + * macros. 1.3967 + * 1.3968 + */ 1.3969 +#define FREETYPE_MAJOR 2 1.3970 +#define FREETYPE_MINOR 5 1.3971 +#define FREETYPE_PATCH 3 1.3972 + 1.3973 + 1.3974 + /*************************************************************************/ 1.3975 + /* */ 1.3976 + /* <Function> */ 1.3977 + /* FT_Library_Version */ 1.3978 + /* */ 1.3979 + /* <Description> */ 1.3980 + /* Return the version of the FreeType library being used. This is */ 1.3981 + /* useful when dynamically linking to the library, since one cannot */ 1.3982 + /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */ 1.3983 + /* @FREETYPE_PATCH. */ 1.3984 + /* */ 1.3985 + /* <Input> */ 1.3986 + /* library :: A source library handle. */ 1.3987 + /* */ 1.3988 + /* <Output> */ 1.3989 + /* amajor :: The major version number. */ 1.3990 + /* */ 1.3991 + /* aminor :: The minor version number. */ 1.3992 + /* */ 1.3993 + /* apatch :: The patch version number. */ 1.3994 + /* */ 1.3995 + /* <Note> */ 1.3996 + /* The reason why this function takes a `library' argument is because */ 1.3997 + /* certain programs implement library initialization in a custom way */ 1.3998 + /* that doesn't use @FT_Init_FreeType. */ 1.3999 + /* */ 1.4000 + /* In such cases, the library version might not be available before */ 1.4001 + /* the library object has been created. */ 1.4002 + /* */ 1.4003 + FT_EXPORT( void ) 1.4004 + FT_Library_Version( FT_Library library, 1.4005 + FT_Int *amajor, 1.4006 + FT_Int *aminor, 1.4007 + FT_Int *apatch ); 1.4008 + 1.4009 + 1.4010 + /*************************************************************************/ 1.4011 + /* */ 1.4012 + /* <Function> */ 1.4013 + /* FT_Face_CheckTrueTypePatents */ 1.4014 + /* */ 1.4015 + /* <Description> */ 1.4016 + /* Parse all bytecode instructions of a TrueType font file to check */ 1.4017 + /* whether any of the patented opcodes are used. This is only useful */ 1.4018 + /* if you want to be able to use the unpatented hinter with */ 1.4019 + /* fonts that do *not* use these opcodes. */ 1.4020 + /* */ 1.4021 + /* Note that this function parses *all* glyph instructions in the */ 1.4022 + /* font file, which may be slow. */ 1.4023 + /* */ 1.4024 + /* <Input> */ 1.4025 + /* face :: A face handle. */ 1.4026 + /* */ 1.4027 + /* <Return> */ 1.4028 + /* 1~if this is a TrueType font that uses one of the patented */ 1.4029 + /* opcodes, 0~otherwise. */ 1.4030 + /* */ 1.4031 + /* <Note> */ 1.4032 + /* Since May 2010, TrueType hinting is no longer patented. */ 1.4033 + /* */ 1.4034 + /* <Since> */ 1.4035 + /* 2.3.5 */ 1.4036 + /* */ 1.4037 + FT_EXPORT( FT_Bool ) 1.4038 + FT_Face_CheckTrueTypePatents( FT_Face face ); 1.4039 + 1.4040 + 1.4041 + /*************************************************************************/ 1.4042 + /* */ 1.4043 + /* <Function> */ 1.4044 + /* FT_Face_SetUnpatentedHinting */ 1.4045 + /* */ 1.4046 + /* <Description> */ 1.4047 + /* Enable or disable the unpatented hinter for a given face. */ 1.4048 + /* Only enable it if you have determined that the face doesn't */ 1.4049 + /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */ 1.4050 + /* */ 1.4051 + /* <Input> */ 1.4052 + /* face :: A face handle. */ 1.4053 + /* */ 1.4054 + /* value :: New boolean setting. */ 1.4055 + /* */ 1.4056 + /* <Return> */ 1.4057 + /* The old setting value. This will always be false if this is not */ 1.4058 + /* an SFNT font, or if the unpatented hinter is not compiled in this */ 1.4059 + /* instance of the library. */ 1.4060 + /* */ 1.4061 + /* <Note> */ 1.4062 + /* Since May 2010, TrueType hinting is no longer patented. */ 1.4063 + /* */ 1.4064 + /* <Since> */ 1.4065 + /* 2.3.5 */ 1.4066 + /* */ 1.4067 + FT_EXPORT( FT_Bool ) 1.4068 + FT_Face_SetUnpatentedHinting( FT_Face face, 1.4069 + FT_Bool value ); 1.4070 + 1.4071 + /* */ 1.4072 + 1.4073 + 1.4074 +FT_END_HEADER 1.4075 + 1.4076 +#endif /* __FREETYPE_H__ */ 1.4077 + 1.4078 + 1.4079 +/* END */