OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkFont_DEFINED | 8 #ifndef SkFont_DEFINED |
9 #define SkFont_DEFINED | 9 #define SkFont_DEFINED |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 What to do if the font's mask-type disagrees with the paint? | 69 What to do if the font's mask-type disagrees with the paint? |
70 | 70 |
71 */ | 71 */ |
72 | 72 |
73 class SkFont : public SkRefCnt { | 73 class SkFont : public SkRefCnt { |
74 public: | 74 public: |
75 enum Flags { | 75 enum Flags { |
76 /** | 76 /** |
77 * Use the system's automatic hinting mechanism to hint the typeface. | 77 * Use the system's automatic hinting mechanism to hint the typeface. |
78 * If both bytecode and auto hints are specified, attempt to use the by
tecodes first. | 78 * This is a last resort hinting method applied only if other hinting m
ethods do not apply. |
79 * If that fails (e.g. there are no codes), then attempt to autohint. | 79 * TODO: where to put auto-normal vs auto-light? |
80 */ | 80 */ |
81 kEnableAutoHints_Flag = 1 << 0, | 81 kEnableAutoHints_Flag = 1 << 0, |
82 | 82 |
83 /** | 83 /** |
84 * If the typeface contains explicit bytecodes for hinting, use them. | 84 * If the typeface contains explicit bytecodes for hinting, use them. |
85 * If both bytecode and auto hints are specified, attempt to use the by
tecodes first; | 85 * If both bytecode and auto hints are specified, attempt to use the by
tecodes first; |
86 * if that fails (e.g. there are no codes), then attempt to autohint. | 86 * if that fails (e.g. there are no codes), then attempt to autohint. |
87 */ | 87 */ |
88 kEnableByteCodeHints_Flag = 1 << 1, | 88 kEnableByteCodeHints_Flag = 1 << 1, |
89 | 89 |
90 /** | 90 /** |
| 91 * If the typeface contains explicit bitmaps for hinting, use them. |
| 92 * If both bytecode and auto hints are also specified, attempt to use t
he bitmaps first; |
| 93 * if that fails (e.g. there are no bitmaps), then attempt to bytecode
or autohint. |
| 94 */ |
| 95 kEmbeddedBitmaps_Flag = 1 << 2, |
| 96 |
| 97 /** |
91 * Use rounded metric values (e.g. advance). | 98 * Use rounded metric values (e.g. advance). |
92 * If either auto or bytecode hinting was used, apply those results to
the metrics of the | 99 * If either auto or bytecode hinting was used, apply those results to
the metrics of the |
93 * glyphs as well. If no hinting was applied, the metrics will just be
rounded to the | 100 * glyphs as well. If no hinting was applied, the metrics will just be
rounded to the |
94 * nearest integer. | 101 * nearest integer. |
95 * | 102 * |
96 * This applies to calls that return metrics (e.g. measureText) and to
drawing the glyphs | 103 * This applies to calls that return metrics (e.g. measureText) and to
drawing the glyphs |
97 * (see SkCanvas drawText and drawPosText). | 104 * (see SkCanvas drawText and drawPosText). |
98 */ | 105 */ |
99 kUseNonlinearMetrics_Flag = 1 << 2, | 106 kUseNonlinearMetrics_Flag = 1 << 3, |
100 | 107 |
101 kVertical_Flag = 1 << 3, | 108 kVertical_Flag = 1 << 4, |
102 kEmbeddedBitmaps_Flag = 1 << 4, | |
103 kGenA8FromLCD_Flag = 1 << 5, | 109 kGenA8FromLCD_Flag = 1 << 5, |
104 kEmbolden_Flag = 1 << 6, | 110 kEmbolden_Flag = 1 << 6, |
105 kDevKern_Flag = 1 << 7, // ifdef ANDROID ? | 111 kDevKern_Flag = 1 << 7, // ifdef ANDROID ? |
106 }; | 112 }; |
107 | 113 |
108 enum MaskType { | 114 enum MaskType { |
109 kBW_MaskType, | 115 kBW_MaskType, |
110 kA8_MaskType, | 116 kA8_MaskType, |
111 kLCD_MaskType, | 117 kLCD_MaskType, |
112 }; | 118 }; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 SkTypeface* fTypeface; | 158 SkTypeface* fTypeface; |
153 SkScalar fSize; | 159 SkScalar fSize; |
154 SkScalar fScaleX; | 160 SkScalar fScaleX; |
155 SkScalar fSkewX; | 161 SkScalar fSkewX; |
156 uint16_t fFlags; | 162 uint16_t fFlags; |
157 uint8_t fMaskType; | 163 uint8_t fMaskType; |
158 // uint8_t fPad; | 164 // uint8_t fPad; |
159 }; | 165 }; |
160 | 166 |
161 #endif | 167 #endif |
OLD | NEW |