1 /**************************************************************************** 2 * 3 * sfnt.h 4 * 5 * High-level 'sfnt' driver interface (specification). 6 * 7 * Copyright (C) 1996-2021 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 #ifndef SFNT_H_ 20 #define SFNT_H_ 21 22 23 #include <freetype/internal/ftdrv.h> 24 #include <freetype/internal/tttypes.h> 25 #include <freetype/internal/wofftypes.h> 26 27 28 FT_BEGIN_HEADER 29 30 31 /************************************************************************** 32 * 33 * @functype: 34 * TT_Init_Face_Func 35 * 36 * @description: 37 * First part of the SFNT face object initialization. This finds the 38 * face in a SFNT file or collection, and load its format tag in 39 * face->format_tag. 40 * 41 * @input: 42 * stream :: 43 * The input stream. 44 * 45 * face :: 46 * A handle to the target face object. 47 * 48 * face_index :: 49 * The index of the TrueType font, if we are opening a collection, in 50 * bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if 51 * applicable, in bits 16-30. 52 * 53 * num_params :: 54 * The number of additional parameters. 55 * 56 * params :: 57 * Optional additional parameters. 58 * 59 * @return: 60 * FreeType error code. 0 means success. 61 * 62 * @note: 63 * The stream cursor must be at the font file's origin. 64 * 65 * This function recognizes fonts embedded in a 'TrueType collection'. 66 * 67 * Once the format tag has been validated by the font driver, it should 68 * then call the TT_Load_Face_Func() callback to read the rest of the 69 * SFNT tables in the object. 70 */ 71 typedef FT_Error 72 (*TT_Init_Face_Func)( FT_Stream stream, 73 TT_Face face, 74 FT_Int face_index, 75 FT_Int num_params, 76 FT_Parameter* params ); 77 78 79 /************************************************************************** 80 * 81 * @functype: 82 * TT_Load_Face_Func 83 * 84 * @description: 85 * Second part of the SFNT face object initialization. This loads the 86 * common SFNT tables (head, OS/2, maxp, metrics, etc.) in the face 87 * object. 88 * 89 * @input: 90 * stream :: 91 * The input stream. 92 * 93 * face :: 94 * A handle to the target face object. 95 * 96 * face_index :: 97 * The index of the TrueType font, if we are opening a collection, in 98 * bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if 99 * applicable, in bits 16-30. 100 * 101 * num_params :: 102 * The number of additional parameters. 103 * 104 * params :: 105 * Optional additional parameters. 106 * 107 * @return: 108 * FreeType error code. 0 means success. 109 * 110 * @note: 111 * This function must be called after TT_Init_Face_Func(). 112 */ 113 typedef FT_Error 114 (*TT_Load_Face_Func)( FT_Stream stream, 115 TT_Face face, 116 FT_Int face_index, 117 FT_Int num_params, 118 FT_Parameter* params ); 119 120 121 /************************************************************************** 122 * 123 * @functype: 124 * TT_Done_Face_Func 125 * 126 * @description: 127 * A callback used to delete the common SFNT data from a face. 128 * 129 * @input: 130 * face :: 131 * A handle to the target face object. 132 * 133 * @note: 134 * This function does NOT destroy the face object. 135 */ 136 typedef void 137 (*TT_Done_Face_Func)( TT_Face face ); 138 139 140 /************************************************************************** 141 * 142 * @functype: 143 * TT_Load_Any_Func 144 * 145 * @description: 146 * Load any font table into client memory. 147 * 148 * @input: 149 * face :: 150 * The face object to look for. 151 * 152 * tag :: 153 * The tag of table to load. Use the value 0 if you want to access the 154 * whole font file, else set this parameter to a valid TrueType table 155 * tag that you can forge with the MAKE_TT_TAG macro. 156 * 157 * offset :: 158 * The starting offset in the table (or the file if tag == 0). 159 * 160 * length :: 161 * The address of the decision variable: 162 * 163 * If `length == NULL`: Loads the whole table. Returns an error if 164 * 'offset' == 0! 165 * 166 * If `*length == 0`: Exits immediately; returning the length of the 167 * given table or of the font file, depending on the value of 'tag'. 168 * 169 * If `*length != 0`: Loads the next 'length' bytes of table or font, 170 * starting at offset 'offset' (in table or font too). 171 * 172 * @output: 173 * buffer :: 174 * The address of target buffer. 175 * 176 * @return: 177 * TrueType error code. 0 means success. 178 */ 179 typedef FT_Error 180 (*TT_Load_Any_Func)( TT_Face face, 181 FT_ULong tag, 182 FT_Long offset, 183 FT_Byte *buffer, 184 FT_ULong* length ); 185 186 187 /************************************************************************** 188 * 189 * @functype: 190 * TT_Find_SBit_Image_Func 191 * 192 * @description: 193 * Check whether an embedded bitmap (an 'sbit') exists for a given glyph, 194 * at a given strike. 195 * 196 * @input: 197 * face :: 198 * The target face object. 199 * 200 * glyph_index :: 201 * The glyph index. 202 * 203 * strike_index :: 204 * The current strike index. 205 * 206 * @output: 207 * arange :: 208 * The SBit range containing the glyph index. 209 * 210 * astrike :: 211 * The SBit strike containing the glyph index. 212 * 213 * aglyph_offset :: 214 * The offset of the glyph data in 'EBDT' table. 215 * 216 * @return: 217 * FreeType error code. 0 means success. Returns 218 * SFNT_Err_Invalid_Argument if no sbit exists for the requested glyph. 219 */ 220 typedef FT_Error 221 (*TT_Find_SBit_Image_Func)( TT_Face face, 222 FT_UInt glyph_index, 223 FT_ULong strike_index, 224 TT_SBit_Range *arange, 225 TT_SBit_Strike *astrike, 226 FT_ULong *aglyph_offset ); 227 228 229 /************************************************************************** 230 * 231 * @functype: 232 * TT_Load_SBit_Metrics_Func 233 * 234 * @description: 235 * Get the big metrics for a given embedded bitmap. 236 * 237 * @input: 238 * stream :: 239 * The input stream. 240 * 241 * range :: 242 * The SBit range containing the glyph. 243 * 244 * @output: 245 * big_metrics :: 246 * A big SBit metrics structure for the glyph. 247 * 248 * @return: 249 * FreeType error code. 0 means success. 250 * 251 * @note: 252 * The stream cursor must be positioned at the glyph's offset within the 253 * 'EBDT' table before the call. 254 * 255 * If the image format uses variable metrics, the stream cursor is 256 * positioned just after the metrics header in the 'EBDT' table on 257 * function exit. 258 */ 259 typedef FT_Error 260 (*TT_Load_SBit_Metrics_Func)( FT_Stream stream, 261 TT_SBit_Range range, 262 TT_SBit_Metrics metrics ); 263 264 265 /************************************************************************** 266 * 267 * @functype: 268 * TT_Load_SBit_Image_Func 269 * 270 * @description: 271 * Load a given glyph sbit image from the font resource. This also 272 * returns its metrics. 273 * 274 * @input: 275 * face :: 276 * The target face object. 277 * 278 * strike_index :: 279 * The strike index. 280 * 281 * glyph_index :: 282 * The current glyph index. 283 * 284 * load_flags :: 285 * The current load flags. 286 * 287 * stream :: 288 * The input stream. 289 * 290 * @output: 291 * amap :: 292 * The target pixmap. 293 * 294 * ametrics :: 295 * A big sbit metrics structure for the glyph image. 296 * 297 * @return: 298 * FreeType error code. 0 means success. Returns an error if no glyph 299 * sbit exists for the index. 300 * 301 * @note: 302 * The `map.buffer` field is always freed before the glyph is loaded. 303 */ 304 typedef FT_Error 305 (*TT_Load_SBit_Image_Func)( TT_Face face, 306 FT_ULong strike_index, 307 FT_UInt glyph_index, 308 FT_UInt load_flags, 309 FT_Stream stream, 310 FT_Bitmap *amap, 311 TT_SBit_MetricsRec *ametrics ); 312 313 314 /************************************************************************** 315 * 316 * @functype: 317 * TT_Set_SBit_Strike_Func 318 * 319 * @description: 320 * Select an sbit strike for a given size request. 321 * 322 * @input: 323 * face :: 324 * The target face object. 325 * 326 * req :: 327 * The size request. 328 * 329 * @output: 330 * astrike_index :: 331 * The index of the sbit strike. 332 * 333 * @return: 334 * FreeType error code. 0 means success. Returns an error if no sbit 335 * strike exists for the selected ppem values. 336 */ 337 typedef FT_Error 338 (*TT_Set_SBit_Strike_Func)( TT_Face face, 339 FT_Size_Request req, 340 FT_ULong* astrike_index ); 341 342 343 /************************************************************************** 344 * 345 * @functype: 346 * TT_Load_Strike_Metrics_Func 347 * 348 * @description: 349 * Load the metrics of a given strike. 350 * 351 * @input: 352 * face :: 353 * The target face object. 354 * 355 * strike_index :: 356 * The strike index. 357 * 358 * @output: 359 * metrics :: 360 * the metrics of the strike. 361 * 362 * @return: 363 * FreeType error code. 0 means success. Returns an error if no such 364 * sbit strike exists. 365 */ 366 typedef FT_Error 367 (*TT_Load_Strike_Metrics_Func)( TT_Face face, 368 FT_ULong strike_index, 369 FT_Size_Metrics* metrics ); 370 371 372 /************************************************************************** 373 * 374 * @functype: 375 * TT_Get_PS_Name_Func 376 * 377 * @description: 378 * Get the PostScript glyph name of a glyph. 379 * 380 * @input: 381 * idx :: 382 * The glyph index. 383 * 384 * PSname :: 385 * The address of a string pointer. Will be `NULL` in case of error, 386 * otherwise it is a pointer to the glyph name. 387 * 388 * You must not modify the returned string! 389 * 390 * @output: 391 * FreeType error code. 0 means success. 392 */ 393 typedef FT_Error 394 (*TT_Get_PS_Name_Func)( TT_Face face, 395 FT_UInt idx, 396 FT_String** PSname ); 397 398 399 /************************************************************************** 400 * 401 * @functype: 402 * TT_Load_Metrics_Func 403 * 404 * @description: 405 * Load a metrics table, which is a table with a horizontal and a 406 * vertical version. 407 * 408 * @input: 409 * face :: 410 * A handle to the target face object. 411 * 412 * stream :: 413 * The input stream. 414 * 415 * vertical :: 416 * A boolean flag. If set, load the vertical one. 417 * 418 * @return: 419 * FreeType error code. 0 means success. 420 */ 421 typedef FT_Error 422 (*TT_Load_Metrics_Func)( TT_Face face, 423 FT_Stream stream, 424 FT_Bool vertical ); 425 426 427 /************************************************************************** 428 * 429 * @functype: 430 * TT_Get_Metrics_Func 431 * 432 * @description: 433 * Load the horizontal or vertical header in a face object. 434 * 435 * @input: 436 * face :: 437 * A handle to the target face object. 438 * 439 * vertical :: 440 * A boolean flag. If set, load vertical metrics. 441 * 442 * gindex :: 443 * The glyph index. 444 * 445 * @output: 446 * abearing :: 447 * The horizontal (or vertical) bearing. Set to zero in case of error. 448 * 449 * aadvance :: 450 * The horizontal (or vertical) advance. Set to zero in case of error. 451 */ 452 typedef void 453 (*TT_Get_Metrics_Func)( TT_Face face, 454 FT_Bool vertical, 455 FT_UInt gindex, 456 FT_Short* abearing, 457 FT_UShort* aadvance ); 458 459 460 /************************************************************************** 461 * 462 * @functype: 463 * TT_Set_Palette_Func 464 * 465 * @description: 466 * Load the colors into `face->palette` for a given palette index. 467 * 468 * @input: 469 * face :: 470 * The target face object. 471 * 472 * idx :: 473 * The palette index. 474 * 475 * @return: 476 * FreeType error code. 0 means success. 477 */ 478 typedef FT_Error 479 (*TT_Set_Palette_Func)( TT_Face face, 480 FT_UInt idx ); 481 482 483 /************************************************************************** 484 * 485 * @functype: 486 * TT_Get_Colr_Layer_Func 487 * 488 * @description: 489 * Iteratively get the color layer data of a given glyph index. 490 * 491 * @input: 492 * face :: 493 * The target face object. 494 * 495 * base_glyph :: 496 * The glyph index the colored glyph layers are associated with. 497 * 498 * @inout: 499 * iterator :: 500 * An @FT_LayerIterator object. For the first call you should set 501 * `iterator->p` to `NULL`. For all following calls, simply use the 502 * same object again. 503 * 504 * @output: 505 * aglyph_index :: 506 * The glyph index of the current layer. 507 * 508 * acolor_index :: 509 * The color index into the font face's color palette of the current 510 * layer. The value 0xFFFF is special; it doesn't reference a palette 511 * entry but indicates that the text foreground color should be used 512 * instead (to be set up by the application outside of FreeType). 513 * 514 * @return: 515 * Value~1 if everything is OK. If there are no more layers (or if there 516 * are no layers at all), value~0 gets returned. In case of an error, 517 * value~0 is returned also. 518 */ 519 typedef FT_Bool 520 (*TT_Get_Colr_Layer_Func)( TT_Face face, 521 FT_UInt base_glyph, 522 FT_UInt *aglyph_index, 523 FT_UInt *acolor_index, 524 FT_LayerIterator* iterator ); 525 526 527 /************************************************************************** 528 * 529 * @functype: 530 * TT_Get_Color_Glyph_Paint_Func 531 * 532 * @description: 533 * Find the root @FT_OpaquePaint object for a given glyph ID. 534 * 535 * @input: 536 * face :: 537 * The target face object. 538 * 539 * base_glyph :: 540 * The glyph index the colored glyph layers are associated with. 541 * 542 * @output: 543 * paint :: 544 * The root @FT_OpaquePaint object. 545 * 546 * @return: 547 * Value~1 if everything is OK. If no color glyph is found, or the root 548 * paint could not be retrieved, value~0 gets returned. In case of an 549 * error, value~0 is returned also. 550 */ 551 typedef FT_Bool 552 ( *TT_Get_Color_Glyph_Paint_Func )( TT_Face face, 553 FT_UInt base_glyph, 554 FT_Color_Root_Transform root_transform, 555 FT_OpaquePaint *paint ); 556 557 558 /************************************************************************** 559 * 560 * @functype: 561 * TT_Get_Color_Glyph_ClipBox_Func 562 * 563 * @description: 564 * Search for a 'COLR' v1 clip box for the specified `base_glyph` and 565 * fill the `clip_box` parameter with the 'COLR' v1 'ClipBox' information 566 * if one is found. 567 * 568 * @input: 569 * face :: 570 * A handle to the parent face object. 571 * 572 * base_glyph :: 573 * The glyph index for which to retrieve the clip box. 574 * 575 * @output: 576 * clip_box :: 577 * The clip box for the requested `base_glyph` if one is found. The 578 * clip box is computed taking scale and transformations configured on 579 * the @FT_Face into account. @FT_ClipBox contains @FT_Vector values 580 * in 26.6 format. 581 * 582 * @note: 583 * To retrieve the clip box in font units, reset scale to units-per-em 584 * and remove transforms configured using @FT_Set_Transform. 585 * 586 * @return: 587 * Value~1 if a ClipBox is found. If no clip box is found or an 588 * error occured, value~0 is returned. 589 */ 590 typedef FT_Bool 591 ( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face, 592 FT_UInt base_glyph, 593 FT_ClipBox* clip_box ); 594 595 596 /************************************************************************** 597 * 598 * @functype: 599 * TT_Get_Paint_Layers_Func 600 * 601 * @description: 602 * Access the layers of a `PaintColrLayers` table. 603 * 604 * @input: 605 * face :: 606 * The target face object. 607 * 608 * @inout: 609 * iterator :: 610 * The @FT_LayerIterator from an @FT_PaintColrLayers object, for which 611 * the layers are to be retrieved. The internal state of the iterator 612 * is incremented after one call to this function for retrieving one 613 * layer. 614 * 615 * @output: 616 * paint :: 617 * The root @FT_OpaquePaint object referencing the actual paint table. 618 * 619 * @return: 620 * Value~1 if everything is OK. Value~0 gets returned when the paint 621 * object can not be retrieved or any other error occurs. 622 */ 623 typedef FT_Bool 624 ( *TT_Get_Paint_Layers_Func )( TT_Face face, 625 FT_LayerIterator* iterator, 626 FT_OpaquePaint *paint ); 627 628 629 /************************************************************************** 630 * 631 * @functype: 632 * TT_Get_Colorline_Stops_Func 633 * 634 * @description: 635 * Get the gradient and solid fill information for a given glyph. 636 * 637 * @input: 638 * face :: 639 * The target face object. 640 * 641 * @inout: 642 * iterator :: 643 * An @FT_ColorStopIterator object. For the first call you should set 644 * `iterator->p` to `NULL`. For all following calls, simply use the 645 * same object again. 646 * 647 * @output: 648 * color_stop :: 649 * Color index and alpha value for the retrieved color stop. 650 * 651 * @return: 652 * Value~1 if everything is OK. If there are no more color stops, 653 * value~0 gets returned. In case of an error, value~0 is returned 654 * also. 655 */ 656 typedef FT_Bool 657 ( *TT_Get_Colorline_Stops_Func )( TT_Face face, 658 FT_ColorStop *color_stop, 659 FT_ColorStopIterator* iterator ); 660 661 662 /************************************************************************** 663 * 664 * @functype: 665 * TT_Get_Paint_Func 666 * 667 * @description: 668 * Get the paint details for a given @FT_OpaquePaint object. 669 * 670 * @input: 671 * face :: 672 * The target face object. 673 * 674 * opaque_paint :: 675 * The @FT_OpaquePaint object. 676 * 677 * @output: 678 * paint :: 679 * An @FT_COLR_Paint object holding the details on `opaque_paint`. 680 * 681 * @return: 682 * Value~1 if everything is OK. Value~0 if no details can be found for 683 * this paint or any other error occured. 684 */ 685 typedef FT_Bool 686 ( *TT_Get_Paint_Func )( TT_Face face, 687 FT_OpaquePaint opaque_paint, 688 FT_COLR_Paint *paint ); 689 690 691 /************************************************************************** 692 * 693 * @functype: 694 * TT_Blend_Colr_Func 695 * 696 * @description: 697 * Blend the bitmap in `new_glyph` into `base_glyph` using the color 698 * specified by `color_index`. If `color_index` is 0xFFFF, use 699 * `face->foreground_color` if `face->have_foreground_color` is set. 700 * Otherwise check `face->palette_data.palette_flags`: If present and 701 * @FT_PALETTE_FOR_DARK_BACKGROUND is set, use BGRA value 0xFFFFFFFF 702 * (white opaque). Otherwise use BGRA value 0x000000FF (black opaque). 703 * 704 * @input: 705 * face :: 706 * The target face object. 707 * 708 * color_index :: 709 * Color index from the COLR table. 710 * 711 * base_glyph :: 712 * Slot for bitmap to be merged into. The underlying bitmap may get 713 * reallocated. 714 * 715 * new_glyph :: 716 * Slot to be incooperated into `base_glyph`. 717 * 718 * @return: 719 * FreeType error code. 0 means success. Returns an error if 720 * color_index is invalid or reallocation fails. 721 */ 722 typedef FT_Error 723 (*TT_Blend_Colr_Func)( TT_Face face, 724 FT_UInt color_index, 725 FT_GlyphSlot base_glyph, 726 FT_GlyphSlot new_glyph ); 727 728 729 /************************************************************************** 730 * 731 * @functype: 732 * TT_Get_Name_Func 733 * 734 * @description: 735 * From the 'name' table, return a given ENGLISH name record in ASCII. 736 * 737 * @input: 738 * face :: 739 * A handle to the source face object. 740 * 741 * nameid :: 742 * The name id of the name record to return. 743 * 744 * @inout: 745 * name :: 746 * The address of an allocated string pointer. `NULL` if no name is 747 * present. 748 * 749 * @return: 750 * FreeType error code. 0 means success. 751 */ 752 typedef FT_Error 753 (*TT_Get_Name_Func)( TT_Face face, 754 FT_UShort nameid, 755 FT_String** name ); 756 757 758 /************************************************************************** 759 * 760 * @functype: 761 * TT_Get_Name_ID_Func 762 * 763 * @description: 764 * Search whether an ENGLISH version for a given name ID is in the 'name' 765 * table. 766 * 767 * @input: 768 * face :: 769 * A handle to the source face object. 770 * 771 * nameid :: 772 * The name id of the name record to return. 773 * 774 * @output: 775 * win :: 776 * If non-negative, an index into the 'name' table with the 777 * corresponding (3,1) or (3,0) Windows entry. 778 * 779 * apple :: 780 * If non-negative, an index into the 'name' table with the 781 * corresponding (1,0) Apple entry. 782 * 783 * @return: 784 * 1 if there is either a win or apple entry (or both), 0 otheriwse. 785 */ 786 typedef FT_Bool 787 (*TT_Get_Name_ID_Func)( TT_Face face, 788 FT_UShort nameid, 789 FT_Int *win, 790 FT_Int *apple ); 791 792 793 /************************************************************************** 794 * 795 * @functype: 796 * TT_Load_Table_Func 797 * 798 * @description: 799 * Load a given TrueType table. 800 * 801 * @input: 802 * face :: 803 * A handle to the target face object. 804 * 805 * stream :: 806 * The input stream. 807 * 808 * @return: 809 * FreeType error code. 0 means success. 810 * 811 * @note: 812 * The function uses `face->goto_table` to seek the stream to the start 813 * of the table, except while loading the font directory. 814 */ 815 typedef FT_Error 816 (*TT_Load_Table_Func)( TT_Face face, 817 FT_Stream stream ); 818 819 820 /************************************************************************** 821 * 822 * @functype: 823 * TT_Free_Table_Func 824 * 825 * @description: 826 * Free a given TrueType table. 827 * 828 * @input: 829 * face :: 830 * A handle to the target face object. 831 */ 832 typedef void 833 (*TT_Free_Table_Func)( TT_Face face ); 834 835 836 /* 837 * @functype: 838 * TT_Face_GetKerningFunc 839 * 840 * @description: 841 * Return the horizontal kerning value between two glyphs. 842 * 843 * @input: 844 * face :: 845 * A handle to the source face object. 846 * 847 * left_glyph :: 848 * The left glyph index. 849 * 850 * right_glyph :: 851 * The right glyph index. 852 * 853 * @return: 854 * The kerning value in font units. 855 */ 856 typedef FT_Int 857 (*TT_Face_GetKerningFunc)( TT_Face face, 858 FT_UInt left_glyph, 859 FT_UInt right_glyph ); 860 861 862 /************************************************************************** 863 * 864 * @struct: 865 * SFNT_Interface 866 * 867 * @description: 868 * This structure holds pointers to the functions used to load and free 869 * the basic tables that are required in a 'sfnt' font file. 870 * 871 * @fields: 872 * Check the various xxx_Func() descriptions for details. 873 */ 874 typedef struct SFNT_Interface_ 875 { 876 TT_Loader_GotoTableFunc goto_table; 877 878 TT_Init_Face_Func init_face; 879 TT_Load_Face_Func load_face; 880 TT_Done_Face_Func done_face; 881 FT_Module_Requester get_interface; 882 883 TT_Load_Any_Func load_any; 884 885 /* these functions are called by `load_face' but they can also */ 886 /* be called from external modules, if there is a need to do so */ 887 TT_Load_Table_Func load_head; 888 TT_Load_Metrics_Func load_hhea; 889 TT_Load_Table_Func load_cmap; 890 TT_Load_Table_Func load_maxp; 891 TT_Load_Table_Func load_os2; 892 TT_Load_Table_Func load_post; 893 894 TT_Load_Table_Func load_name; 895 TT_Free_Table_Func free_name; 896 897 /* this field was called `load_kerning' up to version 2.1.10 */ 898 TT_Load_Table_Func load_kern; 899 900 TT_Load_Table_Func load_gasp; 901 TT_Load_Table_Func load_pclt; 902 903 /* see `ttload.h'; this field was called `load_bitmap_header' up to */ 904 /* version 2.1.10 */ 905 TT_Load_Table_Func load_bhed; 906 907 TT_Load_SBit_Image_Func load_sbit_image; 908 909 /* see `ttpost.h' */ 910 TT_Get_PS_Name_Func get_psname; 911 TT_Free_Table_Func free_psnames; 912 913 /* starting here, the structure differs from version 2.1.7 */ 914 915 /* this field was introduced in version 2.1.8, named `get_psname' */ 916 TT_Face_GetKerningFunc get_kerning; 917 918 /* new elements introduced after version 2.1.10 */ 919 920 /* load the font directory, i.e., the offset table and */ 921 /* the table directory */ 922 TT_Load_Table_Func load_font_dir; 923 TT_Load_Metrics_Func load_hmtx; 924 925 TT_Load_Table_Func load_eblc; 926 TT_Free_Table_Func free_eblc; 927 928 TT_Set_SBit_Strike_Func set_sbit_strike; 929 TT_Load_Strike_Metrics_Func load_strike_metrics; 930 931 TT_Load_Table_Func load_cpal; 932 TT_Load_Table_Func load_colr; 933 TT_Free_Table_Func free_cpal; 934 TT_Free_Table_Func free_colr; 935 TT_Set_Palette_Func set_palette; 936 TT_Get_Colr_Layer_Func get_colr_layer; 937 TT_Get_Color_Glyph_Paint_Func get_colr_glyph_paint; 938 TT_Get_Color_Glyph_ClipBox_Func get_color_glyph_clipbox; 939 TT_Get_Paint_Layers_Func get_paint_layers; 940 TT_Get_Colorline_Stops_Func get_colorline_stops; 941 TT_Get_Paint_Func get_paint; 942 TT_Blend_Colr_Func colr_blend; 943 944 TT_Get_Metrics_Func get_metrics; 945 946 TT_Get_Name_Func get_name; 947 TT_Get_Name_ID_Func get_name_id; 948 949 } SFNT_Interface; 950 951 952 /* transitional */ 953 typedef SFNT_Interface* SFNT_Service; 954 955 956 #define FT_DEFINE_SFNT_INTERFACE( \ 957 class_, \ 958 goto_table_, \ 959 init_face_, \ 960 load_face_, \ 961 done_face_, \ 962 get_interface_, \ 963 load_any_, \ 964 load_head_, \ 965 load_hhea_, \ 966 load_cmap_, \ 967 load_maxp_, \ 968 load_os2_, \ 969 load_post_, \ 970 load_name_, \ 971 free_name_, \ 972 load_kern_, \ 973 load_gasp_, \ 974 load_pclt_, \ 975 load_bhed_, \ 976 load_sbit_image_, \ 977 get_psname_, \ 978 free_psnames_, \ 979 get_kerning_, \ 980 load_font_dir_, \ 981 load_hmtx_, \ 982 load_eblc_, \ 983 free_eblc_, \ 984 set_sbit_strike_, \ 985 load_strike_metrics_, \ 986 load_cpal_, \ 987 load_colr_, \ 988 free_cpal_, \ 989 free_colr_, \ 990 set_palette_, \ 991 get_colr_layer_, \ 992 get_colr_glyph_paint_, \ 993 get_color_glyph_clipbox, \ 994 get_paint_layers_, \ 995 get_colorline_stops_, \ 996 get_paint_, \ 997 colr_blend_, \ 998 get_metrics_, \ 999 get_name_, \ 1000 get_name_id_ ) \ 1001 static const SFNT_Interface class_ = \ 1002 { \ 1003 goto_table_, \ 1004 init_face_, \ 1005 load_face_, \ 1006 done_face_, \ 1007 get_interface_, \ 1008 load_any_, \ 1009 load_head_, \ 1010 load_hhea_, \ 1011 load_cmap_, \ 1012 load_maxp_, \ 1013 load_os2_, \ 1014 load_post_, \ 1015 load_name_, \ 1016 free_name_, \ 1017 load_kern_, \ 1018 load_gasp_, \ 1019 load_pclt_, \ 1020 load_bhed_, \ 1021 load_sbit_image_, \ 1022 get_psname_, \ 1023 free_psnames_, \ 1024 get_kerning_, \ 1025 load_font_dir_, \ 1026 load_hmtx_, \ 1027 load_eblc_, \ 1028 free_eblc_, \ 1029 set_sbit_strike_, \ 1030 load_strike_metrics_, \ 1031 load_cpal_, \ 1032 load_colr_, \ 1033 free_cpal_, \ 1034 free_colr_, \ 1035 set_palette_, \ 1036 get_colr_layer_, \ 1037 get_colr_glyph_paint_, \ 1038 get_color_glyph_clipbox, \ 1039 get_paint_layers_, \ 1040 get_colorline_stops_, \ 1041 get_paint_, \ 1042 colr_blend_, \ 1043 get_metrics_, \ 1044 get_name_, \ 1045 get_name_id_ \ 1046 }; 1047 1048 1049 FT_END_HEADER 1050 1051 #endif /* SFNT_H_ */ 1052 1053 1054 /* END */ 1055