| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 case FontDescription::NoneKerning: | 175 case FontDescription::NoneKerning: |
| 176 m_typesettingFeatures &= ~WebCore::Kerning; | 176 m_typesettingFeatures &= ~WebCore::Kerning; |
| 177 break; | 177 break; |
| 178 case FontDescription::NormalKerning: | 178 case FontDescription::NormalKerning: |
| 179 m_typesettingFeatures |= WebCore::Kerning; | 179 m_typesettingFeatures |= WebCore::Kerning; |
| 180 break; | 180 break; |
| 181 case FontDescription::AutoKerning: | 181 case FontDescription::AutoKerning: |
| 182 break; | 182 break; |
| 183 } | 183 } |
| 184 | 184 |
| 185 switch (commonLigaturesState()) { | 185 // As per CSS (http://dev.w3.org/csswg/css-text-3/#letter-spacing-property), |
| 186 case FontDescription::DisabledLigaturesState: | 186 // When the effective letter-spacing between two characters is not zero (due
to |
| 187 m_typesettingFeatures &= ~Ligatures; | 187 // either justification or non-zero computed letter-spacing), user agents sh
ould |
| 188 break; | 188 // not apply optional ligatures. |
| 189 case FontDescription::EnabledLigaturesState: | 189 if (m_letterSpacing == 0) { |
| 190 m_typesettingFeatures |= Ligatures; | 190 switch (commonLigaturesState()) { |
| 191 break; | 191 case FontDescription::DisabledLigaturesState: |
| 192 case FontDescription::NormalLigaturesState: | 192 m_typesettingFeatures &= ~Ligatures; |
| 193 break; | 193 break; |
| 194 } | 194 case FontDescription::EnabledLigaturesState: |
| 195 m_typesettingFeatures |= Ligatures; |
| 196 break; |
| 197 case FontDescription::NormalLigaturesState: |
| 198 break; |
| 199 } |
| 195 | 200 |
| 196 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesState | 201 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt
ate |
| 197 || historicalLigaturesState() == FontDescription::EnabledLigaturesState | 202 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt
ate |
| 198 || contextualLigaturesState() == FontDescription::EnabledLigaturesState)
{ | 203 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt
ate) { |
| 199 m_typesettingFeatures |= WebCore::Ligatures; | 204 m_typesettingFeatures |= WebCore::Ligatures; |
| 205 } |
| 200 } | 206 } |
| 201 } | 207 } |
| 202 | 208 |
| 203 } // namespace WebCore | 209 } // namespace WebCore |
| OLD | NEW |