4
4
/* */
5
5
/* User-selectable configuration macros (specification only). */
6
6
/* */
7
- /* Copyright 1996-2015 by */
7
+ /* Copyright 1996-2016 by */
8
8
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
9
9
/* */
10
10
/* This file is part of the FreeType project, and may only be used, */
16
16
/***************************************************************************/
17
17
18
18
19
- #ifndef __FTOPTION_H__
20
- #define __FTOPTION_H__
19
+ #ifndef FTOPTION_H_
20
+ #define FTOPTION_H_
21
21
22
22
23
23
#include <ft2build.h>
@@ -75,6 +75,36 @@ FT_BEGIN_HEADER
75
75
/*************************************************************************/
76
76
77
77
78
+ /*************************************************************************/
79
+ /* */
80
+ /* If you enable this configuration option, FreeType recognizes an */
81
+ /* environment variable called `FREETYPE_PROPERTIES', which can be used */
82
+ /* to control the various font drivers and modules. The controllable */
83
+ /* properties are listed in the section `Controlling FreeType Modules' */
84
+ /* in the reference's table of contents; currently there are properties */
85
+ /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */
86
+ /* TrueType (file `ftttdrv.h'). */
87
+ /* */
88
+ /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
89
+ /* multiple lines for better readability). */
90
+ /* */
91
+ /* <optional whitespace> */
92
+ /* <module-name1> ':' */
93
+ /* <property-name1> '=' <property-value1> */
94
+ /* <whitespace> */
95
+ /* <module-name2> ':' */
96
+ /* <property-name2> '=' <property-value2> */
97
+ /* ... */
98
+ /* */
99
+ /* Example: */
100
+ /* */
101
+ /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
102
+ /* cff:no-stem-darkening=1 \ */
103
+ /* autofitter:warping=1 */
104
+ /* */
105
+ /* #define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES */
106
+
107
+
78
108
/*************************************************************************/
79
109
/* */
80
110
/* Uncomment the line below if you want to activate sub-pixel rendering */
@@ -492,7 +522,21 @@ FT_BEGIN_HEADER
492
522
/* code will be used. */
493
523
/* */
494
524
/* Setting this macro is needed for systems that prohibit address */
495
- /* fixups, such as BREW. */
525
+ /* fixups, such as BREW. [Note that standard compilers like gcc or */
526
+ /* clang handle PIC generation automatically; you don't have to set */
527
+ /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
528
+ /* compilers.] */
529
+ /* */
530
+ /* Note that FT_CONFIG_OPTION_PIC support is not available for all */
531
+ /* modules (see `modules.cfg' for a complete list). For building with */
532
+ /* FT_CONFIG_OPTION_PIC support, do the following. */
533
+ /* */
534
+ /* 0. Clone the repository. */
535
+ /* 1. Define FT_CONFIG_OPTION_PIC. */
536
+ /* 2. Remove all subdirectories in `src' that don't have */
537
+ /* FT_CONFIG_OPTION_PIC support. */
538
+ /* 3. Comment out the corresponding modules in `modules.cfg'. */
539
+ /* 4. Compile. */
496
540
/* */
497
541
/* #define FT_CONFIG_OPTION_PIC */
498
542
@@ -586,73 +630,53 @@ FT_BEGIN_HEADER
586
630
/*************************************************************************/
587
631
/* */
588
632
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
589
- /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
590
- /* replaces the native TrueType hinting mechanism when anything but */
591
- /* FT_RENDER_MODE_MONO is requested. */
592
- /* */
593
- /* Enabling this causes the TrueType driver to ignore instructions under */
594
- /* certain conditions. This is done in accordance with the guide here, */
595
- /* with some minor differences: */
633
+ /* subpixel hinting support into the TrueType driver. This modifies the */
634
+ /* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
635
+ /* requested. */
596
636
/* */
597
- /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
637
+ /* In particular, it modifies the bytecode interpreter to interpret (or */
638
+ /* not) instructions in a certain way so that all TrueType fonts look */
639
+ /* like they do in a Windows ClearType (DirectWrite) environment. See */
640
+ /* [1] for a technical overview on what this means. See `ttinterp.h' */
641
+ /* for more details on the LEAN option. */
598
642
/* */
599
- /* By undefining this, you only compile the code necessary to hint */
600
- /* TrueType glyphs with native TT hinting. */
643
+ /* There are three options. */
601
644
/* */
602
- /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
603
- /* defined. */
645
+ /* 1. This option is associated with the `Infinality' moniker. */
646
+ /* Contributed by an individual nicknamed Infinality with the goal of */
647
+ /* making TrueType fonts render better than on Windows. A high */
648
+ /* amount of configurability and flexibility, down to rules for */
649
+ /* single glyphs in fonts, but also very slow. Its experimental and */
650
+ /* slow nature and the original developer losing interest meant that */
651
+ /* this option was never enabled in default builds. */
604
652
/* */
605
- /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
606
-
607
-
608
- /*************************************************************************/
653
+ /* 2. The new default mode for the TrueType driver. The Infinality code */
654
+ /* base was stripped to the bare minimum and all configurability */
655
+ /* removed in the name of speed and simplicity. The configurability */
656
+ /* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
657
+ /* Courier. Legacy fonts are fonts that modify vertical stems to */
658
+ /* achieve clean black-and-white bitmaps. The new mode focuses on */
659
+ /* applying a minimal set of rules to all fonts indiscriminately so */
660
+ /* that modern and web fonts render well while legacy fonts render */
661
+ /* okay. */
609
662
/* */
610
- /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
611
- /* of the TrueType bytecode interpreter is used that doesn't implement */
612
- /* any of the patented opcodes and algorithms. The patents related to */
613
- /* TrueType hinting have expired worldwide since May 2010; this option */
614
- /* is now deprecated. */
663
+ /* 3. Compile both. */
615
664
/* */
616
- /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
617
- /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
618
- /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
619
- /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
665
+ /* By undefining these, you get rendering behavior like on Windows */
666
+ /* without ClearType, i.e., Windows XP without ClearType enabled and */
667
+ /* Win9x (interpreter version v35). Or not, depending on how much */
668
+ /* hinting blood and testing tears the font designer put into a given */
669
+ /* font. If you define one or both subpixel hinting options, you can */
670
+ /* switch between between v35 and the ones you define. */
620
671
/* */
621
- /* This macro is only useful for a small number of font files (mostly */
622
- /* for Asian scripts) that require bytecode interpretation to properly */
623
- /* load glyphs. For all other fonts, this produces unpleasant results, */
624
- /* thus the unpatented interpreter is never used to load glyphs from */
625
- /* TrueType fonts unless one of the following two options is used. */
672
+ /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
673
+ /* defined. */
626
674
/* */
627
- /* - The unpatented interpreter is explicitly activated by the user */
628
- /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
629
- /* when opening the FT_Face. */
675
+ /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
630
676
/* */
631
- /* - FreeType detects that the FT_Face corresponds to one of the */
632
- /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
633
- /* contains a hard-coded list of font names and other matching */
634
- /* parameters (see function `tt_face_init' in file */
635
- /* `src/truetype/ttobjs.c'). */
636
- /* */
637
- /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
638
- /* */
639
- /* { */
640
- /* FT_Parameter parameter; */
641
- /* FT_Open_Args open_args; */
642
- /* */
643
- /* */
644
- /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
645
- /* */
646
- /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
647
- /* open_args.pathname = my_font_pathname; */
648
- /* open_args.num_params = 1; */
649
- /* open_args.params = ¶meter; */
650
- /* */
651
- /* error = FT_Open_Face( library, &open_args, index, &face ); */
652
- /* ... */
653
- /* } */
654
- /* */
655
- /* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
677
+ /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
678
+ /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
679
+ /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
656
680
657
681
658
682
/*************************************************************************/
@@ -843,7 +867,7 @@ FT_BEGIN_HEADER
843
867
/* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
844
868
/* information; by default it is switched off). */
845
869
/* */
846
- /* #define AF_CONFIG_OPTION_USE_WARPER */
870
+ #define AF_CONFIG_OPTION_USE_WARPER
847
871
848
872
/* */
849
873
@@ -856,14 +880,19 @@ FT_BEGIN_HEADER
856
880
857
881
858
882
/*
859
- * This macro is defined if either unpatented or native TrueType
860
- * hinting is requested by the definitions above.
883
+ * This macro is defined if native TrueType hinting is requested by the
884
+ * definitions above.
861
885
*/
862
886
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
863
887
#define TT_USE_BYTECODE_INTERPRETER
864
- #undef TT_CONFIG_OPTION_UNPATENTED_HINTING
865
- #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
866
- #define TT_USE_BYTECODE_INTERPRETER
888
+
889
+ #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
890
+ #define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
891
+ #endif
892
+
893
+ #if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
894
+ #define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
895
+ #endif
867
896
#endif
868
897
869
898
@@ -898,7 +927,7 @@ FT_BEGIN_HEADER
898
927
FT_END_HEADER
899
928
900
929
901
- #endif /* __FTOPTION_H__ */
930
+ #endif /* FTOPTION_H_ */
902
931
903
932
904
933
/* END */
0 commit comments