| 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 kFontWeight100; | 119 return kFontWeight100; |
| 120 | 120 |
| 121 case kFontWeight600: | 121 case kFontWeight600: |
| 122 case kFontWeight700: | 122 case kFontWeight700: |
| 123 return kFontWeight400; | 123 return kFontWeight400; |
| 124 | 124 |
| 125 case kFontWeight800: | 125 case kFontWeight800: |
| 126 case kFontWeight900: | 126 case kFontWeight900: |
| 127 return kFontWeight700; | 127 return kFontWeight700; |
| 128 } | 128 } |
| 129 ASSERT_NOT_REACHED(); | 129 NOTREACHED(); |
| 130 return kFontWeightNormal; | 130 return kFontWeightNormal; |
| 131 } | 131 } |
| 132 | 132 |
| 133 FontWeight FontDescription::BolderWeight(FontWeight weight) { | 133 FontWeight FontDescription::BolderWeight(FontWeight weight) { |
| 134 switch (weight) { | 134 switch (weight) { |
| 135 case kFontWeight100: | 135 case kFontWeight100: |
| 136 case kFontWeight200: | 136 case kFontWeight200: |
| 137 case kFontWeight300: | 137 case kFontWeight300: |
| 138 return kFontWeight400; | 138 return kFontWeight400; |
| 139 | 139 |
| 140 case kFontWeight400: | 140 case kFontWeight400: |
| 141 case kFontWeight500: | 141 case kFontWeight500: |
| 142 return kFontWeight700; | 142 return kFontWeight700; |
| 143 | 143 |
| 144 case kFontWeight600: | 144 case kFontWeight600: |
| 145 case kFontWeight700: | 145 case kFontWeight700: |
| 146 case kFontWeight800: | 146 case kFontWeight800: |
| 147 case kFontWeight900: | 147 case kFontWeight900: |
| 148 return kFontWeight900; | 148 return kFontWeight900; |
| 149 } | 149 } |
| 150 ASSERT_NOT_REACHED(); | 150 NOTREACHED(); |
| 151 return kFontWeightNormal; | 151 return kFontWeightNormal; |
| 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.is_absolute); | 155 return Size(0, size.value * 1.2, size.is_absolute); |
| 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.is_absolute); | 159 return Size(0, size.value / 1.2, size.is_absolute); |
| 160 } | 160 } |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); | 361 "FontStretchUltraCondensed should map to kUltraCondensed_Width"); |
| 362 static_assert(static_cast<int>(kFontStretchNormal) == | 362 static_assert(static_cast<int>(kFontStretchNormal) == |
| 363 static_cast<int>(SkFontStyle::kNormal_Width), | 363 static_cast<int>(SkFontStyle::kNormal_Width), |
| 364 "FontStretchNormal should map to kNormal_Width"); | 364 "FontStretchNormal should map to kNormal_Width"); |
| 365 static_assert(static_cast<int>(kFontStretchUltraExpanded) == | 365 static_assert(static_cast<int>(kFontStretchUltraExpanded) == |
| 366 static_cast<int>(SkFontStyle::kUltraExpanded_Width), | 366 static_cast<int>(SkFontStyle::kUltraExpanded_Width), |
| 367 "FontStretchUltraExpanded should map to kUltraExpanded_Width"); | 367 "FontStretchUltraExpanded should map to kUltraExpanded_Width"); |
| 368 } | 368 } |
| 369 | 369 |
| 370 } // namespace blink | 370 } // namespace blink |
| OLD | NEW |