OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com> | 2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com> |
3 * Copyright (C) 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return FontWeight100; | 119 return FontWeight100; |
120 | 120 |
121 case FontWeight600: | 121 case FontWeight600: |
122 case FontWeight700: | 122 case FontWeight700: |
123 return FontWeight400; | 123 return FontWeight400; |
124 | 124 |
125 case FontWeight800: | 125 case FontWeight800: |
126 case FontWeight900: | 126 case FontWeight900: |
127 return FontWeight700; | 127 return FontWeight700; |
128 } | 128 } |
129 ASSERT_NOT_REACHED(); | 129 NOTREACHED(); |
130 return FontWeightNormal; | 130 return FontWeightNormal; |
131 } | 131 } |
132 | 132 |
133 FontWeight FontDescription::bolderWeight(FontWeight weight) { | 133 FontWeight FontDescription::bolderWeight(FontWeight weight) { |
134 switch (weight) { | 134 switch (weight) { |
135 case FontWeight100: | 135 case FontWeight100: |
136 case FontWeight200: | 136 case FontWeight200: |
137 case FontWeight300: | 137 case FontWeight300: |
138 return FontWeight400; | 138 return FontWeight400; |
139 | 139 |
140 case FontWeight400: | 140 case FontWeight400: |
141 case FontWeight500: | 141 case FontWeight500: |
142 return FontWeight700; | 142 return FontWeight700; |
143 | 143 |
144 case FontWeight600: | 144 case FontWeight600: |
145 case FontWeight700: | 145 case FontWeight700: |
146 case FontWeight800: | 146 case FontWeight800: |
147 case FontWeight900: | 147 case FontWeight900: |
148 return FontWeight900; | 148 return FontWeight900; |
149 } | 149 } |
150 ASSERT_NOT_REACHED(); | 150 NOTREACHED(); |
151 return FontWeightNormal; | 151 return FontWeightNormal; |
152 } | 152 } |
153 | 153 |
154 FontDescription::Size FontDescription::largerSize(const Size& size) { | 154 FontDescription::Size FontDescription::largerSize(const Size& size) { |
155 return Size(0, size.value * 1.2, size.isAbsolute); | 155 return Size(0, size.value * 1.2, size.isAbsolute); |
156 } | 156 } |
157 | 157 |
158 FontDescription::Size FontDescription::smallerSize(const Size& size) { | 158 FontDescription::Size FontDescription::smallerSize(const Size& size) { |
159 return Size(0, size.value / 1.2, size.isAbsolute); | 159 return Size(0, size.value / 1.2, size.isAbsolute); |
160 } | 160 } |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); | 359 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); |
360 static_assert(static_cast<int>(FontStretchNormal) == | 360 static_assert(static_cast<int>(FontStretchNormal) == |
361 static_cast<int>(SkFontStyle::kNormal_Width), | 361 static_cast<int>(SkFontStyle::kNormal_Width), |
362 "FontStretchNormal should map to kNormal_Width"); | 362 "FontStretchNormal should map to kNormal_Width"); |
363 static_assert(static_cast<int>(FontStretchUltraExpanded) == | 363 static_assert(static_cast<int>(FontStretchUltraExpanded) == |
364 static_cast<int>(SkFontStyle::kUltraExpanded_Width), | 364 static_cast<int>(SkFontStyle::kUltraExpanded_Width), |
365 "FontStretchUltraExpanded should map to kUltraExpanded_Width"); | 365 "FontStretchUltraExpanded should map to kUltraExpanded_Width"); |
366 } | 366 } |
367 | 367 |
368 } // namespace blink | 368 } // namespace blink |
OLD | NEW |