1 /***************************************************************************/ 2 /* */ 3 /* ftobjs.h */ 4 /* */ 5 /* The FreeType private base classes (specification). */ 6 /* */ 7 /* Copyright 1996-2001, 2002 by */ 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 /* */ 10 /* This file is part of the FreeType project, and may only be used, */ 11 /* modified, and distributed under the terms of the FreeType project */ 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 /* this file you indicate that you have read the license and */ 14 /* understand and accept it fully. */ 15 /* */ 16 /***************************************************************************/ 17 18 19 /*************************************************************************/ 20 /* */ 21 /* This file contains the definition of all internal FreeType classes. */ 22 /* */ 23 /*************************************************************************/ 24 25 26 #ifndef __FTOBJS_H__ 27 #define __FTOBJS_H__ 28 29 #include <ft2build.h> 30 #include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */ 31 #include FT_RENDER_H 32 #include FT_SIZES_H 33 #include FT_INTERNAL_MEMORY_H 34 #include FT_INTERNAL_GLYPH_LOADER_H 35 #include FT_INTERNAL_DRIVER_H 36 #include FT_INTERNAL_AUTOHINT_H 37 #include FT_INTERNAL_OBJECT_H 38 39 #ifdef FT_CONFIG_OPTION_INCREMENTAL 40 #include FT_INCREMENTAL_H 41 #endif 42 43 44 FT_BEGIN_HEADER 45 46 47 /*************************************************************************/ 48 /* */ 49 /* Some generic definitions. */ 50 /* */ 51 #ifndef TRUE 52 #define TRUE 1 53 #endif 54 55 #ifndef FALSE 56 #define FALSE 0 57 #endif 58 59 #ifndef NULL 60 #define NULL (void*)0 61 #endif 62 63 64 /*************************************************************************/ 65 /* */ 66 /* The min and max functions missing in C. As usual, be careful not to */ 67 /* write things like MIN( a++, b++ ) to avoid side effects. */ 68 /* */ 69 #ifndef MIN 70 #define MIN( a, b ) ( (a) < (b) ? (a) : (b) ) 71 #endif 72 73 #ifndef MAX 74 #define MAX( a, b ) ( (a) > (b) ? (a) : (b) ) 75 #endif 76 77 #ifndef ABS 78 #define ABS( a ) ( (a) < 0 ? -(a) : (a) ) 79 #endif 80 81 82 /*************************************************************************/ 83 /*************************************************************************/ 84 /*************************************************************************/ 85 /**** ****/ 86 /**** ****/ 87 /**** V A L I D A T I O N ****/ 88 /**** ****/ 89 /**** ****/ 90 /*************************************************************************/ 91 /*************************************************************************/ 92 /*************************************************************************/ 93 94 /* handle to a validation object */ 95 typedef struct FT_ValidatorRec_* FT_Validator; 96 97 98 /*************************************************************************/ 99 /* */ 100 /* There are three distinct validation levels defined here: */ 101 /* */ 102 /* FT_VALIDATE_DEFAULT :: */ 103 /* A table that passes this validation level can be used reliably by */ 104 /* FreeType. It generally means that all offsets have been checked to */ 105 /* prevent out-of-bound reads, array counts are correct, etc. */ 106 /* */ 107 /* FT_VALIDATE_TIGHT :: */ 108 /* A table that passes this validation level can be used reliably and */ 109 /* doesn't contain invalid data. For example, a charmap table that */ 110 /* returns invalid glyph indices will not pass, even though it can */ 111 /* be used with FreeType in default mode (the library will simply */ 112 /* return an error later when trying to load the glyph). */ 113 /* */ 114 /* It also check that fields that must be a multiple of 2, 4, or 8 */ 115 /* dont' have incorrect values, etc. */ 116 /* */ 117 /* FT_VALIDATE_PARANOID :: */ 118 /* Only for font debugging. Checks that a table follows the */ 119 /* specification by 100%. Very few fonts will be able to pass this */ 120 /* level anyway but it can be useful for certain tools like font */ 121 /* editors/converters. */ 122 /* */ 123 typedef enum FT_ValidationLevel_ 124 { 125 FT_VALIDATE_DEFAULT = 0, 126 FT_VALIDATE_TIGHT, 127 FT_VALIDATE_PARANOID 128 129 } FT_ValidationLevel; 130 131 132 /* validator structure */ 133 typedef struct FT_ValidatorRec_ 134 { 135 const FT_Byte* base; /* address of table in memory */ 136 const FT_Byte* limit; /* `base' + sizeof(table) in memory */ 137 FT_ValidationLevel level; /* validation level */ 138 FT_Error error; /* error returned. 0 means success */ 139 140 ft_jmp_buf jump_buffer; /* used for exception handling */ 141 142 } FT_ValidatorRec; 143 144 145 #define FT_VALIDATOR( x ) ((FT_Validator)( x )) 146 147 148 FT_BASE( void ) 149 ft_validator_init( FT_Validator valid, 150 const FT_Byte* base, 151 const FT_Byte* limit, 152 FT_ValidationLevel level ); 153 154 FT_BASE( FT_Int ) 155 ft_validator_run( FT_Validator valid ); 156 157 /* Sets the error field in a validator, then calls `longjmp' to return */ 158 /* to high-level caller. Using `setjmp/longjmp' avoids many stupid */ 159 /* error checks within the validation routines. */ 160 /* */ 161 FT_BASE( void ) 162 ft_validator_error( FT_Validator valid, 163 FT_Error error ); 164 165 166 /* Calls ft_validate_error. Assumes that the `valid' local variable */ 167 /* holds a pointer to the current validator object. */ 168 /* */ 169 #define FT_INVALID( _error ) ft_validator_error( valid, _error ) 170 171 /* called when a broken table is detected */ 172 #define FT_INVALID_TOO_SHORT FT_INVALID( FT_Err_Invalid_Table ) 173 174 /* called when an invalid offset is detected */ 175 #define FT_INVALID_OFFSET FT_INVALID( FT_Err_Invalid_Offset ) 176 177 /* called when an invalid format/value is detected */ 178 #define FT_INVALID_FORMAT FT_INVALID( FT_Err_Invalid_Table ) 179 180 /* called when an invalid glyph index is detected */ 181 #define FT_INVALID_GLYPH_ID FT_INVALID( FT_Err_Invalid_Glyph_Index ) 182 183 /* called when an invalid field value is detected */ 184 #define FT_INVALID_DATA FT_INVALID( FT_Err_Invalid_Table ) 185 186 187 /*************************************************************************/ 188 /*************************************************************************/ 189 /*************************************************************************/ 190 /**** ****/ 191 /**** ****/ 192 /**** C H A R M A P S ****/ 193 /**** ****/ 194 /**** ****/ 195 /*************************************************************************/ 196 /*************************************************************************/ 197 /*************************************************************************/ 198 199 /* handle to internal charmap object */ 200 typedef struct FT_CMapRec_* FT_CMap; 201 202 /* handle to charmap class structure */ 203 typedef const struct FT_CMap_ClassRec_* FT_CMap_Class; 204 205 /* internal charmap object structure */ 206 typedef struct FT_CMapRec_ 207 { 208 FT_CharMapRec charmap; 209 FT_CMap_Class clazz; 210 211 } FT_CMapRec; 212 213 /* typecase any pointer to a charmap handle */ 214 #define FT_CMAP( x ) ((FT_CMap)( x )) 215 216 /* obvious macros */ 217 #define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id 218 #define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id 219 #define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding 220 #define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face 221 222 223 /* class method definitions */ 224 typedef FT_Error 225 (*FT_CMap_InitFunc)( FT_CMap cmap, 226 FT_Pointer init_data ); 227 228 typedef void 229 (*FT_CMap_DoneFunc)( FT_CMap cmap ); 230 231 typedef FT_UInt 232 (*FT_CMap_CharIndexFunc)( FT_CMap cmap, 233 FT_UInt32 char_code ); 234 235 typedef FT_UInt 236 (*FT_CMap_CharNextFunc)( FT_CMap cmap, 237 FT_UInt32 *achar_code ); 238 239 240 typedef struct FT_CMap_ClassRec_ 241 { 242 FT_UInt size; 243 FT_CMap_InitFunc init; 244 FT_CMap_DoneFunc done; 245 FT_CMap_CharIndexFunc char_index; 246 FT_CMap_CharNextFunc char_next; 247 248 } FT_CMap_ClassRec; 249 250 251 /* create a new charmap and add it to charmap->face */ 252 FT_BASE( FT_Error ) 253 FT_CMap_New( FT_CMap_Class clazz, 254 FT_Pointer init_data, 255 FT_CharMap charmap, 256 FT_CMap *acmap ); 257 258 /* destroy a charmap (don't remove it from face's list though) */ 259 FT_BASE( void ) 260 FT_CMap_Done( FT_CMap cmap ); 261 262 263 /*************************************************************************/ 264 /* */ 265 /* <Struct> */ 266 /* FT_Face_InternalRec */ 267 /* */ 268 /* <Description> */ 269 /* This structure contains the internal fields of each FT_Face */ 270 /* object. These fields may change between different releases of */ 271 /* FreeType. */ 272 /* */ 273 /* <Fields> */ 274 /* max_points :: The maximal number of points used to store the */ 275 /* vectorial outline of any glyph in this face. */ 276 /* If this value cannot be known in advance, or */ 277 /* if the face isn't scalable, this should be set */ 278 /* to 0. Only relevant for scalable formats. */ 279 /* */ 280 /* max_contours :: The maximal number of contours used to store */ 281 /* the vectorial outline of any glyph in this */ 282 /* face. If this value cannot be known in */ 283 /* advance, or if the face isn't scalable, this */ 284 /* should be set to 0. Only relevant for */ 285 /* scalable formats. */ 286 /* */ 287 /* transform_matrix :: A 2x2 matrix of 16.16 coefficients used to */ 288 /* transform glyph outlines after they are loaded */ 289 /* from the font. Only used by the convenience */ 290 /* functions. */ 291 /* */ 292 /* transform_delta :: A translation vector used to transform glyph */ 293 /* outlines after they are loaded from the font. */ 294 /* Only used by the convenience functions. */ 295 /* */ 296 /* transform_flags :: Some flags used to classify the transform. */ 297 /* Only used by the convenience functions. */ 298 /* */ 299 /* hint_flags :: Some flags used to change the hinters' */ 300 /* behaviour. Only used for debugging for now. */ 301 /* */ 302 /* postscript_name :: Postscript font name for this face. */ 303 /* */ 304 /* incremental_interface :: */ 305 /* If non-null, the interface through */ 306 /* which glyph data and metrics are loaded */ 307 /* incrementally for faces that do not provide */ 308 /* all of this data when first opened. */ 309 /* This field exists only if */ 310 /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ 311 /* */ 312 typedef struct FT_Face_InternalRec_ 313 { 314 FT_UShort max_points; 315 FT_Short max_contours; 316 317 FT_Matrix transform_matrix; 318 FT_Vector transform_delta; 319 FT_Int transform_flags; 320 321 FT_UInt32 hint_flags; 322 323 const char* postscript_name; 324 325 #ifdef FT_CONFIG_OPTION_INCREMENTAL 326 FT_Incremental_InterfaceRec* incremental_interface; 327 #endif 328 329 } FT_Face_InternalRec; 330 331 332 /*************************************************************************/ 333 /* */ 334 /* <Struct> */ 335 /* FT_Slot_InternalRec */ 336 /* */ 337 /* <Description> */ 338 /* This structure contains the internal fields of each FT_GlyphSlot */ 339 /* object. These fields may change between different releases of */ 340 /* FreeType. */ 341 /* */ 342 /* <Fields> */ 343 /* loader :: The glyph loader object used to load outlines */ 344 /* into the glyph slot. */ 345 /* */ 346 /* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */ 347 /* must be transformed through a specific */ 348 /* font transformation. This is _not_ the same */ 349 /* as the face transform set through */ 350 /* FT_Set_Transform(). */ 351 /* */ 352 /* glyph_matrix :: The 2x2 matrix corresponding to the glyph */ 353 /* transformation, if necessary. */ 354 /* */ 355 /* glyph_delta :: The 2d translation vector corresponding to */ 356 /* the glyph transformation, if necessary. */ 357 /* */ 358 /* glyph_hints :: Format-specific glyph hints management. */ 359 /* */ 360 typedef struct FT_Slot_InternalRec_ 361 { 362 FT_GlyphLoader loader; 363 FT_Bool glyph_transformed; 364 FT_Matrix glyph_matrix; 365 FT_Vector glyph_delta; 366 void* glyph_hints; 367 368 } FT_GlyphSlot_InternalRec; 369 370 371 /*************************************************************************/ 372 /*************************************************************************/ 373 /*************************************************************************/ 374 /**** ****/ 375 /**** ****/ 376 /**** M O D U L E S ****/ 377 /**** ****/ 378 /**** ****/ 379 /*************************************************************************/ 380 /*************************************************************************/ 381 /*************************************************************************/ 382 383 384 /*************************************************************************/ 385 /* */ 386 /* <Struct> */ 387 /* FT_ModuleRec */ 388 /* */ 389 /* <Description> */ 390 /* A module object instance. */ 391 /* */ 392 /* <Fields> */ 393 /* clazz :: A pointer to the module's class. */ 394 /* */ 395 /* library :: A handle to the parent library object. */ 396 /* */ 397 /* memory :: A handle to the memory manager. */ 398 /* */ 399 /* generic :: A generic structure for user-level extensibility (?). */ 400 /* */ 401 typedef struct FT_ModuleRec_ 402 { 403 FT_Module_Class* clazz; 404 FT_Library library; 405 FT_Memory memory; 406 FT_Generic generic; 407 408 } FT_ModuleRec; 409 410 411 /* typecast an object to a FT_Module */ 412 #define FT_MODULE( x ) ((FT_Module)( x )) 413 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz 414 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library 415 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory 416 417 418 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 419 ft_module_font_driver ) 420 421 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 422 ft_module_renderer ) 423 424 #define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 425 ft_module_hinter ) 426 427 #define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 428 ft_module_styler ) 429 430 #define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 431 ft_module_driver_scalable ) 432 433 #define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \ 434 ft_module_driver_no_outlines ) 435 436 #define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ 437 ft_module_driver_has_hinter ) 438 439 440 /*************************************************************************/ 441 /* */ 442 /* <Function> */ 443 /* FT_Get_Module_Interface */ 444 /* */ 445 /* <Description> */ 446 /* Finds a module and returns its specific interface as a typeless */ 447 /* pointer. */ 448 /* */ 449 /* <Input> */ 450 /* library :: A handle to the library object. */ 451 /* */ 452 /* module_name :: The module's name (as an ASCII string). */ 453 /* */ 454 /* <Return> */ 455 /* A module-specific interface if available, 0 otherwise. */ 456 /* */ 457 /* <Note> */ 458 /* You should better be familiar with FreeType internals to know */ 459 /* which module to look for, and what its interface is :-) */ 460 /* */ 461 FT_BASE( const void* ) 462 FT_Get_Module_Interface( FT_Library library, 463 const char* mod_name ); 464 465 466 /*************************************************************************/ 467 /*************************************************************************/ 468 /*************************************************************************/ 469 /**** ****/ 470 /**** ****/ 471 /**** FACE, SIZE & GLYPH SLOT OBJECTS ****/ 472 /**** ****/ 473 /**** ****/ 474 /*************************************************************************/ 475 /*************************************************************************/ 476 /*************************************************************************/ 477 478 /* a few macros used to perform easy typecasts with minimal brain damage */ 479 480 #define FT_FACE( x ) ((FT_Face)(x)) 481 #define FT_SIZE( x ) ((FT_Size)(x)) 482 #define FT_SLOT( x ) ((FT_GlyphSlot)(x)) 483 484 #define FT_FACE_DRIVER( x ) FT_FACE( x )->driver 485 #define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library 486 #define FT_FACE_MEMORY( x ) FT_FACE( x )->memory 487 #define FT_FACE_STREAM( x ) FT_FACE( x )->stream 488 489 #define FT_SIZE_FACE( x ) FT_SIZE( x )->face 490 #define FT_SLOT_FACE( x ) FT_SLOT( x )->face 491 492 #define FT_FACE_SLOT( x ) FT_FACE( x )->glyph 493 #define FT_FACE_SIZE( x ) FT_FACE( x )->size 494 495 496 /*************************************************************************/ 497 /* */ 498 /* <Function> */ 499 /* FT_New_GlyphSlot */ 500 /* */ 501 /* <Description> */ 502 /* It is sometimes useful to have more than one glyph slot for a */ 503 /* given face object. This function is used to create additional */ 504 /* slots. All of them are automatically discarded when the face is */ 505 /* destroyed. */ 506 /* */ 507 /* <Input> */ 508 /* face :: A handle to a parent face object. */ 509 /* */ 510 /* <Output> */ 511 /* aslot :: A handle to a new glyph slot object. */ 512 /* */ 513 /* <Return> */ 514 /* FreeType error code. 0 means success. */ 515 /* */ 516 FT_BASE( FT_Error ) 517 FT_New_GlyphSlot( FT_Face face, 518 FT_GlyphSlot *aslot ); 519 520 521 /*************************************************************************/ 522 /* */ 523 /* <Function> */ 524 /* FT_Done_GlyphSlot */ 525 /* */ 526 /* <Description> */ 527 /* Destroys a given glyph slot. Remember however that all slots are */ 528 /* automatically destroyed with its parent. Using this function is */ 529 /* not always mandatory. */ 530 /* */ 531 /* <Input> */ 532 /* slot :: A handle to a target glyph slot. */ 533 /* */ 534 FT_BASE( void ) 535 FT_Done_GlyphSlot( FT_GlyphSlot slot ); 536 537 538 /*************************************************************************/ 539 /*************************************************************************/ 540 /*************************************************************************/ 541 /**** ****/ 542 /**** ****/ 543 /**** R E N D E R E R S ****/ 544 /**** ****/ 545 /**** ****/ 546 /*************************************************************************/ 547 /*************************************************************************/ 548 /*************************************************************************/ 549 550 551 #define FT_RENDERER( x ) ((FT_Renderer)( x )) 552 #define FT_GLYPH( x ) ((FT_Glyph)( x )) 553 #define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x )) 554 #define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x )) 555 556 557 typedef struct FT_RendererRec_ 558 { 559 FT_ModuleRec root; 560 FT_Renderer_Class* clazz; 561 FT_Glyph_Format glyph_format; 562 FT_Glyph_Class glyph_class; 563 564 FT_Raster raster; 565 FT_Raster_Render_Func raster_render; 566 FT_Renderer_RenderFunc render; 567 568 } FT_RendererRec; 569 570 571 /*************************************************************************/ 572 /*************************************************************************/ 573 /*************************************************************************/ 574 /**** ****/ 575 /**** ****/ 576 /**** F O N T D R I V E R S ****/ 577 /**** ****/ 578 /**** ****/ 579 /*************************************************************************/ 580 /*************************************************************************/ 581 /*************************************************************************/ 582 583 584 /* typecast a module into a driver easily */ 585 #define FT_DRIVER( x ) ((FT_Driver)(x)) 586 587 /* typecast a module as a driver, and get its driver class */ 588 #define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz 589 590 591 /*************************************************************************/ 592 /* */ 593 /* <Struct> */ 594 /* FT_DriverRec */ 595 /* */ 596 /* <Description> */ 597 /* The root font driver class. A font driver is responsible for */ 598 /* managing and loading font files of a given format. */ 599 /* */ 600 /* <Fields> */ 601 /* root :: Contains the fields of the root module class. */ 602 /* */ 603 /* clazz :: A pointer to the font driver's class. Note that */ 604 /* this is NOT root.clazz. `class' wasn't used */ 605 /* as it is a reserved word in C++. */ 606 /* */ 607 /* faces_list :: The list of faces currently opened by this */ 608 /* driver. */ 609 /* */ 610 /* extensions :: A typeless pointer to the driver's extensions */ 611 /* registry, if they are supported through the */ 612 /* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */ 613 /* */ 614 /* glyph_loader :: The glyph loader for all faces managed by this */ 615 /* driver. This object isn't defined for unscalable */ 616 /* formats. */ 617 /* */ 618 typedef struct FT_DriverRec_ 619 { 620 FT_ModuleRec root; 621 FT_Driver_Class clazz; 622 623 FT_ListRec faces_list; 624 void* extensions; 625 626 FT_GlyphLoader glyph_loader; 627 628 } FT_DriverRec; 629 630 631 /*************************************************************************/ 632 /*************************************************************************/ 633 /*************************************************************************/ 634 /**** ****/ 635 /**** ****/ 636 /**** L I B R A R I E S ****/ 637 /**** ****/ 638 /**** ****/ 639 /*************************************************************************/ 640 /*************************************************************************/ 641 /*************************************************************************/ 642 643 644 #define FT_DEBUG_HOOK_TRUETYPE 0 645 #define FT_DEBUG_HOOK_TYPE1 1 646 647 648 /*************************************************************************/ 649 /* */ 650 /* <Struct> */ 651 /* FT_LibraryRec */ 652 /* */ 653 /* <Description> */ 654 /* The FreeType library class. This is the root of all FreeType */ 655 /* data. Use FT_New_Library() to create a library object, and */ 656 /* FT_Done_Library() to discard it and all child objects. */ 657 /* */ 658 /* <Fields> */ 659 /* memory :: The library's memory object. Manages memory */ 660 /* allocation. */ 661 /* */ 662 /* generic :: Client data variable. Used to extend the */ 663 /* Library class by higher levels and clients. */ 664 /* */ 665 /* num_modules :: The number of modules currently registered */ 666 /* within this library. This is set to 0 for new */ 667 /* libraries. New modules are added through the */ 668 /* FT_Add_Module() API function. */ 669 /* */ 670 /* modules :: A table used to store handles to the currently */ 671 /* registered modules. Note that each font driver */ 672 /* contains a list of its opened faces. */ 673 /* */ 674 /* renderers :: The list of renderers currently registered */ 675 /* within the library. */ 676 /* */ 677 /* cur_renderer :: The current outline renderer. This is a */ 678 /* shortcut used to avoid parsing the list on */ 679 /* each call to FT_Outline_Render(). It is a */ 680 /* handle to the current renderer for the */ 681 /* FT_GLYPH_FORMAT_OUTLINE format. */ 682 /* */ 683 /* auto_hinter :: XXX */ 684 /* */ 685 /* raster_pool :: The raster object's render pool. This can */ 686 /* ideally be changed dynamically at run-time. */ 687 /* */ 688 /* raster_pool_size :: The size of the render pool in bytes. */ 689 /* */ 690 /* debug_hooks :: XXX */ 691 /* */ 692 typedef struct FT_LibraryRec_ 693 { 694 FT_Memory memory; /* library's memory manager */ 695 696 FT_Generic generic; 697 698 FT_Int version_major; 699 FT_Int version_minor; 700 FT_Int version_patch; 701 702 FT_UInt num_modules; 703 FT_Module modules[FT_MAX_MODULES]; /* module objects */ 704 705 FT_ListRec renderers; /* list of renderers */ 706 FT_Renderer cur_renderer; /* current outline renderer */ 707 FT_Module auto_hinter; 708 709 FT_Byte* raster_pool; /* scan-line conversion */ 710 /* render pool */ 711 FT_ULong raster_pool_size; /* size of render pool in bytes */ 712 713 FT_DebugHook_Func debug_hooks[4]; 714 715 FT_MetaClassRec meta_class; 716 717 } FT_LibraryRec; 718 719 720 FT_BASE( FT_Renderer ) 721 FT_Lookup_Renderer( FT_Library library, 722 FT_Glyph_Format format, 723 FT_ListNode* node ); 724 725 FT_BASE( FT_Error ) 726 FT_Render_Glyph_Internal( FT_Library library, 727 FT_GlyphSlot slot, 728 FT_Render_Mode render_mode ); 729 730 typedef const char* 731 (*FT_Face_GetPostscriptNameFunc)( FT_Face face ); 732 733 typedef FT_Error 734 (*FT_Face_GetGlyphNameFunc)( FT_Face face, 735 FT_UInt glyph_index, 736 FT_Pointer buffer, 737 FT_UInt buffer_max ); 738 739 typedef FT_UInt 740 (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face, 741 FT_String* glyph_name ); 742 743 744 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM 745 746 /*************************************************************************/ 747 /* */ 748 /* <Function> */ 749 /* FT_New_Memory */ 750 /* */ 751 /* <Description> */ 752 /* Creates a new memory object. */ 753 /* */ 754 /* <Return> */ 755 /* A pointer to the new memory object. 0 in case of error. */ 756 /* */ 757 FT_EXPORT( FT_Memory ) 758 FT_New_Memory( void ); 759 760 761 /*************************************************************************/ 762 /* */ 763 /* <Function> */ 764 /* FT_Done_Memory */ 765 /* */ 766 /* <Description> */ 767 /* Discards memory manager. */ 768 /* */ 769 /* <Input> */ 770 /* memory :: A handle to the memory manager. */ 771 /* */ 772 FT_EXPORT( void ) 773 FT_Done_Memory( FT_Memory memory ); 774 775 #endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */ 776 777 778 /* Define default raster's interface. The default raster is located in */ 779 /* `src/base/ftraster.c'. */ 780 /* */ 781 /* Client applications can register new rasters through the */ 782 /* FT_Set_Raster() API. */ 783 784 #ifndef FT_NO_DEFAULT_RASTER 785 FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster; 786 #endif 787 788 789 FT_END_HEADER 790 791 #endif /* __FTOBJS_H__ */ 792 793 794 /* END */ 795