| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr
ecisionMultiplier(); | 126 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr
ecisionMultiplier(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 FontCacheKey FontDescription::cacheKey(const AtomicString& familyName, FontTrait
s desiredTraits) const | 129 FontCacheKey FontDescription::cacheKey(const AtomicString& familyName, FontTrait
s desiredTraits) const |
| 130 { | 130 { |
| 131 FontTraits fontTraits = desiredTraits.mask() | 131 FontTraits fontTraits = desiredTraits.mask() |
| 132 ? desiredTraits | 132 ? desiredTraits |
| 133 : traits(); | 133 : traits(); |
| 134 | 134 |
| 135 unsigned options = | 135 unsigned options = |
| 136 static_cast<unsigned>(m_syntheticItalic) << 8 | // bit 9 | 136 static_cast<unsigned>(m_syntheticItalic) << 7 | // bit 8 |
| 137 static_cast<unsigned>(m_syntheticBold) << 7 | // bit 8 | 137 static_cast<unsigned>(m_syntheticBold) << 6 | // bit 7 |
| 138 static_cast<unsigned>(m_fontSmoothing) << 5 | // bits 6-7 | 138 static_cast<unsigned>(m_fontSmoothing) << 4 | // bits 5-6 |
| 139 static_cast<unsigned>(m_textRendering) << 3 | // bits 4-5 | 139 static_cast<unsigned>(m_textRendering) << 2 | // bits 3-4 |
| 140 static_cast<unsigned>(m_orientation) << 2 | // bit 3 | 140 static_cast<unsigned>(m_orientation) << 1 | // bit 2 |
| 141 static_cast<unsigned>(m_usePrinterFont) << 1 | // bit 2 | |
| 142 static_cast<unsigned>(m_subpixelTextPosition); // bit 1 | 141 static_cast<unsigned>(m_subpixelTextPosition); // bit 1 |
| 143 | 142 |
| 144 return FontCacheKey(familyName, effectiveFontSize(), options | fontTraits.ma
sk() << 9); | 143 return FontCacheKey(familyName, effectiveFontSize(), options | fontTraits.ma
sk() << 8); |
| 145 } | 144 } |
| 146 | 145 |
| 147 | 146 |
| 148 void FontDescription::setDefaultTypesettingFeatures(TypesettingFeatures typesett
ingFeatures) | 147 void FontDescription::setDefaultTypesettingFeatures(TypesettingFeatures typesett
ingFeatures) |
| 149 { | 148 { |
| 150 s_defaultTypesettingFeatures = typesettingFeatures; | 149 s_defaultTypesettingFeatures = typesettingFeatures; |
| 151 } | 150 } |
| 152 | 151 |
| 153 TypesettingFeatures FontDescription::defaultTypesettingFeatures() | 152 TypesettingFeatures FontDescription::defaultTypesettingFeatures() |
| 154 { | 153 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 193 } |
| 195 | 194 |
| 196 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesState | 195 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesState |
| 197 || historicalLigaturesState() == FontDescription::EnabledLigaturesState | 196 || historicalLigaturesState() == FontDescription::EnabledLigaturesState |
| 198 || contextualLigaturesState() == FontDescription::EnabledLigaturesState)
{ | 197 || contextualLigaturesState() == FontDescription::EnabledLigaturesState)
{ |
| 199 m_typesettingFeatures |= WebCore::Ligatures; | 198 m_typesettingFeatures |= WebCore::Ligatures; |
| 200 } | 199 } |
| 201 } | 200 } |
| 202 | 201 |
| 203 } // namespace WebCore | 202 } // namespace WebCore |
| OLD | NEW |