vrshoot

annotate libs/ft2static/freetype/freetype.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
rev   line source
nuclear@0 1 /***************************************************************************/
nuclear@0 2 /* */
nuclear@0 3 /* freetype.h */
nuclear@0 4 /* */
nuclear@0 5 /* FreeType high-level API and common types (specification only). */
nuclear@0 6 /* */
nuclear@0 7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
nuclear@0 8 /* 2010 by */
nuclear@0 9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
nuclear@0 10 /* */
nuclear@0 11 /* This file is part of the FreeType project, and may only be used, */
nuclear@0 12 /* modified, and distributed under the terms of the FreeType project */
nuclear@0 13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
nuclear@0 14 /* this file you indicate that you have read the license and */
nuclear@0 15 /* understand and accept it fully. */
nuclear@0 16 /* */
nuclear@0 17 /***************************************************************************/
nuclear@0 18
nuclear@0 19
nuclear@0 20 #ifndef FT_FREETYPE_H
nuclear@0 21 #error "`ft2build.h' hasn't been included yet!"
nuclear@0 22 #error "Please always use macros to include FreeType header files."
nuclear@0 23 #error "Example:"
nuclear@0 24 #error " #include <ft2build.h>"
nuclear@0 25 #error " #include FT_FREETYPE_H"
nuclear@0 26 #endif
nuclear@0 27
nuclear@0 28
nuclear@0 29 #ifndef __FREETYPE_H__
nuclear@0 30 #define __FREETYPE_H__
nuclear@0 31
nuclear@0 32
nuclear@0 33 #include <ft2build.h>
nuclear@0 34 #include FT_CONFIG_CONFIG_H
nuclear@0 35 #include FT_ERRORS_H
nuclear@0 36 #include FT_TYPES_H
nuclear@0 37
nuclear@0 38
nuclear@0 39 FT_BEGIN_HEADER
nuclear@0 40
nuclear@0 41
nuclear@0 42
nuclear@0 43 /*************************************************************************/
nuclear@0 44 /* */
nuclear@0 45 /* <Section> */
nuclear@0 46 /* user_allocation */
nuclear@0 47 /* */
nuclear@0 48 /* <Title> */
nuclear@0 49 /* User allocation */
nuclear@0 50 /* */
nuclear@0 51 /* <Abstract> */
nuclear@0 52 /* How client applications should allocate FreeType data structures. */
nuclear@0 53 /* */
nuclear@0 54 /* <Description> */
nuclear@0 55 /* FreeType assumes that structures allocated by the user and passed */
nuclear@0 56 /* as arguments are zeroed out except for the actual data. In other */
nuclear@0 57 /* words, it is recommended to use `calloc' (or variants of it) */
nuclear@0 58 /* instead of `malloc' for allocation. */
nuclear@0 59 /* */
nuclear@0 60 /*************************************************************************/
nuclear@0 61
nuclear@0 62
nuclear@0 63
nuclear@0 64 /*************************************************************************/
nuclear@0 65 /*************************************************************************/
nuclear@0 66 /* */
nuclear@0 67 /* B A S I C T Y P E S */
nuclear@0 68 /* */
nuclear@0 69 /*************************************************************************/
nuclear@0 70 /*************************************************************************/
nuclear@0 71
nuclear@0 72
nuclear@0 73 /*************************************************************************/
nuclear@0 74 /* */
nuclear@0 75 /* <Section> */
nuclear@0 76 /* base_interface */
nuclear@0 77 /* */
nuclear@0 78 /* <Title> */
nuclear@0 79 /* Base Interface */
nuclear@0 80 /* */
nuclear@0 81 /* <Abstract> */
nuclear@0 82 /* The FreeType~2 base font interface. */
nuclear@0 83 /* */
nuclear@0 84 /* <Description> */
nuclear@0 85 /* This section describes the public high-level API of FreeType~2. */
nuclear@0 86 /* */
nuclear@0 87 /* <Order> */
nuclear@0 88 /* FT_Library */
nuclear@0 89 /* FT_Face */
nuclear@0 90 /* FT_Size */
nuclear@0 91 /* FT_GlyphSlot */
nuclear@0 92 /* FT_CharMap */
nuclear@0 93 /* FT_Encoding */
nuclear@0 94 /* */
nuclear@0 95 /* FT_FaceRec */
nuclear@0 96 /* */
nuclear@0 97 /* FT_FACE_FLAG_SCALABLE */
nuclear@0 98 /* FT_FACE_FLAG_FIXED_SIZES */
nuclear@0 99 /* FT_FACE_FLAG_FIXED_WIDTH */
nuclear@0 100 /* FT_FACE_FLAG_HORIZONTAL */
nuclear@0 101 /* FT_FACE_FLAG_VERTICAL */
nuclear@0 102 /* FT_FACE_FLAG_SFNT */
nuclear@0 103 /* FT_FACE_FLAG_KERNING */
nuclear@0 104 /* FT_FACE_FLAG_MULTIPLE_MASTERS */
nuclear@0 105 /* FT_FACE_FLAG_GLYPH_NAMES */
nuclear@0 106 /* FT_FACE_FLAG_EXTERNAL_STREAM */
nuclear@0 107 /* FT_FACE_FLAG_FAST_GLYPHS */
nuclear@0 108 /* FT_FACE_FLAG_HINTER */
nuclear@0 109 /* */
nuclear@0 110 /* FT_STYLE_FLAG_BOLD */
nuclear@0 111 /* FT_STYLE_FLAG_ITALIC */
nuclear@0 112 /* */
nuclear@0 113 /* FT_SizeRec */
nuclear@0 114 /* FT_Size_Metrics */
nuclear@0 115 /* */
nuclear@0 116 /* FT_GlyphSlotRec */
nuclear@0 117 /* FT_Glyph_Metrics */
nuclear@0 118 /* FT_SubGlyph */
nuclear@0 119 /* */
nuclear@0 120 /* FT_Bitmap_Size */
nuclear@0 121 /* */
nuclear@0 122 /* FT_Init_FreeType */
nuclear@0 123 /* FT_Done_FreeType */
nuclear@0 124 /* */
nuclear@0 125 /* FT_New_Face */
nuclear@0 126 /* FT_Done_Face */
nuclear@0 127 /* FT_New_Memory_Face */
nuclear@0 128 /* FT_Open_Face */
nuclear@0 129 /* FT_Open_Args */
nuclear@0 130 /* FT_Parameter */
nuclear@0 131 /* FT_Attach_File */
nuclear@0 132 /* FT_Attach_Stream */
nuclear@0 133 /* */
nuclear@0 134 /* FT_Set_Char_Size */
nuclear@0 135 /* FT_Set_Pixel_Sizes */
nuclear@0 136 /* FT_Request_Size */
nuclear@0 137 /* FT_Select_Size */
nuclear@0 138 /* FT_Size_Request_Type */
nuclear@0 139 /* FT_Size_Request */
nuclear@0 140 /* FT_Set_Transform */
nuclear@0 141 /* FT_Load_Glyph */
nuclear@0 142 /* FT_Get_Char_Index */
nuclear@0 143 /* FT_Get_Name_Index */
nuclear@0 144 /* FT_Load_Char */
nuclear@0 145 /* */
nuclear@0 146 /* FT_OPEN_MEMORY */
nuclear@0 147 /* FT_OPEN_STREAM */
nuclear@0 148 /* FT_OPEN_PATHNAME */
nuclear@0 149 /* FT_OPEN_DRIVER */
nuclear@0 150 /* FT_OPEN_PARAMS */
nuclear@0 151 /* */
nuclear@0 152 /* FT_LOAD_DEFAULT */
nuclear@0 153 /* FT_LOAD_RENDER */
nuclear@0 154 /* FT_LOAD_MONOCHROME */
nuclear@0 155 /* FT_LOAD_LINEAR_DESIGN */
nuclear@0 156 /* FT_LOAD_NO_SCALE */
nuclear@0 157 /* FT_LOAD_NO_HINTING */
nuclear@0 158 /* FT_LOAD_NO_BITMAP */
nuclear@0 159 /* FT_LOAD_CROP_BITMAP */
nuclear@0 160 /* */
nuclear@0 161 /* FT_LOAD_VERTICAL_LAYOUT */
nuclear@0 162 /* FT_LOAD_IGNORE_TRANSFORM */
nuclear@0 163 /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
nuclear@0 164 /* FT_LOAD_FORCE_AUTOHINT */
nuclear@0 165 /* FT_LOAD_NO_RECURSE */
nuclear@0 166 /* FT_LOAD_PEDANTIC */
nuclear@0 167 /* */
nuclear@0 168 /* FT_LOAD_TARGET_NORMAL */
nuclear@0 169 /* FT_LOAD_TARGET_LIGHT */
nuclear@0 170 /* FT_LOAD_TARGET_MONO */
nuclear@0 171 /* FT_LOAD_TARGET_LCD */
nuclear@0 172 /* FT_LOAD_TARGET_LCD_V */
nuclear@0 173 /* */
nuclear@0 174 /* FT_Render_Glyph */
nuclear@0 175 /* FT_Render_Mode */
nuclear@0 176 /* FT_Get_Kerning */
nuclear@0 177 /* FT_Kerning_Mode */
nuclear@0 178 /* FT_Get_Track_Kerning */
nuclear@0 179 /* FT_Get_Glyph_Name */
nuclear@0 180 /* FT_Get_Postscript_Name */
nuclear@0 181 /* */
nuclear@0 182 /* FT_CharMapRec */
nuclear@0 183 /* FT_Select_Charmap */
nuclear@0 184 /* FT_Set_Charmap */
nuclear@0 185 /* FT_Get_Charmap_Index */
nuclear@0 186 /* */
nuclear@0 187 /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
nuclear@0 188 /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
nuclear@0 189 /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
nuclear@0 190 /* FT_FSTYPE_EDITABLE_EMBEDDING */
nuclear@0 191 /* FT_FSTYPE_NO_SUBSETTING */
nuclear@0 192 /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
nuclear@0 193 /* */
nuclear@0 194 /* FT_Get_FSType_Flags */
nuclear@0 195 /* */
nuclear@0 196 /*************************************************************************/
nuclear@0 197
nuclear@0 198
nuclear@0 199 /*************************************************************************/
nuclear@0 200 /* */
nuclear@0 201 /* <Struct> */
nuclear@0 202 /* FT_Glyph_Metrics */
nuclear@0 203 /* */
nuclear@0 204 /* <Description> */
nuclear@0 205 /* A structure used to model the metrics of a single glyph. The */
nuclear@0 206 /* values are expressed in 26.6 fractional pixel format; if the flag */
nuclear@0 207 /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
nuclear@0 208 /* are expressed in font units instead. */
nuclear@0 209 /* */
nuclear@0 210 /* <Fields> */
nuclear@0 211 /* width :: */
nuclear@0 212 /* The glyph's width. */
nuclear@0 213 /* */
nuclear@0 214 /* height :: */
nuclear@0 215 /* The glyph's height. */
nuclear@0 216 /* */
nuclear@0 217 /* horiBearingX :: */
nuclear@0 218 /* Left side bearing for horizontal layout. */
nuclear@0 219 /* */
nuclear@0 220 /* horiBearingY :: */
nuclear@0 221 /* Top side bearing for horizontal layout. */
nuclear@0 222 /* */
nuclear@0 223 /* horiAdvance :: */
nuclear@0 224 /* Advance width for horizontal layout. */
nuclear@0 225 /* */
nuclear@0 226 /* vertBearingX :: */
nuclear@0 227 /* Left side bearing for vertical layout. */
nuclear@0 228 /* */
nuclear@0 229 /* vertBearingY :: */
nuclear@0 230 /* Top side bearing for vertical layout. */
nuclear@0 231 /* */
nuclear@0 232 /* vertAdvance :: */
nuclear@0 233 /* Advance height for vertical layout. */
nuclear@0 234 /* */
nuclear@0 235 /* <Note> */
nuclear@0 236 /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
nuclear@0 237 /* dimensions of the hinted glyph (in case hinting is applicable). */
nuclear@0 238 /* */
nuclear@0 239 typedef struct FT_Glyph_Metrics_
nuclear@0 240 {
nuclear@0 241 FT_Pos width;
nuclear@0 242 FT_Pos height;
nuclear@0 243
nuclear@0 244 FT_Pos horiBearingX;
nuclear@0 245 FT_Pos horiBearingY;
nuclear@0 246 FT_Pos horiAdvance;
nuclear@0 247
nuclear@0 248 FT_Pos vertBearingX;
nuclear@0 249 FT_Pos vertBearingY;
nuclear@0 250 FT_Pos vertAdvance;
nuclear@0 251
nuclear@0 252 } FT_Glyph_Metrics;
nuclear@0 253
nuclear@0 254
nuclear@0 255 /*************************************************************************/
nuclear@0 256 /* */
nuclear@0 257 /* <Struct> */
nuclear@0 258 /* FT_Bitmap_Size */
nuclear@0 259 /* */
nuclear@0 260 /* <Description> */
nuclear@0 261 /* This structure models the metrics of a bitmap strike (i.e., a set */
nuclear@0 262 /* of glyphs for a given point size and resolution) in a bitmap font. */
nuclear@0 263 /* It is used for the `available_sizes' field of @FT_Face. */
nuclear@0 264 /* */
nuclear@0 265 /* <Fields> */
nuclear@0 266 /* height :: The vertical distance, in pixels, between two */
nuclear@0 267 /* consecutive baselines. It is always positive. */
nuclear@0 268 /* */
nuclear@0 269 /* width :: The average width, in pixels, of all glyphs in the */
nuclear@0 270 /* strike. */
nuclear@0 271 /* */
nuclear@0 272 /* size :: The nominal size of the strike in 26.6 fractional */
nuclear@0 273 /* points. This field is not very useful. */
nuclear@0 274 /* */
nuclear@0 275 /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
nuclear@0 276 /* pixels. */
nuclear@0 277 /* */
nuclear@0 278 /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
nuclear@0 279 /* pixels. */
nuclear@0 280 /* */
nuclear@0 281 /* <Note> */
nuclear@0 282 /* Windows FNT: */
nuclear@0 283 /* The nominal size given in a FNT font is not reliable. Thus when */
nuclear@0 284 /* the driver finds it incorrect, it sets `size' to some calculated */
nuclear@0 285 /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
nuclear@0 286 /* height given in the font, respectively. */
nuclear@0 287 /* */
nuclear@0 288 /* TrueType embedded bitmaps: */
nuclear@0 289 /* `size', `width', and `height' values are not contained in the */
nuclear@0 290 /* bitmap strike itself. They are computed from the global font */
nuclear@0 291 /* parameters. */
nuclear@0 292 /* */
nuclear@0 293 typedef struct FT_Bitmap_Size_
nuclear@0 294 {
nuclear@0 295 FT_Short height;
nuclear@0 296 FT_Short width;
nuclear@0 297
nuclear@0 298 FT_Pos size;
nuclear@0 299
nuclear@0 300 FT_Pos x_ppem;
nuclear@0 301 FT_Pos y_ppem;
nuclear@0 302
nuclear@0 303 } FT_Bitmap_Size;
nuclear@0 304
nuclear@0 305
nuclear@0 306 /*************************************************************************/
nuclear@0 307 /*************************************************************************/
nuclear@0 308 /* */
nuclear@0 309 /* O B J E C T C L A S S E S */
nuclear@0 310 /* */
nuclear@0 311 /*************************************************************************/
nuclear@0 312 /*************************************************************************/
nuclear@0 313
nuclear@0 314 /*************************************************************************/
nuclear@0 315 /* */
nuclear@0 316 /* <Type> */
nuclear@0 317 /* FT_Library */
nuclear@0 318 /* */
nuclear@0 319 /* <Description> */
nuclear@0 320 /* A handle to a FreeType library instance. Each `library' is */
nuclear@0 321 /* completely independent from the others; it is the `root' of a set */
nuclear@0 322 /* of objects like fonts, faces, sizes, etc. */
nuclear@0 323 /* */
nuclear@0 324 /* It also embeds a memory manager (see @FT_Memory), as well as a */
nuclear@0 325 /* scan-line converter object (see @FT_Raster). */
nuclear@0 326 /* */
nuclear@0 327 /* For multi-threading applications each thread should have its own */
nuclear@0 328 /* FT_Library object. */
nuclear@0 329 /* */
nuclear@0 330 /* <Note> */
nuclear@0 331 /* Library objects are normally created by @FT_Init_FreeType, and */
nuclear@0 332 /* destroyed with @FT_Done_FreeType. */
nuclear@0 333 /* */
nuclear@0 334 typedef struct FT_LibraryRec_ *FT_Library;
nuclear@0 335
nuclear@0 336
nuclear@0 337 /*************************************************************************/
nuclear@0 338 /* */
nuclear@0 339 /* <Type> */
nuclear@0 340 /* FT_Module */
nuclear@0 341 /* */
nuclear@0 342 /* <Description> */
nuclear@0 343 /* A handle to a given FreeType module object. Each module can be a */
nuclear@0 344 /* font driver, a renderer, or anything else that provides services */
nuclear@0 345 /* to the formers. */
nuclear@0 346 /* */
nuclear@0 347 typedef struct FT_ModuleRec_* FT_Module;
nuclear@0 348
nuclear@0 349
nuclear@0 350 /*************************************************************************/
nuclear@0 351 /* */
nuclear@0 352 /* <Type> */
nuclear@0 353 /* FT_Driver */
nuclear@0 354 /* */
nuclear@0 355 /* <Description> */
nuclear@0 356 /* A handle to a given FreeType font driver object. Each font driver */
nuclear@0 357 /* is a special module capable of creating faces from font files. */
nuclear@0 358 /* */
nuclear@0 359 typedef struct FT_DriverRec_* FT_Driver;
nuclear@0 360
nuclear@0 361
nuclear@0 362 /*************************************************************************/
nuclear@0 363 /* */
nuclear@0 364 /* <Type> */
nuclear@0 365 /* FT_Renderer */
nuclear@0 366 /* */
nuclear@0 367 /* <Description> */
nuclear@0 368 /* A handle to a given FreeType renderer. A renderer is a special */
nuclear@0 369 /* module in charge of converting a glyph image to a bitmap, when */
nuclear@0 370 /* necessary. Each renderer supports a given glyph image format, and */
nuclear@0 371 /* one or more target surface depths. */
nuclear@0 372 /* */
nuclear@0 373 typedef struct FT_RendererRec_* FT_Renderer;
nuclear@0 374
nuclear@0 375
nuclear@0 376 /*************************************************************************/
nuclear@0 377 /* */
nuclear@0 378 /* <Type> */
nuclear@0 379 /* FT_Face */
nuclear@0 380 /* */
nuclear@0 381 /* <Description> */
nuclear@0 382 /* A handle to a given typographic face object. A face object models */
nuclear@0 383 /* a given typeface, in a given style. */
nuclear@0 384 /* */
nuclear@0 385 /* <Note> */
nuclear@0 386 /* Each face object also owns a single @FT_GlyphSlot object, as well */
nuclear@0 387 /* as one or more @FT_Size objects. */
nuclear@0 388 /* */
nuclear@0 389 /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
nuclear@0 390 /* a given filepathname or a custom input stream. */
nuclear@0 391 /* */
nuclear@0 392 /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
nuclear@0 393 /* */
nuclear@0 394 /* <Also> */
nuclear@0 395 /* See @FT_FaceRec for the publicly accessible fields of a given face */
nuclear@0 396 /* object. */
nuclear@0 397 /* */
nuclear@0 398 typedef struct FT_FaceRec_* FT_Face;
nuclear@0 399
nuclear@0 400
nuclear@0 401 /*************************************************************************/
nuclear@0 402 /* */
nuclear@0 403 /* <Type> */
nuclear@0 404 /* FT_Size */
nuclear@0 405 /* */
nuclear@0 406 /* <Description> */
nuclear@0 407 /* A handle to an object used to model a face scaled to a given */
nuclear@0 408 /* character size. */
nuclear@0 409 /* */
nuclear@0 410 /* <Note> */
nuclear@0 411 /* Each @FT_Face has an _active_ @FT_Size object that is used by */
nuclear@0 412 /* functions like @FT_Load_Glyph to determine the scaling */
nuclear@0 413 /* transformation which is used to load and hint glyphs and metrics. */
nuclear@0 414 /* */
nuclear@0 415 /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
nuclear@0 416 /* @FT_Request_Size or even @FT_Select_Size to change the content */
nuclear@0 417 /* (i.e., the scaling values) of the active @FT_Size. */
nuclear@0 418 /* */
nuclear@0 419 /* You can use @FT_New_Size to create additional size objects for a */
nuclear@0 420 /* given @FT_Face, but they won't be used by other functions until */
nuclear@0 421 /* you activate it through @FT_Activate_Size. Only one size can be */
nuclear@0 422 /* activated at any given time per face. */
nuclear@0 423 /* */
nuclear@0 424 /* <Also> */
nuclear@0 425 /* See @FT_SizeRec for the publicly accessible fields of a given size */
nuclear@0 426 /* object. */
nuclear@0 427 /* */
nuclear@0 428 typedef struct FT_SizeRec_* FT_Size;
nuclear@0 429
nuclear@0 430
nuclear@0 431 /*************************************************************************/
nuclear@0 432 /* */
nuclear@0 433 /* <Type> */
nuclear@0 434 /* FT_GlyphSlot */
nuclear@0 435 /* */
nuclear@0 436 /* <Description> */
nuclear@0 437 /* A handle to a given `glyph slot'. A slot is a container where it */
nuclear@0 438 /* is possible to load any of the glyphs contained in its parent */
nuclear@0 439 /* face. */
nuclear@0 440 /* */
nuclear@0 441 /* In other words, each time you call @FT_Load_Glyph or */
nuclear@0 442 /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
nuclear@0 443 /* i.e., the glyph's metrics, its image (bitmap or outline), and */
nuclear@0 444 /* other control information. */
nuclear@0 445 /* */
nuclear@0 446 /* <Also> */
nuclear@0 447 /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
nuclear@0 448 /* */
nuclear@0 449 typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
nuclear@0 450
nuclear@0 451
nuclear@0 452 /*************************************************************************/
nuclear@0 453 /* */
nuclear@0 454 /* <Type> */
nuclear@0 455 /* FT_CharMap */
nuclear@0 456 /* */
nuclear@0 457 /* <Description> */
nuclear@0 458 /* A handle to a given character map. A charmap is used to translate */
nuclear@0 459 /* character codes in a given encoding into glyph indexes for its */
nuclear@0 460 /* parent's face. Some font formats may provide several charmaps per */
nuclear@0 461 /* font. */
nuclear@0 462 /* */
nuclear@0 463 /* Each face object owns zero or more charmaps, but only one of them */
nuclear@0 464 /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
nuclear@0 465 /* */
nuclear@0 466 /* The list of available charmaps in a face is available through the */
nuclear@0 467 /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
nuclear@0 468 /* */
nuclear@0 469 /* The currently active charmap is available as `face->charmap'. */
nuclear@0 470 /* You should call @FT_Set_Charmap to change it. */
nuclear@0 471 /* */
nuclear@0 472 /* <Note> */
nuclear@0 473 /* When a new face is created (either through @FT_New_Face or */
nuclear@0 474 /* @FT_Open_Face), the library looks for a Unicode charmap within */
nuclear@0 475 /* the list and automatically activates it. */
nuclear@0 476 /* */
nuclear@0 477 /* <Also> */
nuclear@0 478 /* See @FT_CharMapRec for the publicly accessible fields of a given */
nuclear@0 479 /* character map. */
nuclear@0 480 /* */
nuclear@0 481 typedef struct FT_CharMapRec_* FT_CharMap;
nuclear@0 482
nuclear@0 483
nuclear@0 484 /*************************************************************************/
nuclear@0 485 /* */
nuclear@0 486 /* <Macro> */
nuclear@0 487 /* FT_ENC_TAG */
nuclear@0 488 /* */
nuclear@0 489 /* <Description> */
nuclear@0 490 /* This macro converts four-letter tags into an unsigned long. It is */
nuclear@0 491 /* used to define `encoding' identifiers (see @FT_Encoding). */
nuclear@0 492 /* */
nuclear@0 493 /* <Note> */
nuclear@0 494 /* Since many 16-bit compilers don't like 32-bit enumerations, you */
nuclear@0 495 /* should redefine this macro in case of problems to something like */
nuclear@0 496 /* this: */
nuclear@0 497 /* */
nuclear@0 498 /* { */
nuclear@0 499 /* #define FT_ENC_TAG( value, a, b, c, d ) value */
nuclear@0 500 /* } */
nuclear@0 501 /* */
nuclear@0 502 /* to get a simple enumeration without assigning special numbers. */
nuclear@0 503 /* */
nuclear@0 504
nuclear@0 505 #ifndef FT_ENC_TAG
nuclear@0 506 #define FT_ENC_TAG( value, a, b, c, d ) \
nuclear@0 507 value = ( ( (FT_UInt32)(a) << 24 ) | \
nuclear@0 508 ( (FT_UInt32)(b) << 16 ) | \
nuclear@0 509 ( (FT_UInt32)(c) << 8 ) | \
nuclear@0 510 (FT_UInt32)(d) )
nuclear@0 511
nuclear@0 512 #endif /* FT_ENC_TAG */
nuclear@0 513
nuclear@0 514
nuclear@0 515 /*************************************************************************/
nuclear@0 516 /* */
nuclear@0 517 /* <Enum> */
nuclear@0 518 /* FT_Encoding */
nuclear@0 519 /* */
nuclear@0 520 /* <Description> */
nuclear@0 521 /* An enumeration used to specify character sets supported by */
nuclear@0 522 /* charmaps. Used in the @FT_Select_Charmap API function. */
nuclear@0 523 /* */
nuclear@0 524 /* <Note> */
nuclear@0 525 /* Despite the name, this enumeration lists specific character */
nuclear@0 526 /* repertories (i.e., charsets), and not text encoding methods (e.g., */
nuclear@0 527 /* UTF-8, UTF-16, etc.). */
nuclear@0 528 /* */
nuclear@0 529 /* Other encodings might be defined in the future. */
nuclear@0 530 /* */
nuclear@0 531 /* <Values> */
nuclear@0 532 /* FT_ENCODING_NONE :: */
nuclear@0 533 /* The encoding value~0 is reserved. */
nuclear@0 534 /* */
nuclear@0 535 /* FT_ENCODING_UNICODE :: */
nuclear@0 536 /* Corresponds to the Unicode character set. This value covers */
nuclear@0 537 /* all versions of the Unicode repertoire, including ASCII and */
nuclear@0 538 /* Latin-1. Most fonts include a Unicode charmap, but not all */
nuclear@0 539 /* of them. */
nuclear@0 540 /* */
nuclear@0 541 /* For example, if you want to access Unicode value U+1F028 (and */
nuclear@0 542 /* the font contains it), use value 0x1F028 as the input value for */
nuclear@0 543 /* @FT_Get_Char_Index. */
nuclear@0 544 /* */
nuclear@0 545 /* FT_ENCODING_MS_SYMBOL :: */
nuclear@0 546 /* Corresponds to the Microsoft Symbol encoding, used to encode */
nuclear@0 547 /* mathematical symbols in the 32..255 character code range. For */
nuclear@0 548 /* more information, see `http://www.ceviz.net/symbol.htm'. */
nuclear@0 549 /* */
nuclear@0 550 /* FT_ENCODING_SJIS :: */
nuclear@0 551 /* Corresponds to Japanese SJIS encoding. More info at */
nuclear@0 552 /* at `http://langsupport.japanreference.com/encoding.shtml'. */
nuclear@0 553 /* See note on multi-byte encodings below. */
nuclear@0 554 /* */
nuclear@0 555 /* FT_ENCODING_GB2312 :: */
nuclear@0 556 /* Corresponds to an encoding system for Simplified Chinese as used */
nuclear@0 557 /* used in mainland China. */
nuclear@0 558 /* */
nuclear@0 559 /* FT_ENCODING_BIG5 :: */
nuclear@0 560 /* Corresponds to an encoding system for Traditional Chinese as */
nuclear@0 561 /* used in Taiwan and Hong Kong. */
nuclear@0 562 /* */
nuclear@0 563 /* FT_ENCODING_WANSUNG :: */
nuclear@0 564 /* Corresponds to the Korean encoding system known as Wansung. */
nuclear@0 565 /* For more information see */
nuclear@0 566 /* `http://www.microsoft.com/typography/unicode/949.txt'. */
nuclear@0 567 /* */
nuclear@0 568 /* FT_ENCODING_JOHAB :: */
nuclear@0 569 /* The Korean standard character set (KS~C 5601-1992), which */
nuclear@0 570 /* corresponds to MS Windows code page 1361. This character set */
nuclear@0 571 /* includes all possible Hangeul character combinations. */
nuclear@0 572 /* */
nuclear@0 573 /* FT_ENCODING_ADOBE_LATIN_1 :: */
nuclear@0 574 /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
nuclear@0 575 /* PostScript font. It is limited to 256 character codes. */
nuclear@0 576 /* */
nuclear@0 577 /* FT_ENCODING_ADOBE_STANDARD :: */
nuclear@0 578 /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
nuclear@0 579 /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
nuclear@0 580 /* codes. */
nuclear@0 581 /* */
nuclear@0 582 /* FT_ENCODING_ADOBE_EXPERT :: */
nuclear@0 583 /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
nuclear@0 584 /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
nuclear@0 585 /* codes. */
nuclear@0 586 /* */
nuclear@0 587 /* FT_ENCODING_ADOBE_CUSTOM :: */
nuclear@0 588 /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
nuclear@0 589 /* OpenType/CFF fonts. It is limited to 256 character codes. */
nuclear@0 590 /* */
nuclear@0 591 /* FT_ENCODING_APPLE_ROMAN :: */
nuclear@0 592 /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
nuclear@0 593 /* and OpenType fonts contain a charmap for this encoding, since */
nuclear@0 594 /* older versions of Mac OS are able to use it. */
nuclear@0 595 /* */
nuclear@0 596 /* FT_ENCODING_OLD_LATIN_2 :: */
nuclear@0 597 /* This value is deprecated and was never used nor reported by */
nuclear@0 598 /* FreeType. Don't use or test for it. */
nuclear@0 599 /* */
nuclear@0 600 /* FT_ENCODING_MS_SJIS :: */
nuclear@0 601 /* Same as FT_ENCODING_SJIS. Deprecated. */
nuclear@0 602 /* */
nuclear@0 603 /* FT_ENCODING_MS_GB2312 :: */
nuclear@0 604 /* Same as FT_ENCODING_GB2312. Deprecated. */
nuclear@0 605 /* */
nuclear@0 606 /* FT_ENCODING_MS_BIG5 :: */
nuclear@0 607 /* Same as FT_ENCODING_BIG5. Deprecated. */
nuclear@0 608 /* */
nuclear@0 609 /* FT_ENCODING_MS_WANSUNG :: */
nuclear@0 610 /* Same as FT_ENCODING_WANSUNG. Deprecated. */
nuclear@0 611 /* */
nuclear@0 612 /* FT_ENCODING_MS_JOHAB :: */
nuclear@0 613 /* Same as FT_ENCODING_JOHAB. Deprecated. */
nuclear@0 614 /* */
nuclear@0 615 /* <Note> */
nuclear@0 616 /* By default, FreeType automatically synthesizes a Unicode charmap */
nuclear@0 617 /* for PostScript fonts, using their glyph names dictionaries. */
nuclear@0 618 /* However, it also reports the encodings defined explicitly in the */
nuclear@0 619 /* font file, for the cases when they are needed, with the Adobe */
nuclear@0 620 /* values as well. */
nuclear@0 621 /* */
nuclear@0 622 /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
nuclear@0 623 /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
nuclear@0 624 /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
nuclear@0 625 /* which encoding is really present. If, for example, the */
nuclear@0 626 /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
nuclear@0 627 /* the font is encoded in KOI8-R. */
nuclear@0 628 /* */
nuclear@0 629 /* FT_ENCODING_NONE is always set (with a single exception) by the */
nuclear@0 630 /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
nuclear@0 631 /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
nuclear@0 632 /* which encoding is really present. For example, */
nuclear@0 633 /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
nuclear@0 634 /* Russian). */
nuclear@0 635 /* */
nuclear@0 636 /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
nuclear@0 637 /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
nuclear@0 638 /* FT_ENCODING_APPLE_ROMAN). */
nuclear@0 639 /* */
nuclear@0 640 /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
nuclear@0 641 /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
nuclear@0 642 /* be needed to be able to distinguish Apple encoding variants. See */
nuclear@0 643 /* */
nuclear@0 644 /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
nuclear@0 645 /* */
nuclear@0 646 /* to get an idea how to do that. Basically, if the language ID */
nuclear@0 647 /* is~0, don't use it, otherwise subtract 1 from the language ID. */
nuclear@0 648 /* Then examine `encoding_id'. If, for example, `encoding_id' is */
nuclear@0 649 /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
nuclear@0 650 /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
nuclear@0 651 /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
nuclear@0 652 /* variant the Arabic encoding. */
nuclear@0 653 /* */
nuclear@0 654 typedef enum FT_Encoding_
nuclear@0 655 {
nuclear@0 656 FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
nuclear@0 657
nuclear@0 658 FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
nuclear@0 659 FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
nuclear@0 660
nuclear@0 661 FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
nuclear@0 662 FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
nuclear@0 663 FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
nuclear@0 664 FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
nuclear@0 665 FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
nuclear@0 666
nuclear@0 667 /* for backwards compatibility */
nuclear@0 668 FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
nuclear@0 669 FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
nuclear@0 670 FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
nuclear@0 671 FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
nuclear@0 672 FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
nuclear@0 673
nuclear@0 674 FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
nuclear@0 675 FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
nuclear@0 676 FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
nuclear@0 677 FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
nuclear@0 678
nuclear@0 679 FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
nuclear@0 680
nuclear@0 681 FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
nuclear@0 682
nuclear@0 683 } FT_Encoding;
nuclear@0 684
nuclear@0 685
nuclear@0 686 /*************************************************************************/
nuclear@0 687 /* */
nuclear@0 688 /* <Enum> */
nuclear@0 689 /* ft_encoding_xxx */
nuclear@0 690 /* */
nuclear@0 691 /* <Description> */
nuclear@0 692 /* These constants are deprecated; use the corresponding @FT_Encoding */
nuclear@0 693 /* values instead. */
nuclear@0 694 /* */
nuclear@0 695 #define ft_encoding_none FT_ENCODING_NONE
nuclear@0 696 #define ft_encoding_unicode FT_ENCODING_UNICODE
nuclear@0 697 #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
nuclear@0 698 #define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
nuclear@0 699 #define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
nuclear@0 700 #define ft_encoding_sjis FT_ENCODING_SJIS
nuclear@0 701 #define ft_encoding_gb2312 FT_ENCODING_GB2312
nuclear@0 702 #define ft_encoding_big5 FT_ENCODING_BIG5
nuclear@0 703 #define ft_encoding_wansung FT_ENCODING_WANSUNG
nuclear@0 704 #define ft_encoding_johab FT_ENCODING_JOHAB
nuclear@0 705
nuclear@0 706 #define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
nuclear@0 707 #define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
nuclear@0 708 #define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
nuclear@0 709 #define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
nuclear@0 710
nuclear@0 711
nuclear@0 712 /*************************************************************************/
nuclear@0 713 /* */
nuclear@0 714 /* <Struct> */
nuclear@0 715 /* FT_CharMapRec */
nuclear@0 716 /* */
nuclear@0 717 /* <Description> */
nuclear@0 718 /* The base charmap structure. */
nuclear@0 719 /* */
nuclear@0 720 /* <Fields> */
nuclear@0 721 /* face :: A handle to the parent face object. */
nuclear@0 722 /* */
nuclear@0 723 /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
nuclear@0 724 /* this with @FT_Select_Charmap. */
nuclear@0 725 /* */
nuclear@0 726 /* platform_id :: An ID number describing the platform for the */
nuclear@0 727 /* following encoding ID. This comes directly from */
nuclear@0 728 /* the TrueType specification and should be emulated */
nuclear@0 729 /* for other formats. */
nuclear@0 730 /* */
nuclear@0 731 /* encoding_id :: A platform specific encoding number. This also */
nuclear@0 732 /* comes from the TrueType specification and should be */
nuclear@0 733 /* emulated similarly. */
nuclear@0 734 /* */
nuclear@0 735 typedef struct FT_CharMapRec_
nuclear@0 736 {
nuclear@0 737 FT_Face face;
nuclear@0 738 FT_Encoding encoding;
nuclear@0 739 FT_UShort platform_id;
nuclear@0 740 FT_UShort encoding_id;
nuclear@0 741
nuclear@0 742 } FT_CharMapRec;
nuclear@0 743
nuclear@0 744
nuclear@0 745 /*************************************************************************/
nuclear@0 746 /*************************************************************************/
nuclear@0 747 /* */
nuclear@0 748 /* B A S E O B J E C T C L A S S E S */
nuclear@0 749 /* */
nuclear@0 750 /*************************************************************************/
nuclear@0 751 /*************************************************************************/
nuclear@0 752
nuclear@0 753
nuclear@0 754 /*************************************************************************/
nuclear@0 755 /* */
nuclear@0 756 /* <Type> */
nuclear@0 757 /* FT_Face_Internal */
nuclear@0 758 /* */
nuclear@0 759 /* <Description> */
nuclear@0 760 /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
nuclear@0 761 /* model private data of a given @FT_Face object. */
nuclear@0 762 /* */
nuclear@0 763 /* This structure might change between releases of FreeType~2 and is */
nuclear@0 764 /* not generally available to client applications. */
nuclear@0 765 /* */
nuclear@0 766 typedef struct FT_Face_InternalRec_* FT_Face_Internal;
nuclear@0 767
nuclear@0 768
nuclear@0 769 /*************************************************************************/
nuclear@0 770 /* */
nuclear@0 771 /* <Struct> */
nuclear@0 772 /* FT_FaceRec */
nuclear@0 773 /* */
nuclear@0 774 /* <Description> */
nuclear@0 775 /* FreeType root face class structure. A face object models a */
nuclear@0 776 /* typeface in a font file. */
nuclear@0 777 /* */
nuclear@0 778 /* <Fields> */
nuclear@0 779 /* num_faces :: The number of faces in the font file. Some */
nuclear@0 780 /* font formats can have multiple faces in */
nuclear@0 781 /* a font file. */
nuclear@0 782 /* */
nuclear@0 783 /* face_index :: The index of the face in the font file. It */
nuclear@0 784 /* is set to~0 if there is only one face in */
nuclear@0 785 /* the font file. */
nuclear@0 786 /* */
nuclear@0 787 /* face_flags :: A set of bit flags that give important */
nuclear@0 788 /* information about the face; see */
nuclear@0 789 /* @FT_FACE_FLAG_XXX for the details. */
nuclear@0 790 /* */
nuclear@0 791 /* style_flags :: A set of bit flags indicating the style of */
nuclear@0 792 /* the face; see @FT_STYLE_FLAG_XXX for the */
nuclear@0 793 /* details. */
nuclear@0 794 /* */
nuclear@0 795 /* num_glyphs :: The number of glyphs in the face. If the */
nuclear@0 796 /* face is scalable and has sbits (see */
nuclear@0 797 /* `num_fixed_sizes'), it is set to the number */
nuclear@0 798 /* of outline glyphs. */
nuclear@0 799 /* */
nuclear@0 800 /* For CID-keyed fonts, this value gives the */
nuclear@0 801 /* highest CID used in the font. */
nuclear@0 802 /* */
nuclear@0 803 /* family_name :: The face's family name. This is an ASCII */
nuclear@0 804 /* string, usually in English, which describes */
nuclear@0 805 /* the typeface's family (like `Times New */
nuclear@0 806 /* Roman', `Bodoni', `Garamond', etc). This */
nuclear@0 807 /* is a least common denominator used to list */
nuclear@0 808 /* fonts. Some formats (TrueType & OpenType) */
nuclear@0 809 /* provide localized and Unicode versions of */
nuclear@0 810 /* this string. Applications should use the */
nuclear@0 811 /* format specific interface to access them. */
nuclear@0 812 /* Can be NULL (e.g., in fonts embedded in a */
nuclear@0 813 /* PDF file). */
nuclear@0 814 /* */
nuclear@0 815 /* style_name :: The face's style name. This is an ASCII */
nuclear@0 816 /* string, usually in English, which describes */
nuclear@0 817 /* the typeface's style (like `Italic', */
nuclear@0 818 /* `Bold', `Condensed', etc). Not all font */
nuclear@0 819 /* formats provide a style name, so this field */
nuclear@0 820 /* is optional, and can be set to NULL. As */
nuclear@0 821 /* for `family_name', some formats provide */
nuclear@0 822 /* localized and Unicode versions of this */
nuclear@0 823 /* string. Applications should use the format */
nuclear@0 824 /* specific interface to access them. */
nuclear@0 825 /* */
nuclear@0 826 /* num_fixed_sizes :: The number of bitmap strikes in the face. */
nuclear@0 827 /* Even if the face is scalable, there might */
nuclear@0 828 /* still be bitmap strikes, which are called */
nuclear@0 829 /* `sbits' in that case. */
nuclear@0 830 /* */
nuclear@0 831 /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
nuclear@0 832 /* strikes in the face. It is set to NULL if */
nuclear@0 833 /* there is no bitmap strike. */
nuclear@0 834 /* */
nuclear@0 835 /* num_charmaps :: The number of charmaps in the face. */
nuclear@0 836 /* */
nuclear@0 837 /* charmaps :: An array of the charmaps of the face. */
nuclear@0 838 /* */
nuclear@0 839 /* generic :: A field reserved for client uses. See the */
nuclear@0 840 /* @FT_Generic type description. */
nuclear@0 841 /* */
nuclear@0 842 /* bbox :: The font bounding box. Coordinates are */
nuclear@0 843 /* expressed in font units (see */
nuclear@0 844 /* `units_per_EM'). The box is large enough */
nuclear@0 845 /* to contain any glyph from the font. Thus, */
nuclear@0 846 /* `bbox.yMax' can be seen as the `maximal */
nuclear@0 847 /* ascender', and `bbox.yMin' as the `minimal */
nuclear@0 848 /* descender'. Only relevant for scalable */
nuclear@0 849 /* formats. */
nuclear@0 850 /* */
nuclear@0 851 /* Note that the bounding box might be off by */
nuclear@0 852 /* (at least) one pixel for hinted fonts. See */
nuclear@0 853 /* @FT_Size_Metrics for further discussion. */
nuclear@0 854 /* */
nuclear@0 855 /* units_per_EM :: The number of font units per EM square for */
nuclear@0 856 /* this face. This is typically 2048 for */
nuclear@0 857 /* TrueType fonts, and 1000 for Type~1 fonts. */
nuclear@0 858 /* Only relevant for scalable formats. */
nuclear@0 859 /* */
nuclear@0 860 /* ascender :: The typographic ascender of the face, */
nuclear@0 861 /* expressed in font units. For font formats */
nuclear@0 862 /* not having this information, it is set to */
nuclear@0 863 /* `bbox.yMax'. Only relevant for scalable */
nuclear@0 864 /* formats. */
nuclear@0 865 /* */
nuclear@0 866 /* descender :: The typographic descender of the face, */
nuclear@0 867 /* expressed in font units. For font formats */
nuclear@0 868 /* not having this information, it is set to */
nuclear@0 869 /* `bbox.yMin'. Note that this field is */
nuclear@0 870 /* usually negative. Only relevant for */
nuclear@0 871 /* scalable formats. */
nuclear@0 872 /* */
nuclear@0 873 /* height :: The height is the vertical distance */
nuclear@0 874 /* between two consecutive baselines, */
nuclear@0 875 /* expressed in font units. It is always */
nuclear@0 876 /* positive. Only relevant for scalable */
nuclear@0 877 /* formats. */
nuclear@0 878 /* */
nuclear@0 879 /* max_advance_width :: The maximal advance width, in font units, */
nuclear@0 880 /* for all glyphs in this face. This can be */
nuclear@0 881 /* used to make word wrapping computations */
nuclear@0 882 /* faster. Only relevant for scalable */
nuclear@0 883 /* formats. */
nuclear@0 884 /* */
nuclear@0 885 /* max_advance_height :: The maximal advance height, in font units, */
nuclear@0 886 /* for all glyphs in this face. This is only */
nuclear@0 887 /* relevant for vertical layouts, and is set */
nuclear@0 888 /* to `height' for fonts that do not provide */
nuclear@0 889 /* vertical metrics. Only relevant for */
nuclear@0 890 /* scalable formats. */
nuclear@0 891 /* */
nuclear@0 892 /* underline_position :: The position, in font units, of the */
nuclear@0 893 /* underline line for this face. It is the */
nuclear@0 894 /* center of the underlining stem. Only */
nuclear@0 895 /* relevant for scalable formats. */
nuclear@0 896 /* */
nuclear@0 897 /* underline_thickness :: The thickness, in font units, of the */
nuclear@0 898 /* underline for this face. Only relevant for */
nuclear@0 899 /* scalable formats. */
nuclear@0 900 /* */
nuclear@0 901 /* glyph :: The face's associated glyph slot(s). */
nuclear@0 902 /* */
nuclear@0 903 /* size :: The current active size for this face. */
nuclear@0 904 /* */
nuclear@0 905 /* charmap :: The current active charmap for this face. */
nuclear@0 906 /* */
nuclear@0 907 /* <Note> */
nuclear@0 908 /* Fields may be changed after a call to @FT_Attach_File or */
nuclear@0 909 /* @FT_Attach_Stream. */
nuclear@0 910 /* */
nuclear@0 911 typedef struct FT_FaceRec_
nuclear@0 912 {
nuclear@0 913 FT_Long num_faces;
nuclear@0 914 FT_Long face_index;
nuclear@0 915
nuclear@0 916 FT_Long face_flags;
nuclear@0 917 FT_Long style_flags;
nuclear@0 918
nuclear@0 919 FT_Long num_glyphs;
nuclear@0 920
nuclear@0 921 FT_String* family_name;
nuclear@0 922 FT_String* style_name;
nuclear@0 923
nuclear@0 924 FT_Int num_fixed_sizes;
nuclear@0 925 FT_Bitmap_Size* available_sizes;
nuclear@0 926
nuclear@0 927 FT_Int num_charmaps;
nuclear@0 928 FT_CharMap* charmaps;
nuclear@0 929
nuclear@0 930 FT_Generic generic;
nuclear@0 931
nuclear@0 932 /*# The following member variables (down to `underline_thickness') */
nuclear@0 933 /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
nuclear@0 934 /*# for bitmap fonts. */
nuclear@0 935 FT_BBox bbox;
nuclear@0 936
nuclear@0 937 FT_UShort units_per_EM;
nuclear@0 938 FT_Short ascender;
nuclear@0 939 FT_Short descender;
nuclear@0 940 FT_Short height;
nuclear@0 941
nuclear@0 942 FT_Short max_advance_width;
nuclear@0 943 FT_Short max_advance_height;
nuclear@0 944
nuclear@0 945 FT_Short underline_position;
nuclear@0 946 FT_Short underline_thickness;
nuclear@0 947
nuclear@0 948 FT_GlyphSlot glyph;
nuclear@0 949 FT_Size size;
nuclear@0 950 FT_CharMap charmap;
nuclear@0 951
nuclear@0 952 /*@private begin */
nuclear@0 953
nuclear@0 954 FT_Driver driver;
nuclear@0 955 FT_Memory memory;
nuclear@0 956 FT_Stream stream;
nuclear@0 957
nuclear@0 958 FT_ListRec sizes_list;
nuclear@0 959
nuclear@0 960 FT_Generic autohint;
nuclear@0 961 void* extensions;
nuclear@0 962
nuclear@0 963 FT_Face_Internal internal;
nuclear@0 964
nuclear@0 965 /*@private end */
nuclear@0 966
nuclear@0 967 } FT_FaceRec;
nuclear@0 968
nuclear@0 969
nuclear@0 970 /*************************************************************************/
nuclear@0 971 /* */
nuclear@0 972 /* <Enum> */
nuclear@0 973 /* FT_FACE_FLAG_XXX */
nuclear@0 974 /* */
nuclear@0 975 /* <Description> */
nuclear@0 976 /* A list of bit flags used in the `face_flags' field of the */
nuclear@0 977 /* @FT_FaceRec structure. They inform client applications of */
nuclear@0 978 /* properties of the corresponding face. */
nuclear@0 979 /* */
nuclear@0 980 /* <Values> */
nuclear@0 981 /* FT_FACE_FLAG_SCALABLE :: */
nuclear@0 982 /* Indicates that the face contains outline glyphs. This doesn't */
nuclear@0 983 /* prevent bitmap strikes, i.e., a face can have both this and */
nuclear@0 984 /* and @FT_FACE_FLAG_FIXED_SIZES set. */
nuclear@0 985 /* */
nuclear@0 986 /* FT_FACE_FLAG_FIXED_SIZES :: */
nuclear@0 987 /* Indicates that the face contains bitmap strikes. See also the */
nuclear@0 988 /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
nuclear@0 989 /* */
nuclear@0 990 /* FT_FACE_FLAG_FIXED_WIDTH :: */
nuclear@0 991 /* Indicates that the face contains fixed-width characters (like */
nuclear@0 992 /* Courier, Lucido, MonoType, etc.). */
nuclear@0 993 /* */
nuclear@0 994 /* FT_FACE_FLAG_SFNT :: */
nuclear@0 995 /* Indicates that the face uses the `sfnt' storage scheme. For */
nuclear@0 996 /* now, this means TrueType and OpenType. */
nuclear@0 997 /* */
nuclear@0 998 /* FT_FACE_FLAG_HORIZONTAL :: */
nuclear@0 999 /* Indicates that the face contains horizontal glyph metrics. This */
nuclear@0 1000 /* should be set for all common formats. */
nuclear@0 1001 /* */
nuclear@0 1002 /* FT_FACE_FLAG_VERTICAL :: */
nuclear@0 1003 /* Indicates that the face contains vertical glyph metrics. This */
nuclear@0 1004 /* is only available in some formats, not all of them. */
nuclear@0 1005 /* */
nuclear@0 1006 /* FT_FACE_FLAG_KERNING :: */
nuclear@0 1007 /* Indicates that the face contains kerning information. If set, */
nuclear@0 1008 /* the kerning distance can be retrieved through the function */
nuclear@0 1009 /* @FT_Get_Kerning. Otherwise the function always return the */
nuclear@0 1010 /* vector (0,0). Note that FreeType doesn't handle kerning data */
nuclear@0 1011 /* from the `GPOS' table (as present in some OpenType fonts). */
nuclear@0 1012 /* */
nuclear@0 1013 /* FT_FACE_FLAG_FAST_GLYPHS :: */
nuclear@0 1014 /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
nuclear@0 1015 /* */
nuclear@0 1016 /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
nuclear@0 1017 /* Indicates that the font contains multiple masters and is capable */
nuclear@0 1018 /* of interpolating between them. See the multiple-masters */
nuclear@0 1019 /* specific API for details. */
nuclear@0 1020 /* */
nuclear@0 1021 /* FT_FACE_FLAG_GLYPH_NAMES :: */
nuclear@0 1022 /* Indicates that the font contains glyph names that can be */
nuclear@0 1023 /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
nuclear@0 1024 /* fonts contain broken glyph name tables. Use the function */
nuclear@0 1025 /* @FT_Has_PS_Glyph_Names when needed. */
nuclear@0 1026 /* */
nuclear@0 1027 /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
nuclear@0 1028 /* Used internally by FreeType to indicate that a face's stream was */
nuclear@0 1029 /* provided by the client application and should not be destroyed */
nuclear@0 1030 /* when @FT_Done_Face is called. Don't read or test this flag. */
nuclear@0 1031 /* */
nuclear@0 1032 /* FT_FACE_FLAG_HINTER :: */
nuclear@0 1033 /* Set if the font driver has a hinting machine of its own. For */
nuclear@0 1034 /* example, with TrueType fonts, it makes sense to use data from */
nuclear@0 1035 /* the SFNT `gasp' table only if the native TrueType hinting engine */
nuclear@0 1036 /* (with the bytecode interpreter) is available and active. */
nuclear@0 1037 /* */
nuclear@0 1038 /* FT_FACE_FLAG_CID_KEYED :: */
nuclear@0 1039 /* Set if the font is CID-keyed. In that case, the font is not */
nuclear@0 1040 /* accessed by glyph indices but by CID values. For subsetted */
nuclear@0 1041 /* CID-keyed fonts this has the consequence that not all index */
nuclear@0 1042 /* values are a valid argument to FT_Load_Glyph. Only the CID */
nuclear@0 1043 /* values for which corresponding glyphs in the subsetted font */
nuclear@0 1044 /* exist make FT_Load_Glyph return successfully; in all other cases */
nuclear@0 1045 /* you get an `FT_Err_Invalid_Argument' error. */
nuclear@0 1046 /* */
nuclear@0 1047 /* Note that CID-keyed fonts which are in an SFNT wrapper don't */
nuclear@0 1048 /* have this flag set since the glyphs are accessed in the normal */
nuclear@0 1049 /* way (using contiguous indices); the `CID-ness' isn't visible to */
nuclear@0 1050 /* the application. */
nuclear@0 1051 /* */
nuclear@0 1052 /* FT_FACE_FLAG_TRICKY :: */
nuclear@0 1053 /* Set if the font is `tricky', this is, it always needs the */
nuclear@0 1054 /* font format's native hinting engine to get a reasonable result. */
nuclear@0 1055 /* A typical example is the Chinese font `mingli.ttf' which uses */
nuclear@0 1056 /* TrueType bytecode instructions to move and scale all of its */
nuclear@0 1057 /* subglyphs. */
nuclear@0 1058 /* */
nuclear@0 1059 /* It is not possible to autohint such fonts using */
nuclear@0 1060 /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
nuclear@0 1061 /* @FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING */
nuclear@0 1062 /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
nuclear@0 1063 /* probably never want this except for demonstration purposes. */
nuclear@0 1064 /* */
nuclear@0 1065 /* Currently, there are six TrueType fonts in the list of tricky */
nuclear@0 1066 /* fonts; they are hard-coded in file `ttobjs.c'. */
nuclear@0 1067 /* */
nuclear@0 1068 #define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
nuclear@0 1069 #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
nuclear@0 1070 #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
nuclear@0 1071 #define FT_FACE_FLAG_SFNT ( 1L << 3 )
nuclear@0 1072 #define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
nuclear@0 1073 #define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
nuclear@0 1074 #define FT_FACE_FLAG_KERNING ( 1L << 6 )
nuclear@0 1075 #define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
nuclear@0 1076 #define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
nuclear@0 1077 #define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
nuclear@0 1078 #define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
nuclear@0 1079 #define FT_FACE_FLAG_HINTER ( 1L << 11 )
nuclear@0 1080 #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
nuclear@0 1081 #define FT_FACE_FLAG_TRICKY ( 1L << 13 )
nuclear@0 1082
nuclear@0 1083
nuclear@0 1084 /*************************************************************************
nuclear@0 1085 *
nuclear@0 1086 * @macro:
nuclear@0 1087 * FT_HAS_HORIZONTAL( face )
nuclear@0 1088 *
nuclear@0 1089 * @description:
nuclear@0 1090 * A macro that returns true whenever a face object contains
nuclear@0 1091 * horizontal metrics (this is true for all font formats though).
nuclear@0 1092 *
nuclear@0 1093 * @also:
nuclear@0 1094 * @FT_HAS_VERTICAL can be used to check for vertical metrics.
nuclear@0 1095 *
nuclear@0 1096 */
nuclear@0 1097 #define FT_HAS_HORIZONTAL( face ) \
nuclear@0 1098 ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
nuclear@0 1099
nuclear@0 1100
nuclear@0 1101 /*************************************************************************
nuclear@0 1102 *
nuclear@0 1103 * @macro:
nuclear@0 1104 * FT_HAS_VERTICAL( face )
nuclear@0 1105 *
nuclear@0 1106 * @description:
nuclear@0 1107 * A macro that returns true whenever a face object contains vertical
nuclear@0 1108 * metrics.
nuclear@0 1109 *
nuclear@0 1110 */
nuclear@0 1111 #define FT_HAS_VERTICAL( face ) \
nuclear@0 1112 ( face->face_flags & FT_FACE_FLAG_VERTICAL )
nuclear@0 1113
nuclear@0 1114
nuclear@0 1115 /*************************************************************************
nuclear@0 1116 *
nuclear@0 1117 * @macro:
nuclear@0 1118 * FT_HAS_KERNING( face )
nuclear@0 1119 *
nuclear@0 1120 * @description:
nuclear@0 1121 * A macro that returns true whenever a face object contains kerning
nuclear@0 1122 * data that can be accessed with @FT_Get_Kerning.
nuclear@0 1123 *
nuclear@0 1124 */
nuclear@0 1125 #define FT_HAS_KERNING( face ) \
nuclear@0 1126 ( face->face_flags & FT_FACE_FLAG_KERNING )
nuclear@0 1127
nuclear@0 1128
nuclear@0 1129 /*************************************************************************
nuclear@0 1130 *
nuclear@0 1131 * @macro:
nuclear@0 1132 * FT_IS_SCALABLE( face )
nuclear@0 1133 *
nuclear@0 1134 * @description:
nuclear@0 1135 * A macro that returns true whenever a face object contains a scalable
nuclear@0 1136 * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
nuclear@0 1137 * and PFR font formats.
nuclear@0 1138 *
nuclear@0 1139 */
nuclear@0 1140 #define FT_IS_SCALABLE( face ) \
nuclear@0 1141 ( face->face_flags & FT_FACE_FLAG_SCALABLE )
nuclear@0 1142
nuclear@0 1143
nuclear@0 1144 /*************************************************************************
nuclear@0 1145 *
nuclear@0 1146 * @macro:
nuclear@0 1147 * FT_IS_SFNT( face )
nuclear@0 1148 *
nuclear@0 1149 * @description:
nuclear@0 1150 * A macro that returns true whenever a face object contains a font
nuclear@0 1151 * whose format is based on the SFNT storage scheme. This usually
nuclear@0 1152 * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
nuclear@0 1153 * bitmap fonts.
nuclear@0 1154 *
nuclear@0 1155 * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
nuclear@0 1156 * @FT_TRUETYPE_TABLES_H are available.
nuclear@0 1157 *
nuclear@0 1158 */
nuclear@0 1159 #define FT_IS_SFNT( face ) \
nuclear@0 1160 ( face->face_flags & FT_FACE_FLAG_SFNT )
nuclear@0 1161
nuclear@0 1162
nuclear@0 1163 /*************************************************************************
nuclear@0 1164 *
nuclear@0 1165 * @macro:
nuclear@0 1166 * FT_IS_FIXED_WIDTH( face )
nuclear@0 1167 *
nuclear@0 1168 * @description:
nuclear@0 1169 * A macro that returns true whenever a face object contains a font face
nuclear@0 1170 * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
nuclear@0 1171 * glyphs.
nuclear@0 1172 *
nuclear@0 1173 */
nuclear@0 1174 #define FT_IS_FIXED_WIDTH( face ) \
nuclear@0 1175 ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
nuclear@0 1176
nuclear@0 1177
nuclear@0 1178 /*************************************************************************
nuclear@0 1179 *
nuclear@0 1180 * @macro:
nuclear@0 1181 * FT_HAS_FIXED_SIZES( face )
nuclear@0 1182 *
nuclear@0 1183 * @description:
nuclear@0 1184 * A macro that returns true whenever a face object contains some
nuclear@0 1185 * embedded bitmaps. See the `available_sizes' field of the
nuclear@0 1186 * @FT_FaceRec structure.
nuclear@0 1187 *
nuclear@0 1188 */
nuclear@0 1189 #define FT_HAS_FIXED_SIZES( face ) \
nuclear@0 1190 ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
nuclear@0 1191
nuclear@0 1192
nuclear@0 1193 /*************************************************************************
nuclear@0 1194 *
nuclear@0 1195 * @macro:
nuclear@0 1196 * FT_HAS_FAST_GLYPHS( face )
nuclear@0 1197 *
nuclear@0 1198 * @description:
nuclear@0 1199 * Deprecated.
nuclear@0 1200 *
nuclear@0 1201 */
nuclear@0 1202 #define FT_HAS_FAST_GLYPHS( face ) 0
nuclear@0 1203
nuclear@0 1204
nuclear@0 1205 /*************************************************************************
nuclear@0 1206 *
nuclear@0 1207 * @macro:
nuclear@0 1208 * FT_HAS_GLYPH_NAMES( face )
nuclear@0 1209 *
nuclear@0 1210 * @description:
nuclear@0 1211 * A macro that returns true whenever a face object contains some glyph
nuclear@0 1212 * names that can be accessed through @FT_Get_Glyph_Name.
nuclear@0 1213 *
nuclear@0 1214 */
nuclear@0 1215 #define FT_HAS_GLYPH_NAMES( face ) \
nuclear@0 1216 ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
nuclear@0 1217
nuclear@0 1218
nuclear@0 1219 /*************************************************************************
nuclear@0 1220 *
nuclear@0 1221 * @macro:
nuclear@0 1222 * FT_HAS_MULTIPLE_MASTERS( face )
nuclear@0 1223 *
nuclear@0 1224 * @description:
nuclear@0 1225 * A macro that returns true whenever a face object contains some
nuclear@0 1226 * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
nuclear@0 1227 * are then available to choose the exact design you want.
nuclear@0 1228 *
nuclear@0 1229 */
nuclear@0 1230 #define FT_HAS_MULTIPLE_MASTERS( face ) \
nuclear@0 1231 ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
nuclear@0 1232
nuclear@0 1233
nuclear@0 1234 /*************************************************************************
nuclear@0 1235 *
nuclear@0 1236 * @macro:
nuclear@0 1237 * FT_IS_CID_KEYED( face )
nuclear@0 1238 *
nuclear@0 1239 * @description:
nuclear@0 1240 * A macro that returns true whenever a face object contains a CID-keyed
nuclear@0 1241 * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
nuclear@0 1242 * details.
nuclear@0 1243 *
nuclear@0 1244 * If this macro is true, all functions defined in @FT_CID_H are
nuclear@0 1245 * available.
nuclear@0 1246 *
nuclear@0 1247 */
nuclear@0 1248 #define FT_IS_CID_KEYED( face ) \
nuclear@0 1249 ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
nuclear@0 1250
nuclear@0 1251
nuclear@0 1252 /*************************************************************************
nuclear@0 1253 *
nuclear@0 1254 * @macro:
nuclear@0 1255 * FT_IS_TRICKY( face )
nuclear@0 1256 *
nuclear@0 1257 * @description:
nuclear@0 1258 * A macro that returns true whenever a face represents a `tricky' font.
nuclear@0 1259 * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
nuclear@0 1260 *
nuclear@0 1261 */
nuclear@0 1262 #define FT_IS_TRICKY( face ) \
nuclear@0 1263 ( face->face_flags & FT_FACE_FLAG_TRICKY )
nuclear@0 1264
nuclear@0 1265
nuclear@0 1266 /*************************************************************************/
nuclear@0 1267 /* */
nuclear@0 1268 /* <Const> */
nuclear@0 1269 /* FT_STYLE_FLAG_XXX */
nuclear@0 1270 /* */
nuclear@0 1271 /* <Description> */
nuclear@0 1272 /* A list of bit-flags used to indicate the style of a given face. */
nuclear@0 1273 /* These are used in the `style_flags' field of @FT_FaceRec. */
nuclear@0 1274 /* */
nuclear@0 1275 /* <Values> */
nuclear@0 1276 /* FT_STYLE_FLAG_ITALIC :: */
nuclear@0 1277 /* Indicates that a given face style is italic or oblique. */
nuclear@0 1278 /* */
nuclear@0 1279 /* FT_STYLE_FLAG_BOLD :: */
nuclear@0 1280 /* Indicates that a given face is bold. */
nuclear@0 1281 /* */
nuclear@0 1282 /* <Note> */
nuclear@0 1283 /* The style information as provided by FreeType is very basic. More */
nuclear@0 1284 /* details are beyond the scope and should be done on a higher level */
nuclear@0 1285 /* (for example, by analyzing various fields of the `OS/2' table in */
nuclear@0 1286 /* SFNT based fonts). */
nuclear@0 1287 /* */
nuclear@0 1288 #define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
nuclear@0 1289 #define FT_STYLE_FLAG_BOLD ( 1 << 1 )
nuclear@0 1290
nuclear@0 1291
nuclear@0 1292 /*************************************************************************/
nuclear@0 1293 /* */
nuclear@0 1294 /* <Type> */
nuclear@0 1295 /* FT_Size_Internal */
nuclear@0 1296 /* */
nuclear@0 1297 /* <Description> */
nuclear@0 1298 /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
nuclear@0 1299 /* model private data of a given @FT_Size object. */
nuclear@0 1300 /* */
nuclear@0 1301 typedef struct FT_Size_InternalRec_* FT_Size_Internal;
nuclear@0 1302
nuclear@0 1303
nuclear@0 1304 /*************************************************************************/
nuclear@0 1305 /* */
nuclear@0 1306 /* <Struct> */
nuclear@0 1307 /* FT_Size_Metrics */
nuclear@0 1308 /* */
nuclear@0 1309 /* <Description> */
nuclear@0 1310 /* The size metrics structure gives the metrics of a size object. */
nuclear@0 1311 /* */
nuclear@0 1312 /* <Fields> */
nuclear@0 1313 /* x_ppem :: The width of the scaled EM square in pixels, hence */
nuclear@0 1314 /* the term `ppem' (pixels per EM). It is also */
nuclear@0 1315 /* referred to as `nominal width'. */
nuclear@0 1316 /* */
nuclear@0 1317 /* y_ppem :: The height of the scaled EM square in pixels, */
nuclear@0 1318 /* hence the term `ppem' (pixels per EM). It is also */
nuclear@0 1319 /* referred to as `nominal height'. */
nuclear@0 1320 /* */
nuclear@0 1321 /* x_scale :: A 16.16 fractional scaling value used to convert */
nuclear@0 1322 /* horizontal metrics from font units to 26.6 */
nuclear@0 1323 /* fractional pixels. Only relevant for scalable */
nuclear@0 1324 /* font formats. */
nuclear@0 1325 /* */
nuclear@0 1326 /* y_scale :: A 16.16 fractional scaling value used to convert */
nuclear@0 1327 /* vertical metrics from font units to 26.6 */
nuclear@0 1328 /* fractional pixels. Only relevant for scalable */
nuclear@0 1329 /* font formats. */
nuclear@0 1330 /* */
nuclear@0 1331 /* ascender :: The ascender in 26.6 fractional pixels. See */
nuclear@0 1332 /* @FT_FaceRec for the details. */
nuclear@0 1333 /* */
nuclear@0 1334 /* descender :: The descender in 26.6 fractional pixels. See */
nuclear@0 1335 /* @FT_FaceRec for the details. */
nuclear@0 1336 /* */
nuclear@0 1337 /* height :: The height in 26.6 fractional pixels. See */
nuclear@0 1338 /* @FT_FaceRec for the details. */
nuclear@0 1339 /* */
nuclear@0 1340 /* max_advance :: The maximal advance width in 26.6 fractional */
nuclear@0 1341 /* pixels. See @FT_FaceRec for the details. */
nuclear@0 1342 /* */
nuclear@0 1343 /* <Note> */
nuclear@0 1344 /* The scaling values, if relevant, are determined first during a */
nuclear@0 1345 /* size changing operation. The remaining fields are then set by the */
nuclear@0 1346 /* driver. For scalable formats, they are usually set to scaled */
nuclear@0 1347 /* values of the corresponding fields in @FT_FaceRec. */
nuclear@0 1348 /* */
nuclear@0 1349 /* Note that due to glyph hinting, these values might not be exact */
nuclear@0 1350 /* for certain fonts. Thus they must be treated as unreliable */
nuclear@0 1351 /* with an error margin of at least one pixel! */
nuclear@0 1352 /* */
nuclear@0 1353 /* Indeed, the only way to get the exact metrics is to render _all_ */
nuclear@0 1354 /* glyphs. As this would be a definite performance hit, it is up to */
nuclear@0 1355 /* client applications to perform such computations. */
nuclear@0 1356 /* */
nuclear@0 1357 /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
nuclear@0 1358 /* */
nuclear@0 1359 typedef struct FT_Size_Metrics_
nuclear@0 1360 {
nuclear@0 1361 FT_UShort x_ppem; /* horizontal pixels per EM */
nuclear@0 1362 FT_UShort y_ppem; /* vertical pixels per EM */
nuclear@0 1363
nuclear@0 1364 FT_Fixed x_scale; /* scaling values used to convert font */
nuclear@0 1365 FT_Fixed y_scale; /* units to 26.6 fractional pixels */
nuclear@0 1366
nuclear@0 1367 FT_Pos ascender; /* ascender in 26.6 frac. pixels */
nuclear@0 1368 FT_Pos descender; /* descender in 26.6 frac. pixels */
nuclear@0 1369 FT_Pos height; /* text height in 26.6 frac. pixels */
nuclear@0 1370 FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
nuclear@0 1371
nuclear@0 1372 } FT_Size_Metrics;
nuclear@0 1373
nuclear@0 1374
nuclear@0 1375 /*************************************************************************/
nuclear@0 1376 /* */
nuclear@0 1377 /* <Struct> */
nuclear@0 1378 /* FT_SizeRec */
nuclear@0 1379 /* */
nuclear@0 1380 /* <Description> */
nuclear@0 1381 /* FreeType root size class structure. A size object models a face */
nuclear@0 1382 /* object at a given size. */
nuclear@0 1383 /* */
nuclear@0 1384 /* <Fields> */
nuclear@0 1385 /* face :: Handle to the parent face object. */
nuclear@0 1386 /* */
nuclear@0 1387 /* generic :: A typeless pointer, which is unused by the FreeType */
nuclear@0 1388 /* library or any of its drivers. It can be used by */
nuclear@0 1389 /* client applications to link their own data to each size */
nuclear@0 1390 /* object. */
nuclear@0 1391 /* */
nuclear@0 1392 /* metrics :: Metrics for this size object. This field is read-only. */
nuclear@0 1393 /* */
nuclear@0 1394 typedef struct FT_SizeRec_
nuclear@0 1395 {
nuclear@0 1396 FT_Face face; /* parent face object */
nuclear@0 1397 FT_Generic generic; /* generic pointer for client uses */
nuclear@0 1398 FT_Size_Metrics metrics; /* size metrics */
nuclear@0 1399 FT_Size_Internal internal;
nuclear@0 1400
nuclear@0 1401 } FT_SizeRec;
nuclear@0 1402
nuclear@0 1403
nuclear@0 1404 /*************************************************************************/
nuclear@0 1405 /* */
nuclear@0 1406 /* <Struct> */
nuclear@0 1407 /* FT_SubGlyph */
nuclear@0 1408 /* */
nuclear@0 1409 /* <Description> */
nuclear@0 1410 /* The subglyph structure is an internal object used to describe */
nuclear@0 1411 /* subglyphs (for example, in the case of composites). */
nuclear@0 1412 /* */
nuclear@0 1413 /* <Note> */
nuclear@0 1414 /* The subglyph implementation is not part of the high-level API, */
nuclear@0 1415 /* hence the forward structure declaration. */
nuclear@0 1416 /* */
nuclear@0 1417 /* You can however retrieve subglyph information with */
nuclear@0 1418 /* @FT_Get_SubGlyph_Info. */
nuclear@0 1419 /* */
nuclear@0 1420 typedef struct FT_SubGlyphRec_* FT_SubGlyph;
nuclear@0 1421
nuclear@0 1422
nuclear@0 1423 /*************************************************************************/
nuclear@0 1424 /* */
nuclear@0 1425 /* <Type> */
nuclear@0 1426 /* FT_Slot_Internal */
nuclear@0 1427 /* */
nuclear@0 1428 /* <Description> */
nuclear@0 1429 /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
nuclear@0 1430 /* model private data of a given @FT_GlyphSlot object. */
nuclear@0 1431 /* */
nuclear@0 1432 typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
nuclear@0 1433
nuclear@0 1434
nuclear@0 1435 /*************************************************************************/
nuclear@0 1436 /* */
nuclear@0 1437 /* <Struct> */
nuclear@0 1438 /* FT_GlyphSlotRec */
nuclear@0 1439 /* */
nuclear@0 1440 /* <Description> */
nuclear@0 1441 /* FreeType root glyph slot class structure. A glyph slot is a */
nuclear@0 1442 /* container where individual glyphs can be loaded, be they in */
nuclear@0 1443 /* outline or bitmap format. */
nuclear@0 1444 /* */
nuclear@0 1445 /* <Fields> */
nuclear@0 1446 /* library :: A handle to the FreeType library instance */
nuclear@0 1447 /* this slot belongs to. */
nuclear@0 1448 /* */
nuclear@0 1449 /* face :: A handle to the parent face object. */
nuclear@0 1450 /* */
nuclear@0 1451 /* next :: In some cases (like some font tools), several */
nuclear@0 1452 /* glyph slots per face object can be a good */
nuclear@0 1453 /* thing. As this is rare, the glyph slots are */
nuclear@0 1454 /* listed through a direct, single-linked list */
nuclear@0 1455 /* using its `next' field. */
nuclear@0 1456 /* */
nuclear@0 1457 /* generic :: A typeless pointer which is unused by the */
nuclear@0 1458 /* FreeType library or any of its drivers. It */
nuclear@0 1459 /* can be used by client applications to link */
nuclear@0 1460 /* their own data to each glyph slot object. */
nuclear@0 1461 /* */
nuclear@0 1462 /* metrics :: The metrics of the last loaded glyph in the */
nuclear@0 1463 /* slot. The returned values depend on the last */
nuclear@0 1464 /* load flags (see the @FT_Load_Glyph API */
nuclear@0 1465 /* function) and can be expressed either in 26.6 */
nuclear@0 1466 /* fractional pixels or font units. */
nuclear@0 1467 /* */
nuclear@0 1468 /* Note that even when the glyph image is */
nuclear@0 1469 /* transformed, the metrics are not. */
nuclear@0 1470 /* */
nuclear@0 1471 /* linearHoriAdvance :: The advance width of the unhinted glyph. */
nuclear@0 1472 /* Its value is expressed in 16.16 fractional */
nuclear@0 1473 /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
nuclear@0 1474 /* when loading the glyph. This field can be */
nuclear@0 1475 /* important to perform correct WYSIWYG layout. */
nuclear@0 1476 /* Only relevant for outline glyphs. */
nuclear@0 1477 /* */
nuclear@0 1478 /* linearVertAdvance :: The advance height of the unhinted glyph. */
nuclear@0 1479 /* Its value is expressed in 16.16 fractional */
nuclear@0 1480 /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
nuclear@0 1481 /* when loading the glyph. This field can be */
nuclear@0 1482 /* important to perform correct WYSIWYG layout. */
nuclear@0 1483 /* Only relevant for outline glyphs. */
nuclear@0 1484 /* */
nuclear@0 1485 /* advance :: This shorthand is, depending on */
nuclear@0 1486 /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
nuclear@0 1487 /* advance width for the glyph (in 26.6 */
nuclear@0 1488 /* fractional pixel format). As specified with */
nuclear@0 1489 /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
nuclear@0 1490 /* `horiAdvance' or the `vertAdvance' value of */
nuclear@0 1491 /* `metrics' field. */
nuclear@0 1492 /* */
nuclear@0 1493 /* format :: This field indicates the format of the image */
nuclear@0 1494 /* contained in the glyph slot. Typically */
nuclear@0 1495 /* @FT_GLYPH_FORMAT_BITMAP, */
nuclear@0 1496 /* @FT_GLYPH_FORMAT_OUTLINE, or */
nuclear@0 1497 /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
nuclear@0 1498 /* possible. */
nuclear@0 1499 /* */
nuclear@0 1500 /* bitmap :: This field is used as a bitmap descriptor */
nuclear@0 1501 /* when the slot format is */
nuclear@0 1502 /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
nuclear@0 1503 /* address and content of the bitmap buffer can */
nuclear@0 1504 /* change between calls of @FT_Load_Glyph and a */
nuclear@0 1505 /* few other functions. */
nuclear@0 1506 /* */
nuclear@0 1507 /* bitmap_left :: This is the bitmap's left bearing expressed */
nuclear@0 1508 /* in integer pixels. Of course, this is only */
nuclear@0 1509 /* valid if the format is */
nuclear@0 1510 /* @FT_GLYPH_FORMAT_BITMAP. */
nuclear@0 1511 /* */
nuclear@0 1512 /* bitmap_top :: This is the bitmap's top bearing expressed in */
nuclear@0 1513 /* integer pixels. Remember that this is the */
nuclear@0 1514 /* distance from the baseline to the top-most */
nuclear@0 1515 /* glyph scanline, upwards y~coordinates being */
nuclear@0 1516 /* *positive*. */
nuclear@0 1517 /* */
nuclear@0 1518 /* outline :: The outline descriptor for the current glyph */
nuclear@0 1519 /* image if its format is */
nuclear@0 1520 /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
nuclear@0 1521 /* loaded, `outline' can be transformed, */
nuclear@0 1522 /* distorted, embolded, etc. However, it must */
nuclear@0 1523 /* not be freed. */
nuclear@0 1524 /* */
nuclear@0 1525 /* num_subglyphs :: The number of subglyphs in a composite glyph. */
nuclear@0 1526 /* This field is only valid for the composite */
nuclear@0 1527 /* glyph format that should normally only be */
nuclear@0 1528 /* loaded with the @FT_LOAD_NO_RECURSE flag. */
nuclear@0 1529 /* For now this is internal to FreeType. */
nuclear@0 1530 /* */
nuclear@0 1531 /* subglyphs :: An array of subglyph descriptors for */
nuclear@0 1532 /* composite glyphs. There are `num_subglyphs' */
nuclear@0 1533 /* elements in there. Currently internal to */
nuclear@0 1534 /* FreeType. */
nuclear@0 1535 /* */
nuclear@0 1536 /* control_data :: Certain font drivers can also return the */
nuclear@0 1537 /* control data for a given glyph image (e.g. */
nuclear@0 1538 /* TrueType bytecode, Type~1 charstrings, etc.). */
nuclear@0 1539 /* This field is a pointer to such data. */
nuclear@0 1540 /* */
nuclear@0 1541 /* control_len :: This is the length in bytes of the control */
nuclear@0 1542 /* data. */
nuclear@0 1543 /* */
nuclear@0 1544 /* other :: Really wicked formats can use this pointer to */
nuclear@0 1545 /* present their own glyph image to client */
nuclear@0 1546 /* applications. Note that the application */
nuclear@0 1547 /* needs to know about the image format. */
nuclear@0 1548 /* */
nuclear@0 1549 /* lsb_delta :: The difference between hinted and unhinted */
nuclear@0 1550 /* left side bearing while autohinting is */
nuclear@0 1551 /* active. Zero otherwise. */
nuclear@0 1552 /* */
nuclear@0 1553 /* rsb_delta :: The difference between hinted and unhinted */
nuclear@0 1554 /* right side bearing while autohinting is */
nuclear@0 1555 /* active. Zero otherwise. */
nuclear@0 1556 /* */
nuclear@0 1557 /* <Note> */
nuclear@0 1558 /* If @FT_Load_Glyph is called with default flags (see */
nuclear@0 1559 /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
nuclear@0 1560 /* its native format (e.g., an outline glyph for TrueType and Type~1 */
nuclear@0 1561 /* formats). */
nuclear@0 1562 /* */
nuclear@0 1563 /* This image can later be converted into a bitmap by calling */
nuclear@0 1564 /* @FT_Render_Glyph. This function finds the current renderer for */
nuclear@0 1565 /* the native image's format, then invokes it. */
nuclear@0 1566 /* */
nuclear@0 1567 /* The renderer is in charge of transforming the native image through */
nuclear@0 1568 /* the slot's face transformation fields, then converting it into a */
nuclear@0 1569 /* bitmap that is returned in `slot->bitmap'. */
nuclear@0 1570 /* */
nuclear@0 1571 /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
nuclear@0 1572 /* to specify the position of the bitmap relative to the current pen */
nuclear@0 1573 /* position (e.g., coordinates (0,0) on the baseline). Of course, */
nuclear@0 1574 /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
nuclear@0 1575 /* */
nuclear@0 1576 /* <Note> */
nuclear@0 1577 /* Here a small pseudo code fragment which shows how to use */
nuclear@0 1578 /* `lsb_delta' and `rsb_delta': */
nuclear@0 1579 /* */
nuclear@0 1580 /* { */
nuclear@0 1581 /* FT_Pos origin_x = 0; */
nuclear@0 1582 /* FT_Pos prev_rsb_delta = 0; */
nuclear@0 1583 /* */
nuclear@0 1584 /* */
nuclear@0 1585 /* for all glyphs do */
nuclear@0 1586 /* <compute kern between current and previous glyph and add it to */
nuclear@0 1587 /* `origin_x'> */
nuclear@0 1588 /* */
nuclear@0 1589 /* <load glyph with `FT_Load_Glyph'> */
nuclear@0 1590 /* */
nuclear@0 1591 /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
nuclear@0 1592 /* origin_x -= 64; */
nuclear@0 1593 /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
nuclear@0 1594 /* origin_x += 64; */
nuclear@0 1595 /* */
nuclear@0 1596 /* prev_rsb_delta = face->glyph->rsb_delta; */
nuclear@0 1597 /* */
nuclear@0 1598 /* <save glyph image, or render glyph, or ...> */
nuclear@0 1599 /* */
nuclear@0 1600 /* origin_x += face->glyph->advance.x; */
nuclear@0 1601 /* endfor */
nuclear@0 1602 /* } */
nuclear@0 1603 /* */
nuclear@0 1604 typedef struct FT_GlyphSlotRec_
nuclear@0 1605 {
nuclear@0 1606 FT_Library library;
nuclear@0 1607 FT_Face face;
nuclear@0 1608 FT_GlyphSlot next;
nuclear@0 1609 FT_UInt reserved; /* retained for binary compatibility */
nuclear@0 1610 FT_Generic generic;
nuclear@0 1611
nuclear@0 1612 FT_Glyph_Metrics metrics;
nuclear@0 1613 FT_Fixed linearHoriAdvance;
nuclear@0 1614 FT_Fixed linearVertAdvance;
nuclear@0 1615 FT_Vector advance;
nuclear@0 1616
nuclear@0 1617 FT_Glyph_Format format;
nuclear@0 1618
nuclear@0 1619 FT_Bitmap bitmap;
nuclear@0 1620 FT_Int bitmap_left;
nuclear@0 1621 FT_Int bitmap_top;
nuclear@0 1622
nuclear@0 1623 FT_Outline outline;
nuclear@0 1624
nuclear@0 1625 FT_UInt num_subglyphs;
nuclear@0 1626 FT_SubGlyph subglyphs;
nuclear@0 1627
nuclear@0 1628 void* control_data;
nuclear@0 1629 long control_len;
nuclear@0 1630
nuclear@0 1631 FT_Pos lsb_delta;
nuclear@0 1632 FT_Pos rsb_delta;
nuclear@0 1633
nuclear@0 1634 void* other;
nuclear@0 1635
nuclear@0 1636 FT_Slot_Internal internal;
nuclear@0 1637
nuclear@0 1638 } FT_GlyphSlotRec;
nuclear@0 1639
nuclear@0 1640
nuclear@0 1641 /*************************************************************************/
nuclear@0 1642 /*************************************************************************/
nuclear@0 1643 /* */
nuclear@0 1644 /* F U N C T I O N S */
nuclear@0 1645 /* */
nuclear@0 1646 /*************************************************************************/
nuclear@0 1647 /*************************************************************************/
nuclear@0 1648
nuclear@0 1649
nuclear@0 1650 /*************************************************************************/
nuclear@0 1651 /* */
nuclear@0 1652 /* <Function> */
nuclear@0 1653 /* FT_Init_FreeType */
nuclear@0 1654 /* */
nuclear@0 1655 /* <Description> */
nuclear@0 1656 /* Initialize a new FreeType library object. The set of modules */
nuclear@0 1657 /* that are registered by this function is determined at build time. */
nuclear@0 1658 /* */
nuclear@0 1659 /* <Output> */
nuclear@0 1660 /* alibrary :: A handle to a new library object. */
nuclear@0 1661 /* */
nuclear@0 1662 /* <Return> */
nuclear@0 1663 /* FreeType error code. 0~means success. */
nuclear@0 1664 /* */
nuclear@0 1665 /* <Note> */
nuclear@0 1666 /* In case you want to provide your own memory allocating routines, */
nuclear@0 1667 /* use @FT_New_Library instead, followed by a call to */
nuclear@0 1668 /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
nuclear@0 1669 /* */
nuclear@0 1670 FT_EXPORT( FT_Error )
nuclear@0 1671 FT_Init_FreeType( FT_Library *alibrary );
nuclear@0 1672
nuclear@0 1673
nuclear@0 1674 /*************************************************************************/
nuclear@0 1675 /* */
nuclear@0 1676 /* <Function> */
nuclear@0 1677 /* FT_Done_FreeType */
nuclear@0 1678 /* */
nuclear@0 1679 /* <Description> */
nuclear@0 1680 /* Destroy a given FreeType library object and all of its children, */
nuclear@0 1681 /* including resources, drivers, faces, sizes, etc. */
nuclear@0 1682 /* */
nuclear@0 1683 /* <Input> */
nuclear@0 1684 /* library :: A handle to the target library object. */
nuclear@0 1685 /* */
nuclear@0 1686 /* <Return> */
nuclear@0 1687 /* FreeType error code. 0~means success. */
nuclear@0 1688 /* */
nuclear@0 1689 FT_EXPORT( FT_Error )
nuclear@0 1690 FT_Done_FreeType( FT_Library library );
nuclear@0 1691
nuclear@0 1692
nuclear@0 1693 /*************************************************************************/
nuclear@0 1694 /* */
nuclear@0 1695 /* <Enum> */
nuclear@0 1696 /* FT_OPEN_XXX */
nuclear@0 1697 /* */
nuclear@0 1698 /* <Description> */
nuclear@0 1699 /* A list of bit-field constants used within the `flags' field of the */
nuclear@0 1700 /* @FT_Open_Args structure. */
nuclear@0 1701 /* */
nuclear@0 1702 /* <Values> */
nuclear@0 1703 /* FT_OPEN_MEMORY :: This is a memory-based stream. */
nuclear@0 1704 /* */
nuclear@0 1705 /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
nuclear@0 1706 /* */
nuclear@0 1707 /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
nuclear@0 1708 /* name. */
nuclear@0 1709 /* */
nuclear@0 1710 /* FT_OPEN_DRIVER :: Use the `driver' field. */
nuclear@0 1711 /* */
nuclear@0 1712 /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
nuclear@0 1713 /* */
nuclear@0 1714 /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
nuclear@0 1715 /* */
nuclear@0 1716 /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
nuclear@0 1717 /* */
nuclear@0 1718 /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
nuclear@0 1719 /* */
nuclear@0 1720 /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
nuclear@0 1721 /* */
nuclear@0 1722 /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
nuclear@0 1723 /* */
nuclear@0 1724 /* <Note> */
nuclear@0 1725 /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
nuclear@0 1726 /* flags are mutually exclusive. */
nuclear@0 1727 /* */
nuclear@0 1728 #define FT_OPEN_MEMORY 0x1
nuclear@0 1729 #define FT_OPEN_STREAM 0x2
nuclear@0 1730 #define FT_OPEN_PATHNAME 0x4
nuclear@0 1731 #define FT_OPEN_DRIVER 0x8
nuclear@0 1732 #define FT_OPEN_PARAMS 0x10
nuclear@0 1733
nuclear@0 1734 #define ft_open_memory FT_OPEN_MEMORY /* deprecated */
nuclear@0 1735 #define ft_open_stream FT_OPEN_STREAM /* deprecated */
nuclear@0 1736 #define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */
nuclear@0 1737 #define ft_open_driver FT_OPEN_DRIVER /* deprecated */
nuclear@0 1738 #define ft_open_params FT_OPEN_PARAMS /* deprecated */
nuclear@0 1739
nuclear@0 1740
nuclear@0 1741 /*************************************************************************/
nuclear@0 1742 /* */
nuclear@0 1743 /* <Struct> */
nuclear@0 1744 /* FT_Parameter */
nuclear@0 1745 /* */
nuclear@0 1746 /* <Description> */
nuclear@0 1747 /* A simple structure used to pass more or less generic parameters to */
nuclear@0 1748 /* @FT_Open_Face. */
nuclear@0 1749 /* */
nuclear@0 1750 /* <Fields> */
nuclear@0 1751 /* tag :: A four-byte identification tag. */
nuclear@0 1752 /* */
nuclear@0 1753 /* data :: A pointer to the parameter data. */
nuclear@0 1754 /* */
nuclear@0 1755 /* <Note> */
nuclear@0 1756 /* The ID and function of parameters are driver-specific. See the */
nuclear@0 1757 /* various FT_PARAM_TAG_XXX flags for more information. */
nuclear@0 1758 /* */
nuclear@0 1759 typedef struct FT_Parameter_
nuclear@0 1760 {
nuclear@0 1761 FT_ULong tag;
nuclear@0 1762 FT_Pointer data;
nuclear@0 1763
nuclear@0 1764 } FT_Parameter;
nuclear@0 1765
nuclear@0 1766
nuclear@0 1767 /*************************************************************************/
nuclear@0 1768 /* */
nuclear@0 1769 /* <Struct> */
nuclear@0 1770 /* FT_Open_Args */
nuclear@0 1771 /* */
nuclear@0 1772 /* <Description> */
nuclear@0 1773 /* A structure used to indicate how to open a new font file or */
nuclear@0 1774 /* stream. A pointer to such a structure can be used as a parameter */
nuclear@0 1775 /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
nuclear@0 1776 /* */
nuclear@0 1777 /* <Fields> */
nuclear@0 1778 /* flags :: A set of bit flags indicating how to use the */
nuclear@0 1779 /* structure. */
nuclear@0 1780 /* */
nuclear@0 1781 /* memory_base :: The first byte of the file in memory. */
nuclear@0 1782 /* */
nuclear@0 1783 /* memory_size :: The size in bytes of the file in memory. */
nuclear@0 1784 /* */
nuclear@0 1785 /* pathname :: A pointer to an 8-bit file pathname. */
nuclear@0 1786 /* */
nuclear@0 1787 /* stream :: A handle to a source stream object. */
nuclear@0 1788 /* */
nuclear@0 1789 /* driver :: This field is exclusively used by @FT_Open_Face; */
nuclear@0 1790 /* it simply specifies the font driver to use to open */
nuclear@0 1791 /* the face. If set to~0, FreeType tries to load the */
nuclear@0 1792 /* face with each one of the drivers in its list. */
nuclear@0 1793 /* */
nuclear@0 1794 /* num_params :: The number of extra parameters. */
nuclear@0 1795 /* */
nuclear@0 1796 /* params :: Extra parameters passed to the font driver when */
nuclear@0 1797 /* opening a new face. */
nuclear@0 1798 /* */
nuclear@0 1799 /* <Note> */
nuclear@0 1800 /* The stream type is determined by the contents of `flags' which */
nuclear@0 1801 /* are tested in the following order by @FT_Open_Face: */
nuclear@0 1802 /* */
nuclear@0 1803 /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
nuclear@0 1804 /* memory file of `memory_size' bytes, located at `memory_address'. */
nuclear@0 1805 /* The data are are not copied, and the client is responsible for */
nuclear@0 1806 /* releasing and destroying them _after_ the corresponding call to */
nuclear@0 1807 /* @FT_Done_Face. */
nuclear@0 1808 /* */
nuclear@0 1809 /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
nuclear@0 1810 /* custom input stream `stream' is used. */
nuclear@0 1811 /* */
nuclear@0 1812 /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
nuclear@0 1813 /* is a normal file and use `pathname' to open it. */
nuclear@0 1814 /* */
nuclear@0 1815 /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
nuclear@0 1816 /* open the file with the driver whose handler is in `driver'. */
nuclear@0 1817 /* */
nuclear@0 1818 /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
nuclear@0 1819 /* `num_params' and `params' is used. They are ignored otherwise. */
nuclear@0 1820 /* */
nuclear@0 1821 /* Ideally, both the `pathname' and `params' fields should be tagged */
nuclear@0 1822 /* as `const'; this is missing for API backwards compatibility. In */
nuclear@0 1823 /* other words, applications should treat them as read-only. */
nuclear@0 1824 /* */
nuclear@0 1825 typedef struct FT_Open_Args_
nuclear@0 1826 {
nuclear@0 1827 FT_UInt flags;
nuclear@0 1828 const FT_Byte* memory_base;
nuclear@0 1829 FT_Long memory_size;
nuclear@0 1830 FT_String* pathname;
nuclear@0 1831 FT_Stream stream;
nuclear@0 1832 FT_Module driver;
nuclear@0 1833 FT_Int num_params;
nuclear@0 1834 FT_Parameter* params;
nuclear@0 1835
nuclear@0 1836 } FT_Open_Args;
nuclear@0 1837
nuclear@0 1838
nuclear@0 1839 /*************************************************************************/
nuclear@0 1840 /* */
nuclear@0 1841 /* <Function> */
nuclear@0 1842 /* FT_New_Face */
nuclear@0 1843 /* */
nuclear@0 1844 /* <Description> */
nuclear@0 1845 /* This function calls @FT_Open_Face to open a font by its pathname. */
nuclear@0 1846 /* */
nuclear@0 1847 /* <InOut> */
nuclear@0 1848 /* library :: A handle to the library resource. */
nuclear@0 1849 /* */
nuclear@0 1850 /* <Input> */
nuclear@0 1851 /* pathname :: A path to the font file. */
nuclear@0 1852 /* */
nuclear@0 1853 /* face_index :: The index of the face within the font. The first */
nuclear@0 1854 /* face has index~0. */
nuclear@0 1855 /* */
nuclear@0 1856 /* <Output> */
nuclear@0 1857 /* aface :: A handle to a new face object. If `face_index' is */
nuclear@0 1858 /* greater than or equal to zero, it must be non-NULL. */
nuclear@0 1859 /* See @FT_Open_Face for more details. */
nuclear@0 1860 /* */
nuclear@0 1861 /* <Return> */
nuclear@0 1862 /* FreeType error code. 0~means success. */
nuclear@0 1863 /* */
nuclear@0 1864 FT_EXPORT( FT_Error )
nuclear@0 1865 FT_New_Face( FT_Library library,
nuclear@0 1866 const char* filepathname,
nuclear@0 1867 FT_Long face_index,
nuclear@0 1868 FT_Face *aface );
nuclear@0 1869
nuclear@0 1870
nuclear@0 1871 /*************************************************************************/
nuclear@0 1872 /* */
nuclear@0 1873 /* <Function> */
nuclear@0 1874 /* FT_New_Memory_Face */
nuclear@0 1875 /* */
nuclear@0 1876 /* <Description> */
nuclear@0 1877 /* This function calls @FT_Open_Face to open a font which has been */
nuclear@0 1878 /* loaded into memory. */
nuclear@0 1879 /* */
nuclear@0 1880 /* <InOut> */
nuclear@0 1881 /* library :: A handle to the library resource. */
nuclear@0 1882 /* */
nuclear@0 1883 /* <Input> */
nuclear@0 1884 /* file_base :: A pointer to the beginning of the font data. */
nuclear@0 1885 /* */
nuclear@0 1886 /* file_size :: The size of the memory chunk used by the font data. */
nuclear@0 1887 /* */
nuclear@0 1888 /* face_index :: The index of the face within the font. The first */
nuclear@0 1889 /* face has index~0. */
nuclear@0 1890 /* */
nuclear@0 1891 /* <Output> */
nuclear@0 1892 /* aface :: A handle to a new face object. If `face_index' is */
nuclear@0 1893 /* greater than or equal to zero, it must be non-NULL. */
nuclear@0 1894 /* See @FT_Open_Face for more details. */
nuclear@0 1895 /* */
nuclear@0 1896 /* <Return> */
nuclear@0 1897 /* FreeType error code. 0~means success. */
nuclear@0 1898 /* */
nuclear@0 1899 /* <Note> */
nuclear@0 1900 /* You must not deallocate the memory before calling @FT_Done_Face. */
nuclear@0 1901 /* */
nuclear@0 1902 FT_EXPORT( FT_Error )
nuclear@0 1903 FT_New_Memory_Face( FT_Library library,
nuclear@0 1904 const FT_Byte* file_base,
nuclear@0 1905 FT_Long file_size,
nuclear@0 1906 FT_Long face_index,
nuclear@0 1907 FT_Face *aface );
nuclear@0 1908
nuclear@0 1909
nuclear@0 1910 /*************************************************************************/
nuclear@0 1911 /* */
nuclear@0 1912 /* <Function> */
nuclear@0 1913 /* FT_Open_Face */
nuclear@0 1914 /* */
nuclear@0 1915 /* <Description> */
nuclear@0 1916 /* Create a face object from a given resource described by */
nuclear@0 1917 /* @FT_Open_Args. */
nuclear@0 1918 /* */
nuclear@0 1919 /* <InOut> */
nuclear@0 1920 /* library :: A handle to the library resource. */
nuclear@0 1921 /* */
nuclear@0 1922 /* <Input> */
nuclear@0 1923 /* args :: A pointer to an `FT_Open_Args' structure which must */
nuclear@0 1924 /* be filled by the caller. */
nuclear@0 1925 /* */
nuclear@0 1926 /* face_index :: The index of the face within the font. The first */
nuclear@0 1927 /* face has index~0. */
nuclear@0 1928 /* */
nuclear@0 1929 /* <Output> */
nuclear@0 1930 /* aface :: A handle to a new face object. If `face_index' is */
nuclear@0 1931 /* greater than or equal to zero, it must be non-NULL. */
nuclear@0 1932 /* See note below. */
nuclear@0 1933 /* */
nuclear@0 1934 /* <Return> */
nuclear@0 1935 /* FreeType error code. 0~means success. */
nuclear@0 1936 /* */
nuclear@0 1937 /* <Note> */
nuclear@0 1938 /* Unlike FreeType 1.x, this function automatically creates a glyph */
nuclear@0 1939 /* slot for the face object which can be accessed directly through */
nuclear@0 1940 /* `face->glyph'. */
nuclear@0 1941 /* */
nuclear@0 1942 /* FT_Open_Face can be used to quickly check whether the font */
nuclear@0 1943 /* format of a given font resource is supported by FreeType. If the */
nuclear@0 1944 /* `face_index' field is negative, the function's return value is~0 */
nuclear@0 1945 /* if the font format is recognized, or non-zero otherwise; */
nuclear@0 1946 /* the function returns a more or less empty face handle in `*aface' */
nuclear@0 1947 /* (if `aface' isn't NULL). The only useful field in this special */
nuclear@0 1948 /* case is `face->num_faces' which gives the number of faces within */
nuclear@0 1949 /* the font file. After examination, the returned @FT_Face structure */
nuclear@0 1950 /* should be deallocated with a call to @FT_Done_Face. */
nuclear@0 1951 /* */
nuclear@0 1952 /* Each new face object created with this function also owns a */
nuclear@0 1953 /* default @FT_Size object, accessible as `face->size'. */
nuclear@0 1954 /* */
nuclear@0 1955 /* See the discussion of reference counters in the description of */
nuclear@0 1956 /* @FT_Reference_Face. */
nuclear@0 1957 /* */
nuclear@0 1958 FT_EXPORT( FT_Error )
nuclear@0 1959 FT_Open_Face( FT_Library library,
nuclear@0 1960 const FT_Open_Args* args,
nuclear@0 1961 FT_Long face_index,
nuclear@0 1962 FT_Face *aface );
nuclear@0 1963
nuclear@0 1964
nuclear@0 1965 /*************************************************************************/
nuclear@0 1966 /* */
nuclear@0 1967 /* <Function> */
nuclear@0 1968 /* FT_Attach_File */
nuclear@0 1969 /* */
nuclear@0 1970 /* <Description> */
nuclear@0 1971 /* This function calls @FT_Attach_Stream to attach a file. */
nuclear@0 1972 /* */
nuclear@0 1973 /* <InOut> */
nuclear@0 1974 /* face :: The target face object. */
nuclear@0 1975 /* */
nuclear@0 1976 /* <Input> */
nuclear@0 1977 /* filepathname :: The pathname. */
nuclear@0 1978 /* */
nuclear@0 1979 /* <Return> */
nuclear@0 1980 /* FreeType error code. 0~means success. */
nuclear@0 1981 /* */
nuclear@0 1982 FT_EXPORT( FT_Error )
nuclear@0 1983 FT_Attach_File( FT_Face face,
nuclear@0 1984 const char* filepathname );
nuclear@0 1985
nuclear@0 1986
nuclear@0 1987 /*************************************************************************/
nuclear@0 1988 /* */
nuclear@0 1989 /* <Function> */
nuclear@0 1990 /* FT_Attach_Stream */
nuclear@0 1991 /* */
nuclear@0 1992 /* <Description> */
nuclear@0 1993 /* `Attach' data to a face object. Normally, this is used to read */
nuclear@0 1994 /* additional information for the face object. For example, you can */
nuclear@0 1995 /* attach an AFM file that comes with a Type~1 font to get the */
nuclear@0 1996 /* kerning values and other metrics. */
nuclear@0 1997 /* */
nuclear@0 1998 /* <InOut> */
nuclear@0 1999 /* face :: The target face object. */
nuclear@0 2000 /* */
nuclear@0 2001 /* <Input> */
nuclear@0 2002 /* parameters :: A pointer to @FT_Open_Args which must be filled by */
nuclear@0 2003 /* the caller. */
nuclear@0 2004 /* */
nuclear@0 2005 /* <Return> */
nuclear@0 2006 /* FreeType error code. 0~means success. */
nuclear@0 2007 /* */
nuclear@0 2008 /* <Note> */
nuclear@0 2009 /* The meaning of the `attach' (i.e., what really happens when the */
nuclear@0 2010 /* new file is read) is not fixed by FreeType itself. It really */
nuclear@0 2011 /* depends on the font format (and thus the font driver). */
nuclear@0 2012 /* */
nuclear@0 2013 /* Client applications are expected to know what they are doing */
nuclear@0 2014 /* when invoking this function. Most drivers simply do not implement */
nuclear@0 2015 /* file attachments. */
nuclear@0 2016 /* */
nuclear@0 2017 FT_EXPORT( FT_Error )
nuclear@0 2018 FT_Attach_Stream( FT_Face face,
nuclear@0 2019 FT_Open_Args* parameters );
nuclear@0 2020
nuclear@0 2021
nuclear@0 2022 /*************************************************************************/
nuclear@0 2023 /* */
nuclear@0 2024 /* <Function> */
nuclear@0 2025 /* FT_Reference_Face */
nuclear@0 2026 /* */
nuclear@0 2027 /* <Description> */
nuclear@0 2028 /* A counter gets initialized to~1 at the time an @FT_Face structure */
nuclear@0 2029 /* is created. This function increments the counter. @FT_Done_Face */
nuclear@0 2030 /* then only destroys a face if the counter is~1, otherwise it simply */
nuclear@0 2031 /* decrements the counter. */
nuclear@0 2032 /* */
nuclear@0 2033 /* This function helps in managing life-cycles of structures which */
nuclear@0 2034 /* reference @FT_Face objects. */
nuclear@0 2035 /* */
nuclear@0 2036 /* <Input> */
nuclear@0 2037 /* face :: A handle to a target face object. */
nuclear@0 2038 /* */
nuclear@0 2039 /* <Return> */
nuclear@0 2040 /* FreeType error code. 0~means success. */
nuclear@0 2041 /* */
nuclear@0 2042 /* <Since> */
nuclear@0 2043 /* 2.4.2 */
nuclear@0 2044 /* */
nuclear@0 2045 FT_EXPORT( FT_Error )
nuclear@0 2046 FT_Reference_Face( FT_Face face );
nuclear@0 2047
nuclear@0 2048
nuclear@0 2049 /*************************************************************************/
nuclear@0 2050 /* */
nuclear@0 2051 /* <Function> */
nuclear@0 2052 /* FT_Done_Face */
nuclear@0 2053 /* */
nuclear@0 2054 /* <Description> */
nuclear@0 2055 /* Discard a given face object, as well as all of its child slots and */
nuclear@0 2056 /* sizes. */
nuclear@0 2057 /* */
nuclear@0 2058 /* <Input> */
nuclear@0 2059 /* face :: A handle to a target face object. */
nuclear@0 2060 /* */
nuclear@0 2061 /* <Return> */
nuclear@0 2062 /* FreeType error code. 0~means success. */
nuclear@0 2063 /* */
nuclear@0 2064 /* <Note> */
nuclear@0 2065 /* See the discussion of reference counters in the description of */
nuclear@0 2066 /* @FT_Reference_Face. */
nuclear@0 2067 /* */
nuclear@0 2068 FT_EXPORT( FT_Error )
nuclear@0 2069 FT_Done_Face( FT_Face face );
nuclear@0 2070
nuclear@0 2071
nuclear@0 2072 /*************************************************************************/
nuclear@0 2073 /* */
nuclear@0 2074 /* <Function> */
nuclear@0 2075 /* FT_Select_Size */
nuclear@0 2076 /* */
nuclear@0 2077 /* <Description> */
nuclear@0 2078 /* Select a bitmap strike. */
nuclear@0 2079 /* */
nuclear@0 2080 /* <InOut> */
nuclear@0 2081 /* face :: A handle to a target face object. */
nuclear@0 2082 /* */
nuclear@0 2083 /* <Input> */
nuclear@0 2084 /* strike_index :: The index of the bitmap strike in the */
nuclear@0 2085 /* `available_sizes' field of @FT_FaceRec structure. */
nuclear@0 2086 /* */
nuclear@0 2087 /* <Return> */
nuclear@0 2088 /* FreeType error code. 0~means success. */
nuclear@0 2089 /* */
nuclear@0 2090 FT_EXPORT( FT_Error )
nuclear@0 2091 FT_Select_Size( FT_Face face,
nuclear@0 2092 FT_Int strike_index );
nuclear@0 2093
nuclear@0 2094
nuclear@0 2095 /*************************************************************************/
nuclear@0 2096 /* */
nuclear@0 2097 /* <Enum> */
nuclear@0 2098 /* FT_Size_Request_Type */
nuclear@0 2099 /* */
nuclear@0 2100 /* <Description> */
nuclear@0 2101 /* An enumeration type that lists the supported size request types. */
nuclear@0 2102 /* */
nuclear@0 2103 /* <Values> */
nuclear@0 2104 /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
nuclear@0 2105 /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
nuclear@0 2106 /* used to determine both scaling values. */
nuclear@0 2107 /* */
nuclear@0 2108 /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
nuclear@0 2109 /* The real dimension. The sum of the the `Ascender' and (minus */
nuclear@0 2110 /* of) the `Descender' fields of @FT_FaceRec are used to determine */
nuclear@0 2111 /* both scaling values. */
nuclear@0 2112 /* */
nuclear@0 2113 /* FT_SIZE_REQUEST_TYPE_BBOX :: */
nuclear@0 2114 /* The font bounding box. The width and height of the `bbox' field */
nuclear@0 2115 /* of @FT_FaceRec are used to determine the horizontal and vertical */
nuclear@0 2116 /* scaling value, respectively. */
nuclear@0 2117 /* */
nuclear@0 2118 /* FT_SIZE_REQUEST_TYPE_CELL :: */
nuclear@0 2119 /* The `max_advance_width' field of @FT_FaceRec is used to */
nuclear@0 2120 /* determine the horizontal scaling value; the vertical scaling */
nuclear@0 2121 /* value is determined the same way as */
nuclear@0 2122 /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
nuclear@0 2123 /* values are set to the smaller one. This type is useful if you */
nuclear@0 2124 /* want to specify the font size for, say, a window of a given */
nuclear@0 2125 /* dimension and 80x24 cells. */
nuclear@0 2126 /* */
nuclear@0 2127 /* FT_SIZE_REQUEST_TYPE_SCALES :: */
nuclear@0 2128 /* Specify the scaling values directly. */
nuclear@0 2129 /* */
nuclear@0 2130 /* <Note> */
nuclear@0 2131 /* The above descriptions only apply to scalable formats. For bitmap */
nuclear@0 2132 /* formats, the behaviour is up to the driver. */
nuclear@0 2133 /* */
nuclear@0 2134 /* See the note section of @FT_Size_Metrics if you wonder how size */
nuclear@0 2135 /* requesting relates to scaling values. */
nuclear@0 2136 /* */
nuclear@0 2137 typedef enum FT_Size_Request_Type_
nuclear@0 2138 {
nuclear@0 2139 FT_SIZE_REQUEST_TYPE_NOMINAL,
nuclear@0 2140 FT_SIZE_REQUEST_TYPE_REAL_DIM,
nuclear@0 2141 FT_SIZE_REQUEST_TYPE_BBOX,
nuclear@0 2142 FT_SIZE_REQUEST_TYPE_CELL,
nuclear@0 2143 FT_SIZE_REQUEST_TYPE_SCALES,
nuclear@0 2144
nuclear@0 2145 FT_SIZE_REQUEST_TYPE_MAX
nuclear@0 2146
nuclear@0 2147 } FT_Size_Request_Type;
nuclear@0 2148
nuclear@0 2149
nuclear@0 2150 /*************************************************************************/
nuclear@0 2151 /* */
nuclear@0 2152 /* <Struct> */
nuclear@0 2153 /* FT_Size_RequestRec */
nuclear@0 2154 /* */
nuclear@0 2155 /* <Description> */
nuclear@0 2156 /* A structure used to model a size request. */
nuclear@0 2157 /* */
nuclear@0 2158 /* <Fields> */
nuclear@0 2159 /* type :: See @FT_Size_Request_Type. */
nuclear@0 2160 /* */
nuclear@0 2161 /* width :: The desired width. */
nuclear@0 2162 /* */
nuclear@0 2163 /* height :: The desired height. */
nuclear@0 2164 /* */
nuclear@0 2165 /* horiResolution :: The horizontal resolution. If set to zero, */
nuclear@0 2166 /* `width' is treated as a 26.6 fractional pixel */
nuclear@0 2167 /* value. */
nuclear@0 2168 /* */
nuclear@0 2169 /* vertResolution :: The vertical resolution. If set to zero, */
nuclear@0 2170 /* `height' is treated as a 26.6 fractional pixel */
nuclear@0 2171 /* value. */
nuclear@0 2172 /* */
nuclear@0 2173 /* <Note> */
nuclear@0 2174 /* If `width' is zero, then the horizontal scaling value is set equal */
nuclear@0 2175 /* to the vertical scaling value, and vice versa. */
nuclear@0 2176 /* */
nuclear@0 2177 typedef struct FT_Size_RequestRec_
nuclear@0 2178 {
nuclear@0 2179 FT_Size_Request_Type type;
nuclear@0 2180 FT_Long width;
nuclear@0 2181 FT_Long height;
nuclear@0 2182 FT_UInt horiResolution;
nuclear@0 2183 FT_UInt vertResolution;
nuclear@0 2184
nuclear@0 2185 } FT_Size_RequestRec;
nuclear@0 2186
nuclear@0 2187
nuclear@0 2188 /*************************************************************************/
nuclear@0 2189 /* */
nuclear@0 2190 /* <Struct> */
nuclear@0 2191 /* FT_Size_Request */
nuclear@0 2192 /* */
nuclear@0 2193 /* <Description> */
nuclear@0 2194 /* A handle to a size request structure. */
nuclear@0 2195 /* */
nuclear@0 2196 typedef struct FT_Size_RequestRec_ *FT_Size_Request;
nuclear@0 2197
nuclear@0 2198
nuclear@0 2199 /*************************************************************************/
nuclear@0 2200 /* */
nuclear@0 2201 /* <Function> */
nuclear@0 2202 /* FT_Request_Size */
nuclear@0 2203 /* */
nuclear@0 2204 /* <Description> */
nuclear@0 2205 /* Resize the scale of the active @FT_Size object in a face. */
nuclear@0 2206 /* */
nuclear@0 2207 /* <InOut> */
nuclear@0 2208 /* face :: A handle to a target face object. */
nuclear@0 2209 /* */
nuclear@0 2210 /* <Input> */
nuclear@0 2211 /* req :: A pointer to a @FT_Size_RequestRec. */
nuclear@0 2212 /* */
nuclear@0 2213 /* <Return> */
nuclear@0 2214 /* FreeType error code. 0~means success. */
nuclear@0 2215 /* */
nuclear@0 2216 /* <Note> */
nuclear@0 2217 /* Although drivers may select the bitmap strike matching the */
nuclear@0 2218 /* request, you should not rely on this if you intend to select a */
nuclear@0 2219 /* particular bitmap strike. Use @FT_Select_Size instead in that */
nuclear@0 2220 /* case. */
nuclear@0 2221 /* */
nuclear@0 2222 FT_EXPORT( FT_Error )
nuclear@0 2223 FT_Request_Size( FT_Face face,
nuclear@0 2224 FT_Size_Request req );
nuclear@0 2225
nuclear@0 2226
nuclear@0 2227 /*************************************************************************/
nuclear@0 2228 /* */
nuclear@0 2229 /* <Function> */
nuclear@0 2230 /* FT_Set_Char_Size */
nuclear@0 2231 /* */
nuclear@0 2232 /* <Description> */
nuclear@0 2233 /* This function calls @FT_Request_Size to request the nominal size */
nuclear@0 2234 /* (in points). */
nuclear@0 2235 /* */
nuclear@0 2236 /* <InOut> */
nuclear@0 2237 /* face :: A handle to a target face object. */
nuclear@0 2238 /* */
nuclear@0 2239 /* <Input> */
nuclear@0 2240 /* char_width :: The nominal width, in 26.6 fractional points. */
nuclear@0 2241 /* */
nuclear@0 2242 /* char_height :: The nominal height, in 26.6 fractional points. */
nuclear@0 2243 /* */
nuclear@0 2244 /* horz_resolution :: The horizontal resolution in dpi. */
nuclear@0 2245 /* */
nuclear@0 2246 /* vert_resolution :: The vertical resolution in dpi. */
nuclear@0 2247 /* */
nuclear@0 2248 /* <Return> */
nuclear@0 2249 /* FreeType error code. 0~means success. */
nuclear@0 2250 /* */
nuclear@0 2251 /* <Note> */
nuclear@0 2252 /* If either the character width or height is zero, it is set equal */
nuclear@0 2253 /* to the other value. */
nuclear@0 2254 /* */
nuclear@0 2255 /* If either the horizontal or vertical resolution is zero, it is set */
nuclear@0 2256 /* equal to the other value. */
nuclear@0 2257 /* */
nuclear@0 2258 /* A character width or height smaller than 1pt is set to 1pt; if */
nuclear@0 2259 /* both resolution values are zero, they are set to 72dpi. */
nuclear@0 2260 /* */
nuclear@0 2261 /* Don't use this function if you are using the FreeType cache API. */
nuclear@0 2262 /* */
nuclear@0 2263 FT_EXPORT( FT_Error )
nuclear@0 2264 FT_Set_Char_Size( FT_Face face,
nuclear@0 2265 FT_F26Dot6 char_width,
nuclear@0 2266 FT_F26Dot6 char_height,
nuclear@0 2267 FT_UInt horz_resolution,
nuclear@0 2268 FT_UInt vert_resolution );
nuclear@0 2269
nuclear@0 2270
nuclear@0 2271 /*************************************************************************/
nuclear@0 2272 /* */
nuclear@0 2273 /* <Function> */
nuclear@0 2274 /* FT_Set_Pixel_Sizes */
nuclear@0 2275 /* */
nuclear@0 2276 /* <Description> */
nuclear@0 2277 /* This function calls @FT_Request_Size to request the nominal size */
nuclear@0 2278 /* (in pixels). */
nuclear@0 2279 /* */
nuclear@0 2280 /* <InOut> */
nuclear@0 2281 /* face :: A handle to the target face object. */
nuclear@0 2282 /* */
nuclear@0 2283 /* <Input> */
nuclear@0 2284 /* pixel_width :: The nominal width, in pixels. */
nuclear@0 2285 /* */
nuclear@0 2286 /* pixel_height :: The nominal height, in pixels. */
nuclear@0 2287 /* */
nuclear@0 2288 /* <Return> */
nuclear@0 2289 /* FreeType error code. 0~means success. */
nuclear@0 2290 /* */
nuclear@0 2291 FT_EXPORT( FT_Error )
nuclear@0 2292 FT_Set_Pixel_Sizes( FT_Face face,
nuclear@0 2293 FT_UInt pixel_width,
nuclear@0 2294 FT_UInt pixel_height );
nuclear@0 2295
nuclear@0 2296
nuclear@0 2297 /*************************************************************************/
nuclear@0 2298 /* */
nuclear@0 2299 /* <Function> */
nuclear@0 2300 /* FT_Load_Glyph */
nuclear@0 2301 /* */
nuclear@0 2302 /* <Description> */
nuclear@0 2303 /* A function used to load a single glyph into the glyph slot of a */
nuclear@0 2304 /* face object. */
nuclear@0 2305 /* */
nuclear@0 2306 /* <InOut> */
nuclear@0 2307 /* face :: A handle to the target face object where the glyph */
nuclear@0 2308 /* is loaded. */
nuclear@0 2309 /* */
nuclear@0 2310 /* <Input> */
nuclear@0 2311 /* glyph_index :: The index of the glyph in the font file. For */
nuclear@0 2312 /* CID-keyed fonts (either in PS or in CFF format) */
nuclear@0 2313 /* this argument specifies the CID value. */
nuclear@0 2314 /* */
nuclear@0 2315 /* load_flags :: A flag indicating what to load for this glyph. The */
nuclear@0 2316 /* @FT_LOAD_XXX constants can be used to control the */
nuclear@0 2317 /* glyph loading process (e.g., whether the outline */
nuclear@0 2318 /* should be scaled, whether to load bitmaps or not, */
nuclear@0 2319 /* whether to hint the outline, etc). */
nuclear@0 2320 /* */
nuclear@0 2321 /* <Return> */
nuclear@0 2322 /* FreeType error code. 0~means success. */
nuclear@0 2323 /* */
nuclear@0 2324 /* <Note> */
nuclear@0 2325 /* The loaded glyph may be transformed. See @FT_Set_Transform for */
nuclear@0 2326 /* the details. */
nuclear@0 2327 /* */
nuclear@0 2328 /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
nuclear@0 2329 /* returned for invalid CID values (this is, for CID values which */
nuclear@0 2330 /* don't have a corresponding glyph in the font). See the discussion */
nuclear@0 2331 /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
nuclear@0 2332 /* */
nuclear@0 2333 FT_EXPORT( FT_Error )
nuclear@0 2334 FT_Load_Glyph( FT_Face face,
nuclear@0 2335 FT_UInt glyph_index,
nuclear@0 2336 FT_Int32 load_flags );
nuclear@0 2337
nuclear@0 2338
nuclear@0 2339 /*************************************************************************/
nuclear@0 2340 /* */
nuclear@0 2341 /* <Function> */
nuclear@0 2342 /* FT_Load_Char */
nuclear@0 2343 /* */
nuclear@0 2344 /* <Description> */
nuclear@0 2345 /* A function used to load a single glyph into the glyph slot of a */
nuclear@0 2346 /* face object, according to its character code. */
nuclear@0 2347 /* */
nuclear@0 2348 /* <InOut> */
nuclear@0 2349 /* face :: A handle to a target face object where the glyph */
nuclear@0 2350 /* is loaded. */
nuclear@0 2351 /* */
nuclear@0 2352 /* <Input> */
nuclear@0 2353 /* char_code :: The glyph's character code, according to the */
nuclear@0 2354 /* current charmap used in the face. */
nuclear@0 2355 /* */
nuclear@0 2356 /* load_flags :: A flag indicating what to load for this glyph. The */
nuclear@0 2357 /* @FT_LOAD_XXX constants can be used to control the */
nuclear@0 2358 /* glyph loading process (e.g., whether the outline */
nuclear@0 2359 /* should be scaled, whether to load bitmaps or not, */
nuclear@0 2360 /* whether to hint the outline, etc). */
nuclear@0 2361 /* */
nuclear@0 2362 /* <Return> */
nuclear@0 2363 /* FreeType error code. 0~means success. */
nuclear@0 2364 /* */
nuclear@0 2365 /* <Note> */
nuclear@0 2366 /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
nuclear@0 2367 /* */
nuclear@0 2368 FT_EXPORT( FT_Error )
nuclear@0 2369 FT_Load_Char( FT_Face face,
nuclear@0 2370 FT_ULong char_code,
nuclear@0 2371 FT_Int32 load_flags );
nuclear@0 2372
nuclear@0 2373
nuclear@0 2374 /*************************************************************************
nuclear@0 2375 *
nuclear@0 2376 * @enum:
nuclear@0 2377 * FT_LOAD_XXX
nuclear@0 2378 *
nuclear@0 2379 * @description:
nuclear@0 2380 * A list of bit-field constants used with @FT_Load_Glyph to indicate
nuclear@0 2381 * what kind of operations to perform during glyph loading.
nuclear@0 2382 *
nuclear@0 2383 * @values:
nuclear@0 2384 * FT_LOAD_DEFAULT ::
nuclear@0 2385 * Corresponding to~0, this value is used as the default glyph load
nuclear@0 2386 * operation. In this case, the following happens:
nuclear@0 2387 *
nuclear@0 2388 * 1. FreeType looks for a bitmap for the glyph corresponding to the
nuclear@0 2389 * face's current size. If one is found, the function returns.
nuclear@0 2390 * The bitmap data can be accessed from the glyph slot (see note
nuclear@0 2391 * below).
nuclear@0 2392 *
nuclear@0 2393 * 2. If no embedded bitmap is searched or found, FreeType looks for a
nuclear@0 2394 * scalable outline. If one is found, it is loaded from the font
nuclear@0 2395 * file, scaled to device pixels, then `hinted' to the pixel grid
nuclear@0 2396 * in order to optimize it. The outline data can be accessed from
nuclear@0 2397 * the glyph slot (see note below).
nuclear@0 2398 *
nuclear@0 2399 * Note that by default, the glyph loader doesn't render outlines into
nuclear@0 2400 * bitmaps. The following flags are used to modify this default
nuclear@0 2401 * behaviour to more specific and useful cases.
nuclear@0 2402 *
nuclear@0 2403 * FT_LOAD_NO_SCALE ::
nuclear@0 2404 * Don't scale the outline glyph loaded, but keep it in font units.
nuclear@0 2405 *
nuclear@0 2406 * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
nuclear@0 2407 * unsets @FT_LOAD_RENDER.
nuclear@0 2408 *
nuclear@0 2409 * FT_LOAD_NO_HINTING ::
nuclear@0 2410 * Disable hinting. This generally generates `blurrier' bitmap glyph
nuclear@0 2411 * when the glyph is rendered in any of the anti-aliased modes. See
nuclear@0 2412 * also the note below.
nuclear@0 2413 *
nuclear@0 2414 * This flag is implied by @FT_LOAD_NO_SCALE.
nuclear@0 2415 *
nuclear@0 2416 * FT_LOAD_RENDER ::
nuclear@0 2417 * Call @FT_Render_Glyph after the glyph is loaded. By default, the
nuclear@0 2418 * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
nuclear@0 2419 * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
nuclear@0 2420 *
nuclear@0 2421 * This flag is unset by @FT_LOAD_NO_SCALE.
nuclear@0 2422 *
nuclear@0 2423 * FT_LOAD_NO_BITMAP ::
nuclear@0 2424 * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
nuclear@0 2425 * flag.
nuclear@0 2426 *
nuclear@0 2427 * @FT_LOAD_NO_SCALE always sets this flag.
nuclear@0 2428 *
nuclear@0 2429 * FT_LOAD_VERTICAL_LAYOUT ::
nuclear@0 2430 * Load the glyph for vertical text layout. _Don't_ use it as it is
nuclear@0 2431 * problematic currently.
nuclear@0 2432 *
nuclear@0 2433 * FT_LOAD_FORCE_AUTOHINT ::
nuclear@0 2434 * Indicates that the auto-hinter is preferred over the font's native
nuclear@0 2435 * hinter. See also the note below.
nuclear@0 2436 *
nuclear@0 2437 * FT_LOAD_CROP_BITMAP ::
nuclear@0 2438 * Indicates that the font driver should crop the loaded bitmap glyph
nuclear@0 2439 * (i.e., remove all space around its black bits). Not all drivers
nuclear@0 2440 * implement this.
nuclear@0 2441 *
nuclear@0 2442 * FT_LOAD_PEDANTIC ::
nuclear@0 2443 * Indicates that the font driver should perform pedantic verifications
nuclear@0 2444 * during glyph loading. This is mostly used to detect broken glyphs
nuclear@0 2445 * in fonts. By default, FreeType tries to handle broken fonts also.
nuclear@0 2446 *
nuclear@0 2447 * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
nuclear@0 2448 * Indicates that the font driver should ignore the global advance
nuclear@0 2449 * width defined in the font. By default, that value is used as the
nuclear@0 2450 * advance width for all glyphs when the face has
nuclear@0 2451 * @FT_FACE_FLAG_FIXED_WIDTH set.
nuclear@0 2452 *
nuclear@0 2453 * This flag exists for historical reasons (to support buggy CJK
nuclear@0 2454 * fonts).
nuclear@0 2455 *
nuclear@0 2456 * FT_LOAD_NO_RECURSE ::
nuclear@0 2457 * This flag is only used internally. It merely indicates that the
nuclear@0 2458 * font driver should not load composite glyphs recursively. Instead,
nuclear@0 2459 * it should set the `num_subglyph' and `subglyphs' values of the
nuclear@0 2460 * glyph slot accordingly, and set `glyph->format' to
nuclear@0 2461 * @FT_GLYPH_FORMAT_COMPOSITE.
nuclear@0 2462 *
nuclear@0 2463 * The description of sub-glyphs is not available to client
nuclear@0 2464 * applications for now.
nuclear@0 2465 *
nuclear@0 2466 * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
nuclear@0 2467 *
nuclear@0 2468 * FT_LOAD_IGNORE_TRANSFORM ::
nuclear@0 2469 * Indicates that the transform matrix set by @FT_Set_Transform should
nuclear@0 2470 * be ignored.
nuclear@0 2471 *
nuclear@0 2472 * FT_LOAD_MONOCHROME ::
nuclear@0 2473 * This flag is used with @FT_LOAD_RENDER to indicate that you want to
nuclear@0 2474 * render an outline glyph to a 1-bit monochrome bitmap glyph, with
nuclear@0 2475 * 8~pixels packed into each byte of the bitmap data.
nuclear@0 2476 *
nuclear@0 2477 * Note that this has no effect on the hinting algorithm used. You
nuclear@0 2478 * should rather use @FT_LOAD_TARGET_MONO so that the
nuclear@0 2479 * monochrome-optimized hinting algorithm is used.
nuclear@0 2480 *
nuclear@0 2481 * FT_LOAD_LINEAR_DESIGN ::
nuclear@0 2482 * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
nuclear@0 2483 * fields of @FT_GlyphSlotRec should be kept in font units. See
nuclear@0 2484 * @FT_GlyphSlotRec for details.
nuclear@0 2485 *
nuclear@0 2486 * FT_LOAD_NO_AUTOHINT ::
nuclear@0 2487 * Disable auto-hinter. See also the note below.
nuclear@0 2488 *
nuclear@0 2489 * @note:
nuclear@0 2490 * By default, hinting is enabled and the font's native hinter (see
nuclear@0 2491 * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
nuclear@0 2492 * disable hinting by setting @FT_LOAD_NO_HINTING or change the
nuclear@0 2493 * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
nuclear@0 2494 * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
nuclear@0 2495 * used at all.
nuclear@0 2496 *
nuclear@0 2497 * See the description of @FT_FACE_FLAG_TRICKY for a special exception
nuclear@0 2498 * (affecting only a handful of Asian fonts).
nuclear@0 2499 *
nuclear@0 2500 * Besides deciding which hinter to use, you can also decide which
nuclear@0 2501 * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
nuclear@0 2502 *
nuclear@0 2503 */
nuclear@0 2504 #define FT_LOAD_DEFAULT 0x0
nuclear@0 2505 #define FT_LOAD_NO_SCALE 0x1
nuclear@0 2506 #define FT_LOAD_NO_HINTING 0x2
nuclear@0 2507 #define FT_LOAD_RENDER 0x4
nuclear@0 2508 #define FT_LOAD_NO_BITMAP 0x8
nuclear@0 2509 #define FT_LOAD_VERTICAL_LAYOUT 0x10
nuclear@0 2510 #define FT_LOAD_FORCE_AUTOHINT 0x20
nuclear@0 2511 #define FT_LOAD_CROP_BITMAP 0x40
nuclear@0 2512 #define FT_LOAD_PEDANTIC 0x80
nuclear@0 2513 #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200
nuclear@0 2514 #define FT_LOAD_NO_RECURSE 0x400
nuclear@0 2515 #define FT_LOAD_IGNORE_TRANSFORM 0x800
nuclear@0 2516 #define FT_LOAD_MONOCHROME 0x1000
nuclear@0 2517 #define FT_LOAD_LINEAR_DESIGN 0x2000
nuclear@0 2518 #define FT_LOAD_NO_AUTOHINT 0x8000U
nuclear@0 2519
nuclear@0 2520 /* */
nuclear@0 2521
nuclear@0 2522 /* used internally only by certain font drivers! */
nuclear@0 2523 #define FT_LOAD_ADVANCE_ONLY 0x100
nuclear@0 2524 #define FT_LOAD_SBITS_ONLY 0x4000
nuclear@0 2525
nuclear@0 2526
nuclear@0 2527 /**************************************************************************
nuclear@0 2528 *
nuclear@0 2529 * @enum:
nuclear@0 2530 * FT_LOAD_TARGET_XXX
nuclear@0 2531 *
nuclear@0 2532 * @description:
nuclear@0 2533 * A list of values that are used to select a specific hinting algorithm
nuclear@0 2534 * to use by the hinter. You should OR one of these values to your
nuclear@0 2535 * `load_flags' when calling @FT_Load_Glyph.
nuclear@0 2536 *
nuclear@0 2537 * Note that font's native hinters may ignore the hinting algorithm you
nuclear@0 2538 * have specified (e.g., the TrueType bytecode interpreter). You can set
nuclear@0 2539 * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
nuclear@0 2540 *
nuclear@0 2541 * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
nuclear@0 2542 * always implies @FT_LOAD_FORCE_AUTOHINT.
nuclear@0 2543 *
nuclear@0 2544 * @values:
nuclear@0 2545 * FT_LOAD_TARGET_NORMAL ::
nuclear@0 2546 * This corresponds to the default hinting algorithm, optimized for
nuclear@0 2547 * standard gray-level rendering. For monochrome output, use
nuclear@0 2548 * @FT_LOAD_TARGET_MONO instead.
nuclear@0 2549 *
nuclear@0 2550 * FT_LOAD_TARGET_LIGHT ::
nuclear@0 2551 * A lighter hinting algorithm for non-monochrome modes. Many
nuclear@0 2552 * generated glyphs are more fuzzy but better resemble its original
nuclear@0 2553 * shape. A bit like rendering on Mac OS~X.
nuclear@0 2554 *
nuclear@0 2555 * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
nuclear@0 2556 *
nuclear@0 2557 * FT_LOAD_TARGET_MONO ::
nuclear@0 2558 * Strong hinting algorithm that should only be used for monochrome
nuclear@0 2559 * output. The result is probably unpleasant if the glyph is rendered
nuclear@0 2560 * in non-monochrome modes.
nuclear@0 2561 *
nuclear@0 2562 * FT_LOAD_TARGET_LCD ::
nuclear@0 2563 * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
nuclear@0 2564 * decimated LCD displays.
nuclear@0 2565 *
nuclear@0 2566 * FT_LOAD_TARGET_LCD_V ::
nuclear@0 2567 * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
nuclear@0 2568 * decimated LCD displays.
nuclear@0 2569 *
nuclear@0 2570 * @note:
nuclear@0 2571 * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
nuclear@0 2572 * `load_flags'. They can't be ORed.
nuclear@0 2573 *
nuclear@0 2574 * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
nuclear@0 2575 * corresponding mode (i.e., the mode which matches the used algorithm
nuclear@0 2576 * best) unless @FT_LOAD_MONOCHROME is set.
nuclear@0 2577 *
nuclear@0 2578 * You can use a hinting algorithm that doesn't correspond to the same
nuclear@0 2579 * rendering mode. As an example, it is possible to use the `light'
nuclear@0 2580 * hinting algorithm and have the results rendered in horizontal LCD
nuclear@0 2581 * pixel mode, with code like
nuclear@0 2582 *
nuclear@0 2583 * {
nuclear@0 2584 * FT_Load_Glyph( face, glyph_index,
nuclear@0 2585 * load_flags | FT_LOAD_TARGET_LIGHT );
nuclear@0 2586 *
nuclear@0 2587 * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
nuclear@0 2588 * }
nuclear@0 2589 *
nuclear@0 2590 */
nuclear@0 2591 #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
nuclear@0 2592
nuclear@0 2593 #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
nuclear@0 2594 #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
nuclear@0 2595 #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
nuclear@0 2596 #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
nuclear@0 2597 #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
nuclear@0 2598
nuclear@0 2599
nuclear@0 2600 /**************************************************************************
nuclear@0 2601 *
nuclear@0 2602 * @macro:
nuclear@0 2603 * FT_LOAD_TARGET_MODE
nuclear@0 2604 *
nuclear@0 2605 * @description:
nuclear@0 2606 * Return the @FT_Render_Mode corresponding to a given
nuclear@0 2607 * @FT_LOAD_TARGET_XXX value.
nuclear@0 2608 *
nuclear@0 2609 */
nuclear@0 2610 #define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
nuclear@0 2611
nuclear@0 2612
nuclear@0 2613 /*************************************************************************/
nuclear@0 2614 /* */
nuclear@0 2615 /* <Function> */
nuclear@0 2616 /* FT_Set_Transform */
nuclear@0 2617 /* */
nuclear@0 2618 /* <Description> */
nuclear@0 2619 /* A function used to set the transformation that is applied to glyph */
nuclear@0 2620 /* images when they are loaded into a glyph slot through */
nuclear@0 2621 /* @FT_Load_Glyph. */
nuclear@0 2622 /* */
nuclear@0 2623 /* <InOut> */
nuclear@0 2624 /* face :: A handle to the source face object. */
nuclear@0 2625 /* */
nuclear@0 2626 /* <Input> */
nuclear@0 2627 /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
nuclear@0 2628 /* the identity matrix. */
nuclear@0 2629 /* delta :: A pointer to the translation vector. Use~0 for the null */
nuclear@0 2630 /* vector. */
nuclear@0 2631 /* */
nuclear@0 2632 /* <Note> */
nuclear@0 2633 /* The transformation is only applied to scalable image formats after */
nuclear@0 2634 /* the glyph has been loaded. It means that hinting is unaltered by */
nuclear@0 2635 /* the transformation and is performed on the character size given in */
nuclear@0 2636 /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
nuclear@0 2637 /* */
nuclear@0 2638 /* Note that this also transforms the `face.glyph.advance' field, but */
nuclear@0 2639 /* *not* the values in `face.glyph.metrics'. */
nuclear@0 2640 /* */
nuclear@0 2641 FT_EXPORT( void )
nuclear@0 2642 FT_Set_Transform( FT_Face face,
nuclear@0 2643 FT_Matrix* matrix,
nuclear@0 2644 FT_Vector* delta );
nuclear@0 2645
nuclear@0 2646
nuclear@0 2647 /*************************************************************************/
nuclear@0 2648 /* */
nuclear@0 2649 /* <Enum> */
nuclear@0 2650 /* FT_Render_Mode */
nuclear@0 2651 /* */
nuclear@0 2652 /* <Description> */
nuclear@0 2653 /* An enumeration type that lists the render modes supported by */
nuclear@0 2654 /* FreeType~2. Each mode corresponds to a specific type of scanline */
nuclear@0 2655 /* conversion performed on the outline. */
nuclear@0 2656 /* */
nuclear@0 2657 /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
nuclear@0 2658 /* field in the @FT_GlyphSlotRec structure gives the format of the */
nuclear@0 2659 /* returned bitmap. */
nuclear@0 2660 /* */
nuclear@0 2661 /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
nuclear@0 2662 /* */
nuclear@0 2663 /* <Values> */
nuclear@0 2664 /* FT_RENDER_MODE_NORMAL :: */
nuclear@0 2665 /* This is the default render mode; it corresponds to 8-bit */
nuclear@0 2666 /* anti-aliased bitmaps. */
nuclear@0 2667 /* */
nuclear@0 2668 /* FT_RENDER_MODE_LIGHT :: */
nuclear@0 2669 /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
nuclear@0 2670 /* defined as a separate value because render modes are also used */
nuclear@0 2671 /* indirectly to define hinting algorithm selectors. See */
nuclear@0 2672 /* @FT_LOAD_TARGET_XXX for details. */
nuclear@0 2673 /* */
nuclear@0 2674 /* FT_RENDER_MODE_MONO :: */
nuclear@0 2675 /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
nuclear@0 2676 /* opacity). */
nuclear@0 2677 /* */
nuclear@0 2678 /* FT_RENDER_MODE_LCD :: */
nuclear@0 2679 /* This mode corresponds to horizontal RGB and BGR sub-pixel */
nuclear@0 2680 /* displays like LCD screens. It produces 8-bit bitmaps that are */
nuclear@0 2681 /* 3~times the width of the original glyph outline in pixels, and */
nuclear@0 2682 /* which use the @FT_PIXEL_MODE_LCD mode. */
nuclear@0 2683 /* */
nuclear@0 2684 /* FT_RENDER_MODE_LCD_V :: */
nuclear@0 2685 /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
nuclear@0 2686 /* (like PDA screens, rotated LCD displays, etc.). It produces */
nuclear@0 2687 /* 8-bit bitmaps that are 3~times the height of the original */
nuclear@0 2688 /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
nuclear@0 2689 /* */
nuclear@0 2690 /* <Note> */
nuclear@0 2691 /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
nuclear@0 2692 /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
nuclear@0 2693 /* (not active in the default builds). It is up to the caller to */
nuclear@0 2694 /* either call @FT_Library_SetLcdFilter (if available) or do the */
nuclear@0 2695 /* filtering itself. */
nuclear@0 2696 /* */
nuclear@0 2697 /* The selected render mode only affects vector glyphs of a font. */
nuclear@0 2698 /* Embedded bitmaps often have a different pixel mode like */
nuclear@0 2699 /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
nuclear@0 2700 /* them into 8-bit pixmaps. */
nuclear@0 2701 /* */
nuclear@0 2702 typedef enum FT_Render_Mode_
nuclear@0 2703 {
nuclear@0 2704 FT_RENDER_MODE_NORMAL = 0,
nuclear@0 2705 FT_RENDER_MODE_LIGHT,
nuclear@0 2706 FT_RENDER_MODE_MONO,
nuclear@0 2707 FT_RENDER_MODE_LCD,
nuclear@0 2708 FT_RENDER_MODE_LCD_V,
nuclear@0 2709
nuclear@0 2710 FT_RENDER_MODE_MAX
nuclear@0 2711
nuclear@0 2712 } FT_Render_Mode;
nuclear@0 2713
nuclear@0 2714
nuclear@0 2715 /*************************************************************************/
nuclear@0 2716 /* */
nuclear@0 2717 /* <Enum> */
nuclear@0 2718 /* ft_render_mode_xxx */
nuclear@0 2719 /* */
nuclear@0 2720 /* <Description> */
nuclear@0 2721 /* These constants are deprecated. Use the corresponding */
nuclear@0 2722 /* @FT_Render_Mode values instead. */
nuclear@0 2723 /* */
nuclear@0 2724 /* <Values> */
nuclear@0 2725 /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
nuclear@0 2726 /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
nuclear@0 2727 /* */
nuclear@0 2728 #define ft_render_mode_normal FT_RENDER_MODE_NORMAL
nuclear@0 2729 #define ft_render_mode_mono FT_RENDER_MODE_MONO
nuclear@0 2730
nuclear@0 2731
nuclear@0 2732 /*************************************************************************/
nuclear@0 2733 /* */
nuclear@0 2734 /* <Function> */
nuclear@0 2735 /* FT_Render_Glyph */
nuclear@0 2736 /* */
nuclear@0 2737 /* <Description> */
nuclear@0 2738 /* Convert a given glyph image to a bitmap. It does so by inspecting */
nuclear@0 2739 /* the glyph image format, finding the relevant renderer, and */
nuclear@0 2740 /* invoking it. */
nuclear@0 2741 /* */
nuclear@0 2742 /* <InOut> */
nuclear@0 2743 /* slot :: A handle to the glyph slot containing the image to */
nuclear@0 2744 /* convert. */
nuclear@0 2745 /* */
nuclear@0 2746 /* <Input> */
nuclear@0 2747 /* render_mode :: This is the render mode used to render the glyph */
nuclear@0 2748 /* image into a bitmap. See @FT_Render_Mode for a */
nuclear@0 2749 /* list of possible values. */
nuclear@0 2750 /* */
nuclear@0 2751 /* <Return> */
nuclear@0 2752 /* FreeType error code. 0~means success. */
nuclear@0 2753 /* */
nuclear@0 2754 FT_EXPORT( FT_Error )
nuclear@0 2755 FT_Render_Glyph( FT_GlyphSlot slot,
nuclear@0 2756 FT_Render_Mode render_mode );
nuclear@0 2757
nuclear@0 2758
nuclear@0 2759 /*************************************************************************/
nuclear@0 2760 /* */
nuclear@0 2761 /* <Enum> */
nuclear@0 2762 /* FT_Kerning_Mode */
nuclear@0 2763 /* */
nuclear@0 2764 /* <Description> */
nuclear@0 2765 /* An enumeration used to specify which kerning values to return in */
nuclear@0 2766 /* @FT_Get_Kerning. */
nuclear@0 2767 /* */
nuclear@0 2768 /* <Values> */
nuclear@0 2769 /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
nuclear@0 2770 /* distances (value is~0). */
nuclear@0 2771 /* */
nuclear@0 2772 /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
nuclear@0 2773 /* distances. */
nuclear@0 2774 /* */
nuclear@0 2775 /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
nuclear@0 2776 /* units. */
nuclear@0 2777 /* */
nuclear@0 2778 typedef enum FT_Kerning_Mode_
nuclear@0 2779 {
nuclear@0 2780 FT_KERNING_DEFAULT = 0,
nuclear@0 2781 FT_KERNING_UNFITTED,
nuclear@0 2782 FT_KERNING_UNSCALED
nuclear@0 2783
nuclear@0 2784 } FT_Kerning_Mode;
nuclear@0 2785
nuclear@0 2786
nuclear@0 2787 /*************************************************************************/
nuclear@0 2788 /* */
nuclear@0 2789 /* <Const> */
nuclear@0 2790 /* ft_kerning_default */
nuclear@0 2791 /* */
nuclear@0 2792 /* <Description> */
nuclear@0 2793 /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
nuclear@0 2794 /* instead. */
nuclear@0 2795 /* */
nuclear@0 2796 #define ft_kerning_default FT_KERNING_DEFAULT
nuclear@0 2797
nuclear@0 2798
nuclear@0 2799 /*************************************************************************/
nuclear@0 2800 /* */
nuclear@0 2801 /* <Const> */
nuclear@0 2802 /* ft_kerning_unfitted */
nuclear@0 2803 /* */
nuclear@0 2804 /* <Description> */
nuclear@0 2805 /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
nuclear@0 2806 /* instead. */
nuclear@0 2807 /* */
nuclear@0 2808 #define ft_kerning_unfitted FT_KERNING_UNFITTED
nuclear@0 2809
nuclear@0 2810
nuclear@0 2811 /*************************************************************************/
nuclear@0 2812 /* */
nuclear@0 2813 /* <Const> */
nuclear@0 2814 /* ft_kerning_unscaled */
nuclear@0 2815 /* */
nuclear@0 2816 /* <Description> */
nuclear@0 2817 /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
nuclear@0 2818 /* instead. */
nuclear@0 2819 /* */
nuclear@0 2820 #define ft_kerning_unscaled FT_KERNING_UNSCALED
nuclear@0 2821
nuclear@0 2822
nuclear@0 2823 /*************************************************************************/
nuclear@0 2824 /* */
nuclear@0 2825 /* <Function> */
nuclear@0 2826 /* FT_Get_Kerning */
nuclear@0 2827 /* */
nuclear@0 2828 /* <Description> */
nuclear@0 2829 /* Return the kerning vector between two glyphs of a same face. */
nuclear@0 2830 /* */
nuclear@0 2831 /* <Input> */
nuclear@0 2832 /* face :: A handle to a source face object. */
nuclear@0 2833 /* */
nuclear@0 2834 /* left_glyph :: The index of the left glyph in the kern pair. */
nuclear@0 2835 /* */
nuclear@0 2836 /* right_glyph :: The index of the right glyph in the kern pair. */
nuclear@0 2837 /* */
nuclear@0 2838 /* kern_mode :: See @FT_Kerning_Mode for more information. */
nuclear@0 2839 /* Determines the scale and dimension of the returned */
nuclear@0 2840 /* kerning vector. */
nuclear@0 2841 /* */
nuclear@0 2842 /* <Output> */
nuclear@0 2843 /* akerning :: The kerning vector. This is either in font units */
nuclear@0 2844 /* or in pixels (26.6 format) for scalable formats, */
nuclear@0 2845 /* and in pixels for fixed-sizes formats. */
nuclear@0 2846 /* */
nuclear@0 2847 /* <Return> */
nuclear@0 2848 /* FreeType error code. 0~means success. */
nuclear@0 2849 /* */
nuclear@0 2850 /* <Note> */
nuclear@0 2851 /* Only horizontal layouts (left-to-right & right-to-left) are */
nuclear@0 2852 /* supported by this method. Other layouts, or more sophisticated */
nuclear@0 2853 /* kernings, are out of the scope of this API function -- they can be */
nuclear@0 2854 /* implemented through format-specific interfaces. */
nuclear@0 2855 /* */
nuclear@0 2856 FT_EXPORT( FT_Error )
nuclear@0 2857 FT_Get_Kerning( FT_Face face,
nuclear@0 2858 FT_UInt left_glyph,
nuclear@0 2859 FT_UInt right_glyph,
nuclear@0 2860 FT_UInt kern_mode,
nuclear@0 2861 FT_Vector *akerning );
nuclear@0 2862
nuclear@0 2863
nuclear@0 2864 /*************************************************************************/
nuclear@0 2865 /* */
nuclear@0 2866 /* <Function> */
nuclear@0 2867 /* FT_Get_Track_Kerning */
nuclear@0 2868 /* */
nuclear@0 2869 /* <Description> */
nuclear@0 2870 /* Return the track kerning for a given face object at a given size. */
nuclear@0 2871 /* */
nuclear@0 2872 /* <Input> */
nuclear@0 2873 /* face :: A handle to a source face object. */
nuclear@0 2874 /* */
nuclear@0 2875 /* point_size :: The point size in 16.16 fractional points. */
nuclear@0 2876 /* */
nuclear@0 2877 /* degree :: The degree of tightness. */
nuclear@0 2878 /* */
nuclear@0 2879 /* <Output> */
nuclear@0 2880 /* akerning :: The kerning in 16.16 fractional points. */
nuclear@0 2881 /* */
nuclear@0 2882 /* <Return> */
nuclear@0 2883 /* FreeType error code. 0~means success. */
nuclear@0 2884 /* */
nuclear@0 2885 FT_EXPORT( FT_Error )
nuclear@0 2886 FT_Get_Track_Kerning( FT_Face face,
nuclear@0 2887 FT_Fixed point_size,
nuclear@0 2888 FT_Int degree,
nuclear@0 2889 FT_Fixed* akerning );
nuclear@0 2890
nuclear@0 2891
nuclear@0 2892 /*************************************************************************/
nuclear@0 2893 /* */
nuclear@0 2894 /* <Function> */
nuclear@0 2895 /* FT_Get_Glyph_Name */
nuclear@0 2896 /* */
nuclear@0 2897 /* <Description> */
nuclear@0 2898 /* Retrieve the ASCII name of a given glyph in a face. This only */
nuclear@0 2899 /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
nuclear@0 2900 /* */
nuclear@0 2901 /* <Input> */
nuclear@0 2902 /* face :: A handle to a source face object. */
nuclear@0 2903 /* */
nuclear@0 2904 /* glyph_index :: The glyph index. */
nuclear@0 2905 /* */
nuclear@0 2906 /* buffer_max :: The maximal number of bytes available in the */
nuclear@0 2907 /* buffer. */
nuclear@0 2908 /* */
nuclear@0 2909 /* <Output> */
nuclear@0 2910 /* buffer :: A pointer to a target buffer where the name is */
nuclear@0 2911 /* copied to. */
nuclear@0 2912 /* */
nuclear@0 2913 /* <Return> */
nuclear@0 2914 /* FreeType error code. 0~means success. */
nuclear@0 2915 /* */
nuclear@0 2916 /* <Note> */
nuclear@0 2917 /* An error is returned if the face doesn't provide glyph names or if */
nuclear@0 2918 /* the glyph index is invalid. In all cases of failure, the first */
nuclear@0 2919 /* byte of `buffer' is set to~0 to indicate an empty name. */
nuclear@0 2920 /* */
nuclear@0 2921 /* The glyph name is truncated to fit within the buffer if it is too */
nuclear@0 2922 /* long. The returned string is always zero-terminated. */
nuclear@0 2923 /* */
nuclear@0 2924 /* This function is not compiled within the library if the config */
nuclear@0 2925 /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
nuclear@0 2926 /* `include/freetype/config/ftoptions.h'. */
nuclear@0 2927 /* */
nuclear@0 2928 FT_EXPORT( FT_Error )
nuclear@0 2929 FT_Get_Glyph_Name( FT_Face face,
nuclear@0 2930 FT_UInt glyph_index,
nuclear@0 2931 FT_Pointer buffer,
nuclear@0 2932 FT_UInt buffer_max );
nuclear@0 2933
nuclear@0 2934
nuclear@0 2935 /*************************************************************************/
nuclear@0 2936 /* */
nuclear@0 2937 /* <Function> */
nuclear@0 2938 /* FT_Get_Postscript_Name */
nuclear@0 2939 /* */
nuclear@0 2940 /* <Description> */
nuclear@0 2941 /* Retrieve the ASCII PostScript name of a given face, if available. */
nuclear@0 2942 /* This only works with PostScript and TrueType fonts. */
nuclear@0 2943 /* */
nuclear@0 2944 /* <Input> */
nuclear@0 2945 /* face :: A handle to the source face object. */
nuclear@0 2946 /* */
nuclear@0 2947 /* <Return> */
nuclear@0 2948 /* A pointer to the face's PostScript name. NULL if unavailable. */
nuclear@0 2949 /* */
nuclear@0 2950 /* <Note> */
nuclear@0 2951 /* The returned pointer is owned by the face and is destroyed with */
nuclear@0 2952 /* it. */
nuclear@0 2953 /* */
nuclear@0 2954 FT_EXPORT( const char* )
nuclear@0 2955 FT_Get_Postscript_Name( FT_Face face );
nuclear@0 2956
nuclear@0 2957
nuclear@0 2958 /*************************************************************************/
nuclear@0 2959 /* */
nuclear@0 2960 /* <Function> */
nuclear@0 2961 /* FT_Select_Charmap */
nuclear@0 2962 /* */
nuclear@0 2963 /* <Description> */
nuclear@0 2964 /* Select a given charmap by its encoding tag (as listed in */
nuclear@0 2965 /* `freetype.h'). */
nuclear@0 2966 /* */
nuclear@0 2967 /* <InOut> */
nuclear@0 2968 /* face :: A handle to the source face object. */
nuclear@0 2969 /* */
nuclear@0 2970 /* <Input> */
nuclear@0 2971 /* encoding :: A handle to the selected encoding. */
nuclear@0 2972 /* */
nuclear@0 2973 /* <Return> */
nuclear@0 2974 /* FreeType error code. 0~means success. */
nuclear@0 2975 /* */
nuclear@0 2976 /* <Note> */
nuclear@0 2977 /* This function returns an error if no charmap in the face */
nuclear@0 2978 /* corresponds to the encoding queried here. */
nuclear@0 2979 /* */
nuclear@0 2980 /* Because many fonts contain more than a single cmap for Unicode */
nuclear@0 2981 /* encoding, this function has some special code to select the one */
nuclear@0 2982 /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
nuclear@0 2983 /* is preferred to a UCS-2 cmap). It is thus preferable to */
nuclear@0 2984 /* @FT_Set_Charmap in this case. */
nuclear@0 2985 /* */
nuclear@0 2986 FT_EXPORT( FT_Error )
nuclear@0 2987 FT_Select_Charmap( FT_Face face,
nuclear@0 2988 FT_Encoding encoding );
nuclear@0 2989
nuclear@0 2990
nuclear@0 2991 /*************************************************************************/
nuclear@0 2992 /* */
nuclear@0 2993 /* <Function> */
nuclear@0 2994 /* FT_Set_Charmap */
nuclear@0 2995 /* */
nuclear@0 2996 /* <Description> */
nuclear@0 2997 /* Select a given charmap for character code to glyph index mapping. */
nuclear@0 2998 /* */
nuclear@0 2999 /* <InOut> */
nuclear@0 3000 /* face :: A handle to the source face object. */
nuclear@0 3001 /* */
nuclear@0 3002 /* <Input> */
nuclear@0 3003 /* charmap :: A handle to the selected charmap. */
nuclear@0 3004 /* */
nuclear@0 3005 /* <Return> */
nuclear@0 3006 /* FreeType error code. 0~means success. */
nuclear@0 3007 /* */
nuclear@0 3008 /* <Note> */
nuclear@0 3009 /* This function returns an error if the charmap is not part of */
nuclear@0 3010 /* the face (i.e., if it is not listed in the `face->charmaps' */
nuclear@0 3011 /* table). */
nuclear@0 3012 /* */
nuclear@0 3013 /* It also fails if a type~14 charmap is selected. */
nuclear@0 3014 /* */
nuclear@0 3015 FT_EXPORT( FT_Error )
nuclear@0 3016 FT_Set_Charmap( FT_Face face,
nuclear@0 3017 FT_CharMap charmap );
nuclear@0 3018
nuclear@0 3019
nuclear@0 3020 /*************************************************************************
nuclear@0 3021 *
nuclear@0 3022 * @function:
nuclear@0 3023 * FT_Get_Charmap_Index
nuclear@0 3024 *
nuclear@0 3025 * @description:
nuclear@0 3026 * Retrieve index of a given charmap.
nuclear@0 3027 *
nuclear@0 3028 * @input:
nuclear@0 3029 * charmap ::
nuclear@0 3030 * A handle to a charmap.
nuclear@0 3031 *
nuclear@0 3032 * @return:
nuclear@0 3033 * The index into the array of character maps within the face to which
nuclear@0 3034 * `charmap' belongs. If an error occurs, -1 is returned.
nuclear@0 3035 *
nuclear@0 3036 */
nuclear@0 3037 FT_EXPORT( FT_Int )
nuclear@0 3038 FT_Get_Charmap_Index( FT_CharMap charmap );
nuclear@0 3039
nuclear@0 3040
nuclear@0 3041 /*************************************************************************/
nuclear@0 3042 /* */
nuclear@0 3043 /* <Function> */
nuclear@0 3044 /* FT_Get_Char_Index */
nuclear@0 3045 /* */
nuclear@0 3046 /* <Description> */
nuclear@0 3047 /* Return the glyph index of a given character code. This function */
nuclear@0 3048 /* uses a charmap object to do the mapping. */
nuclear@0 3049 /* */
nuclear@0 3050 /* <Input> */
nuclear@0 3051 /* face :: A handle to the source face object. */
nuclear@0 3052 /* */
nuclear@0 3053 /* charcode :: The character code. */
nuclear@0 3054 /* */
nuclear@0 3055 /* <Return> */
nuclear@0 3056 /* The glyph index. 0~means `undefined character code'. */
nuclear@0 3057 /* */
nuclear@0 3058 /* <Note> */
nuclear@0 3059 /* If you use FreeType to manipulate the contents of font files */
nuclear@0 3060 /* directly, be aware that the glyph index returned by this function */
nuclear@0 3061 /* doesn't always correspond to the internal indices used within */
nuclear@0 3062 /* the file. This is done to ensure that value~0 always corresponds */
nuclear@0 3063 /* to the `missing glyph'. */
nuclear@0 3064 /* */
nuclear@0 3065 FT_EXPORT( FT_UInt )
nuclear@0 3066 FT_Get_Char_Index( FT_Face face,
nuclear@0 3067 FT_ULong charcode );
nuclear@0 3068
nuclear@0 3069
nuclear@0 3070 /*************************************************************************/
nuclear@0 3071 /* */
nuclear@0 3072 /* <Function> */
nuclear@0 3073 /* FT_Get_First_Char */
nuclear@0 3074 /* */
nuclear@0 3075 /* <Description> */
nuclear@0 3076 /* This function is used to return the first character code in the */
nuclear@0 3077 /* current charmap of a given face. It also returns the */
nuclear@0 3078 /* corresponding glyph index. */
nuclear@0 3079 /* */
nuclear@0 3080 /* <Input> */
nuclear@0 3081 /* face :: A handle to the source face object. */
nuclear@0 3082 /* */
nuclear@0 3083 /* <Output> */
nuclear@0 3084 /* agindex :: Glyph index of first character code. 0~if charmap is */
nuclear@0 3085 /* empty. */
nuclear@0 3086 /* */
nuclear@0 3087 /* <Return> */
nuclear@0 3088 /* The charmap's first character code. */
nuclear@0 3089 /* */
nuclear@0 3090 /* <Note> */
nuclear@0 3091 /* You should use this function with @FT_Get_Next_Char to be able to */
nuclear@0 3092 /* parse all character codes available in a given charmap. The code */
nuclear@0 3093 /* should look like this: */
nuclear@0 3094 /* */
nuclear@0 3095 /* { */
nuclear@0 3096 /* FT_ULong charcode; */
nuclear@0 3097 /* FT_UInt gindex; */
nuclear@0 3098 /* */
nuclear@0 3099 /* */
nuclear@0 3100 /* charcode = FT_Get_First_Char( face, &gindex ); */
nuclear@0 3101 /* while ( gindex != 0 ) */
nuclear@0 3102 /* { */
nuclear@0 3103 /* ... do something with (charcode,gindex) pair ... */
nuclear@0 3104 /* */
nuclear@0 3105 /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
nuclear@0 3106 /* } */
nuclear@0 3107 /* } */
nuclear@0 3108 /* */
nuclear@0 3109 /* Note that `*agindex' is set to~0 if the charmap is empty. The */
nuclear@0 3110 /* result itself can be~0 in two cases: if the charmap is empty or */
nuclear@0 3111 /* if the value~0 is the first valid character code. */
nuclear@0 3112 /* */
nuclear@0 3113 FT_EXPORT( FT_ULong )
nuclear@0 3114 FT_Get_First_Char( FT_Face face,
nuclear@0 3115 FT_UInt *agindex );
nuclear@0 3116
nuclear@0 3117
nuclear@0 3118 /*************************************************************************/
nuclear@0 3119 /* */
nuclear@0 3120 /* <Function> */
nuclear@0 3121 /* FT_Get_Next_Char */
nuclear@0 3122 /* */
nuclear@0 3123 /* <Description> */
nuclear@0 3124 /* This function is used to return the next character code in the */
nuclear@0 3125 /* current charmap of a given face following the value `char_code', */
nuclear@0 3126 /* as well as the corresponding glyph index. */
nuclear@0 3127 /* */
nuclear@0 3128 /* <Input> */
nuclear@0 3129 /* face :: A handle to the source face object. */
nuclear@0 3130 /* char_code :: The starting character code. */
nuclear@0 3131 /* */
nuclear@0 3132 /* <Output> */
nuclear@0 3133 /* agindex :: Glyph index of next character code. 0~if charmap */
nuclear@0 3134 /* is empty. */
nuclear@0 3135 /* */
nuclear@0 3136 /* <Return> */
nuclear@0 3137 /* The charmap's next character code. */
nuclear@0 3138 /* */
nuclear@0 3139 /* <Note> */
nuclear@0 3140 /* You should use this function with @FT_Get_First_Char to walk */
nuclear@0 3141 /* over all character codes available in a given charmap. See the */
nuclear@0 3142 /* note for this function for a simple code example. */
nuclear@0 3143 /* */
nuclear@0 3144 /* Note that `*agindex' is set to~0 when there are no more codes in */
nuclear@0 3145 /* the charmap. */
nuclear@0 3146 /* */
nuclear@0 3147 FT_EXPORT( FT_ULong )
nuclear@0 3148 FT_Get_Next_Char( FT_Face face,
nuclear@0 3149 FT_ULong char_code,
nuclear@0 3150 FT_UInt *agindex );
nuclear@0 3151
nuclear@0 3152
nuclear@0 3153 /*************************************************************************/
nuclear@0 3154 /* */
nuclear@0 3155 /* <Function> */
nuclear@0 3156 /* FT_Get_Name_Index */
nuclear@0 3157 /* */
nuclear@0 3158 /* <Description> */
nuclear@0 3159 /* Return the glyph index of a given glyph name. This function uses */
nuclear@0 3160 /* driver specific objects to do the translation. */
nuclear@0 3161 /* */
nuclear@0 3162 /* <Input> */
nuclear@0 3163 /* face :: A handle to the source face object. */
nuclear@0 3164 /* */
nuclear@0 3165 /* glyph_name :: The glyph name. */
nuclear@0 3166 /* */
nuclear@0 3167 /* <Return> */
nuclear@0 3168 /* The glyph index. 0~means `undefined character code'. */
nuclear@0 3169 /* */
nuclear@0 3170 FT_EXPORT( FT_UInt )
nuclear@0 3171 FT_Get_Name_Index( FT_Face face,
nuclear@0 3172 FT_String* glyph_name );
nuclear@0 3173
nuclear@0 3174
nuclear@0 3175 /*************************************************************************
nuclear@0 3176 *
nuclear@0 3177 * @macro:
nuclear@0 3178 * FT_SUBGLYPH_FLAG_XXX
nuclear@0 3179 *
nuclear@0 3180 * @description:
nuclear@0 3181 * A list of constants used to describe subglyphs. Please refer to the
nuclear@0 3182 * TrueType specification for the meaning of the various flags.
nuclear@0 3183 *
nuclear@0 3184 * @values:
nuclear@0 3185 * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
nuclear@0 3186 * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
nuclear@0 3187 * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
nuclear@0 3188 * FT_SUBGLYPH_FLAG_SCALE ::
nuclear@0 3189 * FT_SUBGLYPH_FLAG_XY_SCALE ::
nuclear@0 3190 * FT_SUBGLYPH_FLAG_2X2 ::
nuclear@0 3191 * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
nuclear@0 3192 *
nuclear@0 3193 */
nuclear@0 3194 #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
nuclear@0 3195 #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
nuclear@0 3196 #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
nuclear@0 3197 #define FT_SUBGLYPH_FLAG_SCALE 8
nuclear@0 3198 #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
nuclear@0 3199 #define FT_SUBGLYPH_FLAG_2X2 0x80
nuclear@0 3200 #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
nuclear@0 3201
nuclear@0 3202
nuclear@0 3203 /*************************************************************************
nuclear@0 3204 *
nuclear@0 3205 * @func:
nuclear@0 3206 * FT_Get_SubGlyph_Info
nuclear@0 3207 *
nuclear@0 3208 * @description:
nuclear@0 3209 * Retrieve a description of a given subglyph. Only use it if
nuclear@0 3210 * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
nuclear@0 3211 * returned otherwise.
nuclear@0 3212 *
nuclear@0 3213 * @input:
nuclear@0 3214 * glyph ::
nuclear@0 3215 * The source glyph slot.
nuclear@0 3216 *
nuclear@0 3217 * sub_index ::
nuclear@0 3218 * The index of the subglyph. Must be less than
nuclear@0 3219 * `glyph->num_subglyphs'.
nuclear@0 3220 *
nuclear@0 3221 * @output:
nuclear@0 3222 * p_index ::
nuclear@0 3223 * The glyph index of the subglyph.
nuclear@0 3224 *
nuclear@0 3225 * p_flags ::
nuclear@0 3226 * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
nuclear@0 3227 *
nuclear@0 3228 * p_arg1 ::
nuclear@0 3229 * The subglyph's first argument (if any).
nuclear@0 3230 *
nuclear@0 3231 * p_arg2 ::
nuclear@0 3232 * The subglyph's second argument (if any).
nuclear@0 3233 *
nuclear@0 3234 * p_transform ::
nuclear@0 3235 * The subglyph transformation (if any).
nuclear@0 3236 *
nuclear@0 3237 * @return:
nuclear@0 3238 * FreeType error code. 0~means success.
nuclear@0 3239 *
nuclear@0 3240 * @note:
nuclear@0 3241 * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
nuclear@0 3242 * interpreted depending on the flags returned in `*p_flags'. See the
nuclear@0 3243 * TrueType specification for details.
nuclear@0 3244 *
nuclear@0 3245 */
nuclear@0 3246 FT_EXPORT( FT_Error )
nuclear@0 3247 FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
nuclear@0 3248 FT_UInt sub_index,
nuclear@0 3249 FT_Int *p_index,
nuclear@0 3250 FT_UInt *p_flags,
nuclear@0 3251 FT_Int *p_arg1,
nuclear@0 3252 FT_Int *p_arg2,
nuclear@0 3253 FT_Matrix *p_transform );
nuclear@0 3254
nuclear@0 3255
nuclear@0 3256 /*************************************************************************/
nuclear@0 3257 /* */
nuclear@0 3258 /* <Enum> */
nuclear@0 3259 /* FT_FSTYPE_XXX */
nuclear@0 3260 /* */
nuclear@0 3261 /* <Description> */
nuclear@0 3262 /* A list of bit flags used in the `fsType' field of the OS/2 table */
nuclear@0 3263 /* in a TrueType or OpenType font and the `FSType' entry in a */
nuclear@0 3264 /* PostScript font. These bit flags are returned by */
nuclear@0 3265 /* @FT_Get_FSType_Flags; they inform client applications of embedding */
nuclear@0 3266 /* and subsetting restrictions associated with a font. */
nuclear@0 3267 /* */
nuclear@0 3268 /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
nuclear@0 3269 /* more details. */
nuclear@0 3270 /* */
nuclear@0 3271 /* <Values> */
nuclear@0 3272 /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
nuclear@0 3273 /* Fonts with no fsType bit set may be embedded and permanently */
nuclear@0 3274 /* installed on the remote system by an application. */
nuclear@0 3275 /* */
nuclear@0 3276 /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
nuclear@0 3277 /* Fonts that have only this bit set must not be modified, embedded */
nuclear@0 3278 /* or exchanged in any manner without first obtaining permission of */
nuclear@0 3279 /* the font software copyright owner. */
nuclear@0 3280 /* */
nuclear@0 3281 /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
nuclear@0 3282 /* If this bit is set, the font may be embedded and temporarily */
nuclear@0 3283 /* loaded on the remote system. Documents containing Preview & */
nuclear@0 3284 /* Print fonts must be opened `read-only'; no edits can be applied */
nuclear@0 3285 /* to the document. */
nuclear@0 3286 /* */
nuclear@0 3287 /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
nuclear@0 3288 /* If this bit is set, the font may be embedded but must only be */
nuclear@0 3289 /* installed temporarily on other systems. In contrast to Preview */
nuclear@0 3290 /* & Print fonts, documents containing editable fonts may be opened */
nuclear@0 3291 /* for reading, editing is permitted, and changes may be saved. */
nuclear@0 3292 /* */
nuclear@0 3293 /* FT_FSTYPE_NO_SUBSETTING :: */
nuclear@0 3294 /* If this bit is set, the font may not be subsetted prior to */
nuclear@0 3295 /* embedding. */
nuclear@0 3296 /* */
nuclear@0 3297 /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
nuclear@0 3298 /* If this bit is set, only bitmaps contained in the font may be */
nuclear@0 3299 /* embedded; no outline data may be embedded. If there are no */
nuclear@0 3300 /* bitmaps available in the font, then the font is unembeddable. */
nuclear@0 3301 /* */
nuclear@0 3302 /* <Note> */
nuclear@0 3303 /* While the fsType flags can indicate that a font may be embedded, a */
nuclear@0 3304 /* license with the font vendor may be separately required to use the */
nuclear@0 3305 /* font in this way. */
nuclear@0 3306 /* */
nuclear@0 3307 #define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
nuclear@0 3308 #define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
nuclear@0 3309 #define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
nuclear@0 3310 #define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
nuclear@0 3311 #define FT_FSTYPE_NO_SUBSETTING 0x0100
nuclear@0 3312 #define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
nuclear@0 3313
nuclear@0 3314
nuclear@0 3315 /*************************************************************************/
nuclear@0 3316 /* */
nuclear@0 3317 /* <Function> */
nuclear@0 3318 /* FT_Get_FSType_Flags */
nuclear@0 3319 /* */
nuclear@0 3320 /* <Description> */
nuclear@0 3321 /* Return the fsType flags for a font. */
nuclear@0 3322 /* */
nuclear@0 3323 /* <Input> */
nuclear@0 3324 /* face :: A handle to the source face object. */
nuclear@0 3325 /* */
nuclear@0 3326 /* <Return> */
nuclear@0 3327 /* The fsType flags, @FT_FSTYPE_XXX. */
nuclear@0 3328 /* */
nuclear@0 3329 /* <Note> */
nuclear@0 3330 /* Use this function rather than directly reading the `fs_type' field */
nuclear@0 3331 /* in the @PS_FontInfoRec structure which is only guaranteed to */
nuclear@0 3332 /* return the correct results for Type~1 fonts. */
nuclear@0 3333 /* */
nuclear@0 3334 FT_EXPORT( FT_UShort )
nuclear@0 3335 FT_Get_FSType_Flags( FT_Face face );
nuclear@0 3336
nuclear@0 3337
nuclear@0 3338 /*************************************************************************/
nuclear@0 3339 /* */
nuclear@0 3340 /* <Section> */
nuclear@0 3341 /* glyph_variants */
nuclear@0 3342 /* */
nuclear@0 3343 /* <Title> */
nuclear@0 3344 /* Glyph Variants */
nuclear@0 3345 /* */
nuclear@0 3346 /* <Abstract> */
nuclear@0 3347 /* The FreeType~2 interface to Unicode Ideographic Variation */
nuclear@0 3348 /* Sequences (IVS), using the SFNT cmap format~14. */
nuclear@0 3349 /* */
nuclear@0 3350 /* <Description> */
nuclear@0 3351 /* Many CJK characters have variant forms. They are a sort of grey */
nuclear@0 3352 /* area somewhere between being totally irrelevant and semantically */
nuclear@0 3353 /* distinct; for this reason, the Unicode consortium decided to */
nuclear@0 3354 /* introduce Ideographic Variation Sequences (IVS), consisting of a */
nuclear@0 3355 /* Unicode base character and one of 240 variant selectors */
nuclear@0 3356 /* (U+E0100-U+E01EF), instead of further extending the already huge */
nuclear@0 3357 /* code range for CJK characters. */
nuclear@0 3358 /* */
nuclear@0 3359 /* An IVS is registered and unique; for further details please refer */
nuclear@0 3360 /* to Unicode Technical Report #37, the Ideographic Variation */
nuclear@0 3361 /* Database. To date (October 2007), the character with the most */
nuclear@0 3362 /* variants is U+908A, having 8~such IVS. */
nuclear@0 3363 /* */
nuclear@0 3364 /* Adobe and MS decided to support IVS with a new cmap subtable */
nuclear@0 3365 /* (format~14). It is an odd subtable because it is not a mapping of */
nuclear@0 3366 /* input code points to glyphs, but contains lists of all variants */
nuclear@0 3367 /* supported by the font. */
nuclear@0 3368 /* */
nuclear@0 3369 /* A variant may be either `default' or `non-default'. A default */
nuclear@0 3370 /* variant is the one you will get for that code point if you look it */
nuclear@0 3371 /* up in the standard Unicode cmap. A non-default variant is a */
nuclear@0 3372 /* different glyph. */
nuclear@0 3373 /* */
nuclear@0 3374 /*************************************************************************/
nuclear@0 3375
nuclear@0 3376
nuclear@0 3377 /*************************************************************************/
nuclear@0 3378 /* */
nuclear@0 3379 /* <Function> */
nuclear@0 3380 /* FT_Face_GetCharVariantIndex */
nuclear@0 3381 /* */
nuclear@0 3382 /* <Description> */
nuclear@0 3383 /* Return the glyph index of a given character code as modified by */
nuclear@0 3384 /* the variation selector. */
nuclear@0 3385 /* */
nuclear@0 3386 /* <Input> */
nuclear@0 3387 /* face :: */
nuclear@0 3388 /* A handle to the source face object. */
nuclear@0 3389 /* */
nuclear@0 3390 /* charcode :: */
nuclear@0 3391 /* The character code point in Unicode. */
nuclear@0 3392 /* */
nuclear@0 3393 /* variantSelector :: */
nuclear@0 3394 /* The Unicode code point of the variation selector. */
nuclear@0 3395 /* */
nuclear@0 3396 /* <Return> */
nuclear@0 3397 /* The glyph index. 0~means either `undefined character code', or */
nuclear@0 3398 /* `undefined selector code', or `no variation selector cmap */
nuclear@0 3399 /* subtable', or `current CharMap is not Unicode'. */
nuclear@0 3400 /* */
nuclear@0 3401 /* <Note> */
nuclear@0 3402 /* If you use FreeType to manipulate the contents of font files */
nuclear@0 3403 /* directly, be aware that the glyph index returned by this function */
nuclear@0 3404 /* doesn't always correspond to the internal indices used within */
nuclear@0 3405 /* the file. This is done to ensure that value~0 always corresponds */
nuclear@0 3406 /* to the `missing glyph'. */
nuclear@0 3407 /* */
nuclear@0 3408 /* This function is only meaningful if */
nuclear@0 3409 /* a) the font has a variation selector cmap sub table, */
nuclear@0 3410 /* and */
nuclear@0 3411 /* b) the current charmap has a Unicode encoding. */
nuclear@0 3412 /* */
nuclear@0 3413 /* <Since> */
nuclear@0 3414 /* 2.3.6 */
nuclear@0 3415 /* */
nuclear@0 3416 FT_EXPORT( FT_UInt )
nuclear@0 3417 FT_Face_GetCharVariantIndex( FT_Face face,
nuclear@0 3418 FT_ULong charcode,
nuclear@0 3419 FT_ULong variantSelector );
nuclear@0 3420
nuclear@0 3421
nuclear@0 3422 /*************************************************************************/
nuclear@0 3423 /* */
nuclear@0 3424 /* <Function> */
nuclear@0 3425 /* FT_Face_GetCharVariantIsDefault */
nuclear@0 3426 /* */
nuclear@0 3427 /* <Description> */
nuclear@0 3428 /* Check whether this variant of this Unicode character is the one to */
nuclear@0 3429 /* be found in the `cmap'. */
nuclear@0 3430 /* */
nuclear@0 3431 /* <Input> */
nuclear@0 3432 /* face :: */
nuclear@0 3433 /* A handle to the source face object. */
nuclear@0 3434 /* */
nuclear@0 3435 /* charcode :: */
nuclear@0 3436 /* The character codepoint in Unicode. */
nuclear@0 3437 /* */
nuclear@0 3438 /* variantSelector :: */
nuclear@0 3439 /* The Unicode codepoint of the variation selector. */
nuclear@0 3440 /* */
nuclear@0 3441 /* <Return> */
nuclear@0 3442 /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
nuclear@0 3443 /* variation selector cmap, or -1 if it is not a variant. */
nuclear@0 3444 /* */
nuclear@0 3445 /* <Note> */
nuclear@0 3446 /* This function is only meaningful if the font has a variation */
nuclear@0 3447 /* selector cmap subtable. */
nuclear@0 3448 /* */
nuclear@0 3449 /* <Since> */
nuclear@0 3450 /* 2.3.6 */
nuclear@0 3451 /* */
nuclear@0 3452 FT_EXPORT( FT_Int )
nuclear@0 3453 FT_Face_GetCharVariantIsDefault( FT_Face face,
nuclear@0 3454 FT_ULong charcode,
nuclear@0 3455 FT_ULong variantSelector );
nuclear@0 3456
nuclear@0 3457
nuclear@0 3458 /*************************************************************************/
nuclear@0 3459 /* */
nuclear@0 3460 /* <Function> */
nuclear@0 3461 /* FT_Face_GetVariantSelectors */
nuclear@0 3462 /* */
nuclear@0 3463 /* <Description> */
nuclear@0 3464 /* Return a zero-terminated list of Unicode variant selectors found */
nuclear@0 3465 /* in the font. */
nuclear@0 3466 /* */
nuclear@0 3467 /* <Input> */
nuclear@0 3468 /* face :: */
nuclear@0 3469 /* A handle to the source face object. */
nuclear@0 3470 /* */
nuclear@0 3471 /* <Return> */
nuclear@0 3472 /* A pointer to an array of selector code points, or NULL if there is */
nuclear@0 3473 /* no valid variant selector cmap subtable. */
nuclear@0 3474 /* */
nuclear@0 3475 /* <Note> */
nuclear@0 3476 /* The last item in the array is~0; the array is owned by the */
nuclear@0 3477 /* @FT_Face object but can be overwritten or released on the next */
nuclear@0 3478 /* call to a FreeType function. */
nuclear@0 3479 /* */
nuclear@0 3480 /* <Since> */
nuclear@0 3481 /* 2.3.6 */
nuclear@0 3482 /* */
nuclear@0 3483 FT_EXPORT( FT_UInt32* )
nuclear@0 3484 FT_Face_GetVariantSelectors( FT_Face face );
nuclear@0 3485
nuclear@0 3486
nuclear@0 3487 /*************************************************************************/
nuclear@0 3488 /* */
nuclear@0 3489 /* <Function> */
nuclear@0 3490 /* FT_Face_GetVariantsOfChar */
nuclear@0 3491 /* */
nuclear@0 3492 /* <Description> */
nuclear@0 3493 /* Return a zero-terminated list of Unicode variant selectors found */
nuclear@0 3494 /* for the specified character code. */
nuclear@0 3495 /* */
nuclear@0 3496 /* <Input> */
nuclear@0 3497 /* face :: */
nuclear@0 3498 /* A handle to the source face object. */
nuclear@0 3499 /* */
nuclear@0 3500 /* charcode :: */
nuclear@0 3501 /* The character codepoint in Unicode. */
nuclear@0 3502 /* */
nuclear@0 3503 /* <Return> */
nuclear@0 3504 /* A pointer to an array of variant selector code points which are */
nuclear@0 3505 /* active for the given character, or NULL if the corresponding list */
nuclear@0 3506 /* is empty. */
nuclear@0 3507 /* */
nuclear@0 3508 /* <Note> */
nuclear@0 3509 /* The last item in the array is~0; the array is owned by the */
nuclear@0 3510 /* @FT_Face object but can be overwritten or released on the next */
nuclear@0 3511 /* call to a FreeType function. */
nuclear@0 3512 /* */
nuclear@0 3513 /* <Since> */
nuclear@0 3514 /* 2.3.6 */
nuclear@0 3515 /* */
nuclear@0 3516 FT_EXPORT( FT_UInt32* )
nuclear@0 3517 FT_Face_GetVariantsOfChar( FT_Face face,
nuclear@0 3518 FT_ULong charcode );
nuclear@0 3519
nuclear@0 3520
nuclear@0 3521 /*************************************************************************/
nuclear@0 3522 /* */
nuclear@0 3523 /* <Function> */
nuclear@0 3524 /* FT_Face_GetCharsOfVariant */
nuclear@0 3525 /* */
nuclear@0 3526 /* <Description> */
nuclear@0 3527 /* Return a zero-terminated list of Unicode character codes found for */
nuclear@0 3528 /* the specified variant selector. */
nuclear@0 3529 /* */
nuclear@0 3530 /* <Input> */
nuclear@0 3531 /* face :: */
nuclear@0 3532 /* A handle to the source face object. */
nuclear@0 3533 /* */
nuclear@0 3534 /* variantSelector :: */
nuclear@0 3535 /* The variant selector code point in Unicode. */
nuclear@0 3536 /* */
nuclear@0 3537 /* <Return> */
nuclear@0 3538 /* A list of all the code points which are specified by this selector */
nuclear@0 3539 /* (both default and non-default codes are returned) or NULL if there */
nuclear@0 3540 /* is no valid cmap or the variant selector is invalid. */
nuclear@0 3541 /* */
nuclear@0 3542 /* <Note> */
nuclear@0 3543 /* The last item in the array is~0; the array is owned by the */
nuclear@0 3544 /* @FT_Face object but can be overwritten or released on the next */
nuclear@0 3545 /* call to a FreeType function. */
nuclear@0 3546 /* */
nuclear@0 3547 /* <Since> */
nuclear@0 3548 /* 2.3.6 */
nuclear@0 3549 /* */
nuclear@0 3550 FT_EXPORT( FT_UInt32* )
nuclear@0 3551 FT_Face_GetCharsOfVariant( FT_Face face,
nuclear@0 3552 FT_ULong variantSelector );
nuclear@0 3553
nuclear@0 3554
nuclear@0 3555 /*************************************************************************/
nuclear@0 3556 /* */
nuclear@0 3557 /* <Section> */
nuclear@0 3558 /* computations */
nuclear@0 3559 /* */
nuclear@0 3560 /* <Title> */
nuclear@0 3561 /* Computations */
nuclear@0 3562 /* */
nuclear@0 3563 /* <Abstract> */
nuclear@0 3564 /* Crunching fixed numbers and vectors. */
nuclear@0 3565 /* */
nuclear@0 3566 /* <Description> */
nuclear@0 3567 /* This section contains various functions used to perform */
nuclear@0 3568 /* computations on 16.16 fixed-float numbers or 2d vectors. */
nuclear@0 3569 /* */
nuclear@0 3570 /* <Order> */
nuclear@0 3571 /* FT_MulDiv */
nuclear@0 3572 /* FT_MulFix */
nuclear@0 3573 /* FT_DivFix */
nuclear@0 3574 /* FT_RoundFix */
nuclear@0 3575 /* FT_CeilFix */
nuclear@0 3576 /* FT_FloorFix */
nuclear@0 3577 /* FT_Vector_Transform */
nuclear@0 3578 /* FT_Matrix_Multiply */
nuclear@0 3579 /* FT_Matrix_Invert */
nuclear@0 3580 /* */
nuclear@0 3581 /*************************************************************************/
nuclear@0 3582
nuclear@0 3583
nuclear@0 3584 /*************************************************************************/
nuclear@0 3585 /* */
nuclear@0 3586 /* <Function> */
nuclear@0 3587 /* FT_MulDiv */
nuclear@0 3588 /* */
nuclear@0 3589 /* <Description> */
nuclear@0 3590 /* A very simple function used to perform the computation `(a*b)/c' */
nuclear@0 3591 /* with maximal accuracy (it uses a 64-bit intermediate integer */
nuclear@0 3592 /* whenever necessary). */
nuclear@0 3593 /* */
nuclear@0 3594 /* This function isn't necessarily as fast as some processor specific */
nuclear@0 3595 /* operations, but is at least completely portable. */
nuclear@0 3596 /* */
nuclear@0 3597 /* <Input> */
nuclear@0 3598 /* a :: The first multiplier. */
nuclear@0 3599 /* b :: The second multiplier. */
nuclear@0 3600 /* c :: The divisor. */
nuclear@0 3601 /* */
nuclear@0 3602 /* <Return> */
nuclear@0 3603 /* The result of `(a*b)/c'. This function never traps when trying to */
nuclear@0 3604 /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
nuclear@0 3605 /* on the signs of `a' and `b'. */
nuclear@0 3606 /* */
nuclear@0 3607 FT_EXPORT( FT_Long )
nuclear@0 3608 FT_MulDiv( FT_Long a,
nuclear@0 3609 FT_Long b,
nuclear@0 3610 FT_Long c );
nuclear@0 3611
nuclear@0 3612
nuclear@0 3613 /* */
nuclear@0 3614
nuclear@0 3615 /* The following #if 0 ... #endif is for the documentation formatter, */
nuclear@0 3616 /* hiding the internal `FT_MULFIX_INLINED' macro. */
nuclear@0 3617
nuclear@0 3618 #if 0
nuclear@0 3619 /*************************************************************************/
nuclear@0 3620 /* */
nuclear@0 3621 /* <Function> */
nuclear@0 3622 /* FT_MulFix */
nuclear@0 3623 /* */
nuclear@0 3624 /* <Description> */
nuclear@0 3625 /* A very simple function used to perform the computation */
nuclear@0 3626 /* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
nuclear@0 3627 /* used to multiply a given value by a 16.16 fixed float factor. */
nuclear@0 3628 /* */
nuclear@0 3629 /* <Input> */
nuclear@0 3630 /* a :: The first multiplier. */
nuclear@0 3631 /* b :: The second multiplier. Use a 16.16 factor here whenever */
nuclear@0 3632 /* possible (see note below). */
nuclear@0 3633 /* */
nuclear@0 3634 /* <Return> */
nuclear@0 3635 /* The result of `(a*b)/0x10000'. */
nuclear@0 3636 /* */
nuclear@0 3637 /* <Note> */
nuclear@0 3638 /* This function has been optimized for the case where the absolute */
nuclear@0 3639 /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
nuclear@0 3640 /* As this happens mainly when scaling from notional units to */
nuclear@0 3641 /* fractional pixels in FreeType, it resulted in noticeable speed */
nuclear@0 3642 /* improvements between versions 2.x and 1.x. */
nuclear@0 3643 /* */
nuclear@0 3644 /* As a conclusion, always try to place a 16.16 factor as the */
nuclear@0 3645 /* _second_ argument of this function; this can make a great */
nuclear@0 3646 /* difference. */
nuclear@0 3647 /* */
nuclear@0 3648 FT_EXPORT( FT_Long )
nuclear@0 3649 FT_MulFix( FT_Long a,
nuclear@0 3650 FT_Long b );
nuclear@0 3651
nuclear@0 3652 /* */
nuclear@0 3653 #endif
nuclear@0 3654
nuclear@0 3655 #ifdef FT_MULFIX_INLINED
nuclear@0 3656 #define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
nuclear@0 3657 #else
nuclear@0 3658 FT_EXPORT( FT_Long )
nuclear@0 3659 FT_MulFix( FT_Long a,
nuclear@0 3660 FT_Long b );
nuclear@0 3661 #endif
nuclear@0 3662
nuclear@0 3663
nuclear@0 3664 /*************************************************************************/
nuclear@0 3665 /* */
nuclear@0 3666 /* <Function> */
nuclear@0 3667 /* FT_DivFix */
nuclear@0 3668 /* */
nuclear@0 3669 /* <Description> */
nuclear@0 3670 /* A very simple function used to perform the computation */
nuclear@0 3671 /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
nuclear@0 3672 /* used to divide a given value by a 16.16 fixed float factor. */
nuclear@0 3673 /* */
nuclear@0 3674 /* <Input> */
nuclear@0 3675 /* a :: The first multiplier. */
nuclear@0 3676 /* b :: The second multiplier. Use a 16.16 factor here whenever */
nuclear@0 3677 /* possible (see note below). */
nuclear@0 3678 /* */
nuclear@0 3679 /* <Return> */
nuclear@0 3680 /* The result of `(a*0x10000)/b'. */
nuclear@0 3681 /* */
nuclear@0 3682 /* <Note> */
nuclear@0 3683 /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
nuclear@0 3684 /* 32~bits, then the division is computed directly. Otherwise, we */
nuclear@0 3685 /* use a specialized version of @FT_MulDiv. */
nuclear@0 3686 /* */
nuclear@0 3687 FT_EXPORT( FT_Long )
nuclear@0 3688 FT_DivFix( FT_Long a,
nuclear@0 3689 FT_Long b );
nuclear@0 3690
nuclear@0 3691
nuclear@0 3692 /*************************************************************************/
nuclear@0 3693 /* */
nuclear@0 3694 /* <Function> */
nuclear@0 3695 /* FT_RoundFix */
nuclear@0 3696 /* */
nuclear@0 3697 /* <Description> */
nuclear@0 3698 /* A very simple function used to round a 16.16 fixed number. */
nuclear@0 3699 /* */
nuclear@0 3700 /* <Input> */
nuclear@0 3701 /* a :: The number to be rounded. */
nuclear@0 3702 /* */
nuclear@0 3703 /* <Return> */
nuclear@0 3704 /* The result of `(a + 0x8000) & -0x10000'. */
nuclear@0 3705 /* */
nuclear@0 3706 FT_EXPORT( FT_Fixed )
nuclear@0 3707 FT_RoundFix( FT_Fixed a );
nuclear@0 3708
nuclear@0 3709
nuclear@0 3710 /*************************************************************************/
nuclear@0 3711 /* */
nuclear@0 3712 /* <Function> */
nuclear@0 3713 /* FT_CeilFix */
nuclear@0 3714 /* */
nuclear@0 3715 /* <Description> */
nuclear@0 3716 /* A very simple function used to compute the ceiling function of a */
nuclear@0 3717 /* 16.16 fixed number. */
nuclear@0 3718 /* */
nuclear@0 3719 /* <Input> */
nuclear@0 3720 /* a :: The number for which the ceiling function is to be computed. */
nuclear@0 3721 /* */
nuclear@0 3722 /* <Return> */
nuclear@0 3723 /* The result of `(a + 0x10000 - 1) & -0x10000'. */
nuclear@0 3724 /* */
nuclear@0 3725 FT_EXPORT( FT_Fixed )
nuclear@0 3726 FT_CeilFix( FT_Fixed a );
nuclear@0 3727
nuclear@0 3728
nuclear@0 3729 /*************************************************************************/
nuclear@0 3730 /* */
nuclear@0 3731 /* <Function> */
nuclear@0 3732 /* FT_FloorFix */
nuclear@0 3733 /* */
nuclear@0 3734 /* <Description> */
nuclear@0 3735 /* A very simple function used to compute the floor function of a */
nuclear@0 3736 /* 16.16 fixed number. */
nuclear@0 3737 /* */
nuclear@0 3738 /* <Input> */
nuclear@0 3739 /* a :: The number for which the floor function is to be computed. */
nuclear@0 3740 /* */
nuclear@0 3741 /* <Return> */
nuclear@0 3742 /* The result of `a & -0x10000'. */
nuclear@0 3743 /* */
nuclear@0 3744 FT_EXPORT( FT_Fixed )
nuclear@0 3745 FT_FloorFix( FT_Fixed a );
nuclear@0 3746
nuclear@0 3747
nuclear@0 3748 /*************************************************************************/
nuclear@0 3749 /* */
nuclear@0 3750 /* <Function> */
nuclear@0 3751 /* FT_Vector_Transform */
nuclear@0 3752 /* */
nuclear@0 3753 /* <Description> */
nuclear@0 3754 /* Transform a single vector through a 2x2 matrix. */
nuclear@0 3755 /* */
nuclear@0 3756 /* <InOut> */
nuclear@0 3757 /* vector :: The target vector to transform. */
nuclear@0 3758 /* */
nuclear@0 3759 /* <Input> */
nuclear@0 3760 /* matrix :: A pointer to the source 2x2 matrix. */
nuclear@0 3761 /* */
nuclear@0 3762 /* <Note> */
nuclear@0 3763 /* The result is undefined if either `vector' or `matrix' is invalid. */
nuclear@0 3764 /* */
nuclear@0 3765 FT_EXPORT( void )
nuclear@0 3766 FT_Vector_Transform( FT_Vector* vec,
nuclear@0 3767 const FT_Matrix* matrix );
nuclear@0 3768
nuclear@0 3769
nuclear@0 3770 /*************************************************************************/
nuclear@0 3771 /* */
nuclear@0 3772 /* <Section> */
nuclear@0 3773 /* version */
nuclear@0 3774 /* */
nuclear@0 3775 /* <Title> */
nuclear@0 3776 /* FreeType Version */
nuclear@0 3777 /* */
nuclear@0 3778 /* <Abstract> */
nuclear@0 3779 /* Functions and macros related to FreeType versions. */
nuclear@0 3780 /* */
nuclear@0 3781 /* <Description> */
nuclear@0 3782 /* Note that those functions and macros are of limited use because */
nuclear@0 3783 /* even a new release of FreeType with only documentation changes */
nuclear@0 3784 /* increases the version number. */
nuclear@0 3785 /* */
nuclear@0 3786 /*************************************************************************/
nuclear@0 3787
nuclear@0 3788
nuclear@0 3789 /*************************************************************************
nuclear@0 3790 *
nuclear@0 3791 * @enum:
nuclear@0 3792 * FREETYPE_XXX
nuclear@0 3793 *
nuclear@0 3794 * @description:
nuclear@0 3795 * These three macros identify the FreeType source code version.
nuclear@0 3796 * Use @FT_Library_Version to access them at runtime.
nuclear@0 3797 *
nuclear@0 3798 * @values:
nuclear@0 3799 * FREETYPE_MAJOR :: The major version number.
nuclear@0 3800 * FREETYPE_MINOR :: The minor version number.
nuclear@0 3801 * FREETYPE_PATCH :: The patch level.
nuclear@0 3802 *
nuclear@0 3803 * @note:
nuclear@0 3804 * The version number of FreeType if built as a dynamic link library
nuclear@0 3805 * with the `libtool' package is _not_ controlled by these three
nuclear@0 3806 * macros.
nuclear@0 3807 *
nuclear@0 3808 */
nuclear@0 3809 #define FREETYPE_MAJOR 2
nuclear@0 3810 #define FREETYPE_MINOR 4
nuclear@0 3811 #define FREETYPE_PATCH 4
nuclear@0 3812
nuclear@0 3813
nuclear@0 3814 /*************************************************************************/
nuclear@0 3815 /* */
nuclear@0 3816 /* <Function> */
nuclear@0 3817 /* FT_Library_Version */
nuclear@0 3818 /* */
nuclear@0 3819 /* <Description> */
nuclear@0 3820 /* Return the version of the FreeType library being used. This is */
nuclear@0 3821 /* useful when dynamically linking to the library, since one cannot */
nuclear@0 3822 /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
nuclear@0 3823 /* @FREETYPE_PATCH. */
nuclear@0 3824 /* */
nuclear@0 3825 /* <Input> */
nuclear@0 3826 /* library :: A source library handle. */
nuclear@0 3827 /* */
nuclear@0 3828 /* <Output> */
nuclear@0 3829 /* amajor :: The major version number. */
nuclear@0 3830 /* */
nuclear@0 3831 /* aminor :: The minor version number. */
nuclear@0 3832 /* */
nuclear@0 3833 /* apatch :: The patch version number. */
nuclear@0 3834 /* */
nuclear@0 3835 /* <Note> */
nuclear@0 3836 /* The reason why this function takes a `library' argument is because */
nuclear@0 3837 /* certain programs implement library initialization in a custom way */
nuclear@0 3838 /* that doesn't use @FT_Init_FreeType. */
nuclear@0 3839 /* */
nuclear@0 3840 /* In such cases, the library version might not be available before */
nuclear@0 3841 /* the library object has been created. */
nuclear@0 3842 /* */
nuclear@0 3843 FT_EXPORT( void )
nuclear@0 3844 FT_Library_Version( FT_Library library,
nuclear@0 3845 FT_Int *amajor,
nuclear@0 3846 FT_Int *aminor,
nuclear@0 3847 FT_Int *apatch );
nuclear@0 3848
nuclear@0 3849
nuclear@0 3850 /*************************************************************************/
nuclear@0 3851 /* */
nuclear@0 3852 /* <Function> */
nuclear@0 3853 /* FT_Face_CheckTrueTypePatents */
nuclear@0 3854 /* */
nuclear@0 3855 /* <Description> */
nuclear@0 3856 /* Parse all bytecode instructions of a TrueType font file to check */
nuclear@0 3857 /* whether any of the patented opcodes are used. This is only useful */
nuclear@0 3858 /* if you want to be able to use the unpatented hinter with */
nuclear@0 3859 /* fonts that do *not* use these opcodes. */
nuclear@0 3860 /* */
nuclear@0 3861 /* Note that this function parses *all* glyph instructions in the */
nuclear@0 3862 /* font file, which may be slow. */
nuclear@0 3863 /* */
nuclear@0 3864 /* <Input> */
nuclear@0 3865 /* face :: A face handle. */
nuclear@0 3866 /* */
nuclear@0 3867 /* <Return> */
nuclear@0 3868 /* 1~if this is a TrueType font that uses one of the patented */
nuclear@0 3869 /* opcodes, 0~otherwise. */
nuclear@0 3870 /* */
nuclear@0 3871 /* <Note> */
nuclear@0 3872 /* Since May 2010, TrueType hinting is no longer patented. */
nuclear@0 3873 /* */
nuclear@0 3874 /* <Since> */
nuclear@0 3875 /* 2.3.5 */
nuclear@0 3876 /* */
nuclear@0 3877 FT_EXPORT( FT_Bool )
nuclear@0 3878 FT_Face_CheckTrueTypePatents( FT_Face face );
nuclear@0 3879
nuclear@0 3880
nuclear@0 3881 /*************************************************************************/
nuclear@0 3882 /* */
nuclear@0 3883 /* <Function> */
nuclear@0 3884 /* FT_Face_SetUnpatentedHinting */
nuclear@0 3885 /* */
nuclear@0 3886 /* <Description> */
nuclear@0 3887 /* Enable or disable the unpatented hinter for a given face. */
nuclear@0 3888 /* Only enable it if you have determined that the face doesn't */
nuclear@0 3889 /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
nuclear@0 3890 /* */
nuclear@0 3891 /* <Input> */
nuclear@0 3892 /* face :: A face handle. */
nuclear@0 3893 /* */
nuclear@0 3894 /* value :: New boolean setting. */
nuclear@0 3895 /* */
nuclear@0 3896 /* <Return> */
nuclear@0 3897 /* The old setting value. This will always be false if this is not */
nuclear@0 3898 /* an SFNT font, or if the unpatented hinter is not compiled in this */
nuclear@0 3899 /* instance of the library. */
nuclear@0 3900 /* */
nuclear@0 3901 /* <Note> */
nuclear@0 3902 /* Since May 2010, TrueType hinting is no longer patented. */
nuclear@0 3903 /* */
nuclear@0 3904 /* <Since> */
nuclear@0 3905 /* 2.3.5 */
nuclear@0 3906 /* */
nuclear@0 3907 FT_EXPORT( FT_Bool )
nuclear@0 3908 FT_Face_SetUnpatentedHinting( FT_Face face,
nuclear@0 3909 FT_Bool value );
nuclear@0 3910
nuclear@0 3911 /* */
nuclear@0 3912
nuclear@0 3913
nuclear@0 3914 FT_END_HEADER
nuclear@0 3915
nuclear@0 3916 #endif /* __FREETYPE_H__ */
nuclear@0 3917
nuclear@0 3918
nuclear@0 3919 /* END */