229a6cf055b5713885b015feebcffad19c1fc11b
[platform/upstream/freetype2.git] / src / truetype / ttsubpix.h
1 /****************************************************************************
2  *
3  * ttsubpix.h
4  *
5  *   TrueType Subpixel Hinting.
6  *
7  * Copyright (C) 2010-2020 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 TTSUBPIX_H_
20 #define TTSUBPIX_H_
21
22 #include "ttobjs.h"
23 #include "ttinterp.h"
24
25
26 FT_BEGIN_HEADER
27
28
29 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
30
31   /**************************************************************************
32    *
33    * ID flags to identify special functions at FDEF and runtime.
34    *
35    */
36 #define SPH_FDEF_INLINE_DELTA_1       0x0000001
37 #define SPH_FDEF_INLINE_DELTA_2       0x0000002
38 #define SPH_FDEF_DIAGONAL_STROKE      0x0000004
39 #define SPH_FDEF_VACUFORM_ROUND_1     0x0000008
40 #define SPH_FDEF_TTFAUTOHINT_1        0x0000010
41 #define SPH_FDEF_SPACING_1            0x0000020
42 #define SPH_FDEF_SPACING_2            0x0000040
43 #define SPH_FDEF_TYPEMAN_STROKES      0x0000080
44 #define SPH_FDEF_TYPEMAN_DIAGENDCTRL  0x0000100
45
46
47   /**************************************************************************
48    *
49    * Tweak flags that are set for each glyph by the below rules.
50    *
51    */
52 #define SPH_TWEAK_ALLOW_X_DMOVE                   0x0000001UL
53 #define SPH_TWEAK_ALWAYS_DO_DELTAP                0x0000002UL
54 #define SPH_TWEAK_ALWAYS_SKIP_DELTAP              0x0000004UL
55 #define SPH_TWEAK_COURIER_NEW_2_HACK              0x0000008UL
56 #define SPH_TWEAK_DEEMBOLDEN                      0x0000010UL
57 #define SPH_TWEAK_DO_SHPIX                        0x0000020UL
58 #define SPH_TWEAK_EMBOLDEN                        0x0000040UL
59 #define SPH_TWEAK_MIAP_HACK                       0x0000080UL
60 #define SPH_TWEAK_NORMAL_ROUND                    0x0000100UL
61 #define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP            0x0000200UL
62 #define SPH_TWEAK_NO_CALL_AFTER_IUP               0x0000400UL
63 #define SPH_TWEAK_NO_DELTAP_AFTER_IUP             0x0000800UL
64 #define SPH_TWEAK_PIXEL_HINTING                   0x0001000UL
65 #define SPH_TWEAK_RASTERIZER_35                   0x0002000UL
66 #define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES          0x0004000UL
67 #define SPH_TWEAK_SKIP_IUP                        0x0008000UL
68 #define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES           0x0010000UL
69 #define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES           0x0020000UL
70 #define SPH_TWEAK_TIMES_NEW_ROMAN_HACK            0x0040000UL
71 #define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP    0x0080000UL
72
73
74   FT_LOCAL( FT_Bool )
75   sph_test_tweak( TT_Face               face,
76                   const FT_String*      family,
77                   FT_UInt               ppem,
78                   const FT_String*      style,
79                   FT_UInt               glyph_index,
80                   const SPH_TweakRule*  rule,
81                   FT_UInt               num_rules );
82
83   FT_LOCAL( FT_UInt )
84   sph_test_tweak_x_scaling( TT_Face           face,
85                             const FT_String*  family,
86                             FT_UInt           ppem,
87                             const FT_String*  style,
88                             FT_UInt           glyph_index );
89
90   FT_LOCAL( void )
91   sph_set_tweaks( TT_Loader  loader,
92                   FT_UInt    glyph_index );
93
94
95   /* These macros are defined absent a method for setting them */
96 #define SPH_OPTION_BITMAP_WIDTHS           FALSE
97 #define SPH_OPTION_SET_SUBPIXEL            TRUE
98 #define SPH_OPTION_SET_GRAYSCALE           FALSE
99 #define SPH_OPTION_SET_COMPATIBLE_WIDTHS   FALSE
100 #define SPH_OPTION_SET_RASTERIZER_VERSION  38
101
102 #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
103
104
105 FT_END_HEADER
106
107 #endif /* TTSUBPIX_H_ */
108
109
110 /* END */