Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: Source/platform/fonts/FontDescription.cpp

Issue 325673002: Fixing handling of Ligature when letter-spacing is present (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code Issue fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698