Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: third_party/freetype/include/freetype-android/ftoption.h

Issue 833103004: Update Android FreeType version. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* ftoption.h */ 3 /* ftoption.h */
4 /* */ 4 /* */
5 /* User-selectable configuration macros (specification only). */ 5 /* User-selectable configuration macros (specification only). */
6 /* */ 6 /* */
7 /* Copyright 1996-2013 by */ 7 /* Copyright 1996-2015 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */ 9 /* */
10 /* This file is part of the FreeType project, and may only be used, */ 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 */ 11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */ 13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */ 14 /* understand and accept it fully. */
15 /* */ 15 /* */
16 /***************************************************************************/ 16 /***************************************************************************/
17 17
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 /* fopen() etc. Enables the use of smaller system libraries on embedded */ 209 /* fopen() etc. Enables the use of smaller system libraries on embedded */
210 /* systems that have multiple system libraries, some with or without */ 210 /* systems that have multiple system libraries, some with or without */
211 /* file stream support, in the cases where file stream support is not */ 211 /* file stream support, in the cases where file stream support is not */
212 /* necessary such as memory loading of font files. */ 212 /* necessary such as memory loading of font files. */
213 /* */ 213 /* */
214 /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ 214 /* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
215 215
216 216
217 /*************************************************************************/ 217 /*************************************************************************/
218 /* */ 218 /* */
219 /* PNG bitmap support. */ 219 /* PNG bitmap support. */
220 /* */ 220 /* */
221 /* FreeType now handles loading color bitmap glyphs in the PNG format. */ 221 /* FreeType now handles loading color bitmap glyphs in the PNG format. */
222 /* This requires help from the external libpng library. Uncompressed */ 222 /* This requires help from the external libpng library. Uncompressed */
223 /* color bitmaps do not need any external libraries and will be */ 223 /* color bitmaps do not need any external libraries and will be */
224 /* supported regardless of this configuration. */ 224 /* supported regardless of this configuration. */
225 /* */ 225 /* */
226 /* Define this macro if you want to enable this `feature'. */ 226 /* Define this macro if you want to enable this `feature'. */
227 /* */ 227 /* */
228 #define FT_CONFIG_OPTION_USE_PNG 228 #define FT_CONFIG_OPTION_USE_PNG
229 229
230 230
231 /*************************************************************************/ 231 /*************************************************************************/
232 /* */ 232 /* */
233 /* HarfBuzz support. */
234 /* */
235 /* FreeType uses the HarfBuzz library to improve auto-hinting of */
236 /* OpenType fonts. If available, many glyphs not directly addressable */
237 /* by a font's character map will be hinted also. */
238 /* */
239 /* Define this macro if you want to enable this `feature'. */
240 /* */
241 /* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
242
243
244 /*************************************************************************/
245 /* */
233 /* DLL export compilation */ 246 /* DLL export compilation */
234 /* */ 247 /* */
235 /* When compiling FreeType as a DLL, some systems/compilers need a */ 248 /* When compiling FreeType as a DLL, some systems/compilers need a */
236 /* special keyword in front OR after the return type of function */ 249 /* special keyword in front OR after the return type of function */
237 /* declarations. */ 250 /* declarations. */
238 /* */ 251 /* */
239 /* Two macros are used within the FreeType source code to define */ 252 /* Two macros are used within the FreeType source code to define */
240 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ 253 /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
241 /* */ 254 /* */
242 /* FT_EXPORT( return_type ) */ 255 /* FT_EXPORT( return_type ) */
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 /* as the Ghostscript interpreter for the PostScript language. */ 371 /* as the Ghostscript interpreter for the PostScript language. */
359 /* */ 372 /* */
360 #define FT_CONFIG_OPTION_INCREMENTAL 373 #define FT_CONFIG_OPTION_INCREMENTAL
361 374
362 375
363 /*************************************************************************/ 376 /*************************************************************************/
364 /* */ 377 /* */
365 /* The size in bytes of the render pool used by the scan-line converter */ 378 /* The size in bytes of the render pool used by the scan-line converter */
366 /* to do all of its work. */ 379 /* to do all of its work. */
367 /* */ 380 /* */
368 /* This must be greater than 4KByte if you use FreeType to rasterize */
369 /* glyphs; otherwise, you may set it to zero to avoid unnecessary */
370 /* allocation of the render pool. */
371 /* */
372 #define FT_RENDER_POOL_SIZE 16384L 381 #define FT_RENDER_POOL_SIZE 16384L
373 382
374 383
375 /*************************************************************************/ 384 /*************************************************************************/
376 /* */ 385 /* */
377 /* FT_MAX_MODULES */ 386 /* FT_MAX_MODULES */
378 /* */ 387 /* */
379 /* The maximum number of modules that can be registered in a single */ 388 /* The maximum number of modules that can be registered in a single */
380 /* FreeType library object. 32 is the default. */ 389 /* FreeType library object. 32 is the default. */
381 /* */ 390 /* */
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 /* _af_debug_disable_horz_hints */ 424 /* _af_debug_disable_horz_hints */
416 /* _af_debug_disable_vert_hints */ 425 /* _af_debug_disable_vert_hints */
417 /* _af_debug_disable_blue_hints */ 426 /* _af_debug_disable_blue_hints */
418 /* */ 427 /* */
419 /* Additionally, the following functions provide dumps of various */ 428 /* Additionally, the following functions provide dumps of various */
420 /* internal autofit structures to stdout (using `printf'): */ 429 /* internal autofit structures to stdout (using `printf'): */
421 /* */ 430 /* */
422 /* af_glyph_hints_dump_points */ 431 /* af_glyph_hints_dump_points */
423 /* af_glyph_hints_dump_segments */ 432 /* af_glyph_hints_dump_segments */
424 /* af_glyph_hints_dump_edges */ 433 /* af_glyph_hints_dump_edges */
434 /* af_glyph_hints_get_num_segments */
435 /* af_glyph_hints_get_segment_offset */
425 /* */ 436 /* */
426 /* As an argument, they use another global variable: */ 437 /* As an argument, they use another global variable: */
427 /* */ 438 /* */
428 /* _af_debug_hints */ 439 /* _af_debug_hints */
429 /* */ 440 /* */
430 /* Please have a look at the `ftgrid' demo program to see how those */ 441 /* Please have a look at the `ftgrid' demo program to see how those */
431 /* variables and macros should be used. */ 442 /* variables and macros should be used. */
432 /* */ 443 /* */
433 /* Do not #undef these macros here since the build system might define */ 444 /* Do not #undef these macros here since the build system might define */
434 /* them for certain configurations only. */ 445 /* them for certain configurations only. */
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 532
522 /*************************************************************************/ 533 /*************************************************************************/
523 /* */ 534 /* */
524 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ 535 /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
525 /* access the internal name table in a SFNT-based format like TrueType */ 536 /* access the internal name table in a SFNT-based format like TrueType */
526 /* or OpenType. The name table contains various strings used to */ 537 /* or OpenType. The name table contains various strings used to */
527 /* describe the font, like family name, copyright, version, etc. It */ 538 /* describe the font, like family name, copyright, version, etc. It */
528 /* does not contain any glyph name though. */ 539 /* does not contain any glyph name though. */
529 /* */ 540 /* */
530 /* Accessing SFNT names is done through the functions declared in */ 541 /* Accessing SFNT names is done through the functions declared in */
531 /* `freetype/ftsnames.h'. */ 542 /* `ftsnames.h'. */
532 /* */ 543 /* */
533 #define TT_CONFIG_OPTION_SFNT_NAMES 544 #define TT_CONFIG_OPTION_SFNT_NAMES
534 545
535 546
536 /*************************************************************************/ 547 /*************************************************************************/
537 /* */ 548 /* */
538 /* TrueType CMap support */ 549 /* TrueType CMap support */
539 /* */ 550 /* */
540 /* Here you can fine-tune which TrueType CMap table format shall be */ 551 /* Here you can fine-tune which TrueType CMap table format shall be */
541 /* supported. */ 552 /* supported. */
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 /* */ 650 /* */
640 /* error = FT_Open_Face( library, &open_args, index, &face ); */ 651 /* error = FT_Open_Face( library, &open_args, index, &face ); */
641 /* ... */ 652 /* ... */
642 /* } */ 653 /* } */
643 /* */ 654 /* */
644 /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ 655 /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
645 656
646 657
647 /*************************************************************************/ 658 /*************************************************************************/
648 /* */ 659 /* */
649 /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
650 /* bytecode interpreter with a huge switch statement, rather than a call */
651 /* table. This results in smaller and faster code for a number of */
652 /* architectures. */
653 /* */
654 /* Note however that on some compiler/processor combinations, undefining */
655 /* this macro will generate faster, though larger, code. */
656 /* */
657 #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
658
659
660 /*************************************************************************/
661 /* */
662 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ 660 /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
663 /* TrueType glyph loader to use Apple's definition of how to handle */ 661 /* TrueType glyph loader to use Apple's definition of how to handle */
664 /* component offsets in composite glyphs. */ 662 /* component offsets in composite glyphs. */
665 /* */ 663 /* */
666 /* Apple and MS disagree on the default behavior of component offsets */ 664 /* Apple and MS disagree on the default behavior of component offsets */
667 /* in composites. Apple says that they should be scaled by the scaling */ 665 /* in composites. Apple says that they should be scaled by the scaling */
668 /* factors in the transformation matrix (roughly, it's more complex) */ 666 /* factors in the transformation matrix (roughly, it's more complex) */
669 /* while MS says they should not. OpenType defines two bits in the */ 667 /* while MS says they should not. OpenType defines two bits in the */
670 /* composite flags array which can be used to disambiguate, but old */ 668 /* composite flags array which can be used to disambiguate, but old */
671 /* fonts will not have them. */ 669 /* fonts will not have them. */
672 /* */ 670 /* */
673 /* http://www.microsoft.com/typography/otspec/glyf.htm */ 671 /* http://www.microsoft.com/typography/otspec/glyf.htm */
674 /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ 672 /* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6gly f.html */
675 /* */ 673 /* */
676 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED 674 #undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
677 675
678 676
679 /*************************************************************************/ 677 /*************************************************************************/
680 /* */ 678 /* */
681 /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ 679 /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
682 /* support for Apple's distortable font technology (fvar, gvar, cvar, */ 680 /* support for Apple's distortable font technology (fvar, gvar, cvar, */
683 /* and avar tables). This has many similarities to Type 1 Multiple */ 681 /* and avar tables). This has many similarities to Type 1 Multiple */
684 /* Masters support. */ 682 /* Masters support. */
685 /* */ 683 /* */
686 #define TT_CONFIG_OPTION_GX_VAR_SUPPORT 684 #define TT_CONFIG_OPTION_GX_VAR_SUPPORT
687 685
688 686
689 /*************************************************************************/ 687 /*************************************************************************/
690 /* */ 688 /* */
691 /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ 689 /* Define TT_CONFIG_OPTION_BDF if you want to include support for */
692 /* an embedded `BDF ' table within SFNT-based bitmap formats. */ 690 /* an embedded `BDF ' table within SFNT-based bitmap formats. */
693 /* */ 691 /* */
694 #define TT_CONFIG_OPTION_BDF 692 #define TT_CONFIG_OPTION_BDF
695 693
696 694
697 /*************************************************************************/ 695 /*************************************************************************/
696 /* */
697 /* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */
698 /* number of bytecode instructions executed for a single run of the */
699 /* bytecode interpreter, needed to prevent infinite loops. You don't */
700 /* want to change this except for very special situations (e.g., making */
701 /* a library fuzzer spend less time to handle broken fonts). */
702 /* */
703 /* It is not expected that this value is ever modified by a configuring */
704 /* script; instead, it gets surrounded with #ifndef ... #endif so that */
705 /* the value can be set as a preprocessor option on the compiler's */
706 /* command line. */
707 /* */
708 #ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES
709 #define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L
710 #endif
711
712
713 /*************************************************************************/
698 /*************************************************************************/ 714 /*************************************************************************/
699 /**** ****/ 715 /**** ****/
700 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ 716 /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
701 /**** ****/ 717 /**** ****/
702 /*************************************************************************/ 718 /*************************************************************************/
703 /*************************************************************************/ 719 /*************************************************************************/
704 720
705 721
706 /*************************************************************************/ 722 /*************************************************************************/
707 /* */ 723 /* */
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 /*************************************************************************/ 769 /*************************************************************************/
754 /**** ****/ 770 /**** ****/
755 /**** C F F D R I V E R C O N F I G U R A T I O N ****/ 771 /**** C F F D R I V E R C O N F I G U R A T I O N ****/
756 /**** ****/ 772 /**** ****/
757 /*************************************************************************/ 773 /*************************************************************************/
758 /*************************************************************************/ 774 /*************************************************************************/
759 775
760 776
761 /*************************************************************************/ 777 /*************************************************************************/
762 /* */ 778 /* */
779 /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */
780 /* possible to set up the default values of the four control points that */
781 /* define the stem darkening behaviour of the (new) CFF engine. For */
782 /* more details please read the documentation of the */
783 /* `darkening-parameters' property of the cff driver module (file */
784 /* `ftcffdrv.h'), which allows the control at run-time. */
785 /* */
786 /* Do *not* undefine these macros! */
787 /* */
788 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
789 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
790
791 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
792 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
793
794 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
795 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
796
797 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
798 #define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
799
800
801 /*************************************************************************/
802 /* */
763 /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ 803 /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */
764 /* engine gets compiled into FreeType. If defined, it is possible to */ 804 /* engine gets compiled into FreeType. If defined, it is possible to */
765 /* switch between the two engines using the `hinting-engine' property of */ 805 /* switch between the two engines using the `hinting-engine' property of */
766 /* the cff driver module. */ 806 /* the cff driver module. */
767 /* */ 807 /* */
768 /* #define CFF_CONFIG_OPTION_OLD_ENGINE */ 808 /* #define CFF_CONFIG_OPTION_OLD_ENGINE */
769 809
770 810
771 /*************************************************************************/ 811 /*************************************************************************/
772 /*************************************************************************/ 812 /*************************************************************************/
(...skipping 18 matching lines...) Expand all
791 #define AF_CONFIG_OPTION_INDIC 831 #define AF_CONFIG_OPTION_INDIC
792 832
793 /*************************************************************************/ 833 /*************************************************************************/
794 /* */ 834 /* */
795 /* Compile autofit module with warp hinting. The idea of the warping */ 835 /* Compile autofit module with warp hinting. The idea of the warping */
796 /* code is to slightly scale and shift a glyph within a single dimension */ 836 /* code is to slightly scale and shift a glyph within a single dimension */
797 /* so that as much of its segments are aligned (more or less) on the */ 837 /* so that as much of its segments are aligned (more or less) on the */
798 /* grid. To find out the optimal scaling and shifting value, various */ 838 /* grid. To find out the optimal scaling and shifting value, various */
799 /* parameter combinations are tried and scored. */ 839 /* parameter combinations are tried and scored. */
800 /* */ 840 /* */
801 /* This experimental option is only active if the render mode is */ 841 /* This experimental option is active only if the rendering mode is */
802 /* FT_RENDER_MODE_LIGHT. */ 842 /* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
843 /* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
844 /* information; by default it is switched off). */
803 /* */ 845 /* */
804 /* #define AF_CONFIG_OPTION_USE_WARPER */ 846 /* #define AF_CONFIG_OPTION_USE_WARPER */
805 847
806 /* */ 848 /* */
807 849
808 850
809 /* 851 /*
810 * This macro is obsolete. Support has been removed in FreeType 852 * This macro is obsolete. Support has been removed in FreeType
811 * version 2.5. 853 * version 2.5.
812 */ 854 */
813 /* #define FT_CONFIG_OPTION_OLD_INTERNALS */ 855 /* #define FT_CONFIG_OPTION_OLD_INTERNALS */
814 856
815 857
816 /* 858 /*
817 * This macro is defined if either unpatented or native TrueType 859 * This macro is defined if either unpatented or native TrueType
818 * hinting is requested by the definitions above. 860 * hinting is requested by the definitions above.
819 */ 861 */
820 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER 862 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
821 #define TT_USE_BYTECODE_INTERPRETER 863 #define TT_USE_BYTECODE_INTERPRETER
822 #undef TT_CONFIG_OPTION_UNPATENTED_HINTING 864 #undef TT_CONFIG_OPTION_UNPATENTED_HINTING
823 #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING 865 #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
824 #define TT_USE_BYTECODE_INTERPRETER 866 #define TT_USE_BYTECODE_INTERPRETER
825 #endif 867 #endif
826 868
869
870 /*
871 * Check CFF darkening parameters. The checks are the same as in function
872 * `cff_property_set' in file `cffdrivr.c'.
873 */
874 #if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \
875 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \
876 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \
877 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \
878 \
879 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \
880 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \
881 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \
882 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \
883 \
884 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \
885 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \
886 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \
887 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \
888 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \
889 CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \
890 \
891 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \
892 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \
893 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \
894 CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500
895 #error "Invalid CFF darkening parameters!"
896 #endif
897
827 FT_END_HEADER 898 FT_END_HEADER
828 899
829 900
830 #endif /* __FTOPTION_H__ */ 901 #endif /* __FTOPTION_H__ */
831 902
832 903
833 /* END */ 904 /* END */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698