| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void FontDescription::setVariantLigatures(const VariantLigatures& ligatures) | 124 void FontDescription::setVariantLigatures(const VariantLigatures& ligatures) |
| 125 { | 125 { |
| 126 m_commonLigaturesState = ligatures.common; | 126 m_commonLigaturesState = ligatures.common; |
| 127 m_discretionaryLigaturesState = ligatures.discretionary; | 127 m_discretionaryLigaturesState = ligatures.discretionary; |
| 128 m_historicalLigaturesState = ligatures.historical; | 128 m_historicalLigaturesState = ligatures.historical; |
| 129 m_contextualLigaturesState = ligatures.contextual; | 129 m_contextualLigaturesState = ligatures.contextual; |
| 130 | 130 |
| 131 updateTypesettingFeatures(); | 131 updateTypesettingFeatures(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 FontDescription FontDescription::makeNormalFeatureSettings() const | |
| 135 { | |
| 136 FontDescription normalDescription(*this); | |
| 137 normalDescription.setFeatureSettings(nullptr); | |
| 138 return normalDescription; | |
| 139 } | |
| 140 | |
| 141 float FontDescription::effectiveFontSize() const | 134 float FontDescription::effectiveFontSize() const |
| 142 { | 135 { |
| 143 float size = (RuntimeEnabledFeatures::subpixelFontScalingEnabled()) | 136 float size = (RuntimeEnabledFeatures::subpixelFontScalingEnabled()) |
| 144 ? computedSize() | 137 ? computedSize() |
| 145 : computedPixelSize(); | 138 : computedPixelSize(); |
| 146 | 139 |
| 147 // Ensure that the effective precision matches the font-cache precision. | 140 // Ensure that the effective precision matches the font-cache precision. |
| 148 // This guarantees that the same precision is used regardless of cache statu
s. | 141 // This guarantees that the same precision is used regardless of cache statu
s. |
| 149 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr
ecisionMultiplier(); | 142 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr
ecisionMultiplier(); |
| 150 } | 143 } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 213 |
| 221 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt
ate | 214 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt
ate |
| 222 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt
ate | 215 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt
ate |
| 223 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt
ate) { | 216 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt
ate) { |
| 224 m_typesettingFeatures |= blink::Ligatures; | 217 m_typesettingFeatures |= blink::Ligatures; |
| 225 } | 218 } |
| 226 } | 219 } |
| 227 } | 220 } |
| 228 | 221 |
| 229 } // namespace blink | 222 } // namespace blink |
| OLD | NEW |