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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontDescription.cpp
diff --git a/Source/platform/fonts/FontDescription.cpp b/Source/platform/fonts/FontDescription.cpp
index c98aac2e785f42ba763c6b6bd7bb3cb6912ac26b..4f84d9f0cc0e56498d016f843c5fd3ee7e361b4a 100644
--- a/Source/platform/fonts/FontDescription.cpp
+++ b/Source/platform/fonts/FontDescription.cpp
@@ -182,21 +182,27 @@ void FontDescription::updateTypesettingFeatures() const
break;
}
- switch (commonLigaturesState()) {
- case FontDescription::DisabledLigaturesState:
- m_typesettingFeatures &= ~Ligatures;
- break;
- case FontDescription::EnabledLigaturesState:
- m_typesettingFeatures |= Ligatures;
- break;
- case FontDescription::NormalLigaturesState:
- break;
- }
-
- if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesState
- || historicalLigaturesState() == FontDescription::EnabledLigaturesState
- || contextualLigaturesState() == FontDescription::EnabledLigaturesState) {
- m_typesettingFeatures |= WebCore::Ligatures;
+ // As per CSS (http://dev.w3.org/csswg/css-text-3/#letter-spacing-property),
+ // When the effective letter-spacing between two characters is not zero (due to
+ // either justification or non-zero computed letter-spacing), user agents should
+ // not apply optional ligatures.
+ if (m_letterSpacing == 0) {
+ switch (commonLigaturesState()) {
+ case FontDescription::DisabledLigaturesState:
+ m_typesettingFeatures &= ~Ligatures;
+ break;
+ case FontDescription::EnabledLigaturesState:
+ m_typesettingFeatures |= Ligatures;
+ break;
+ case FontDescription::NormalLigaturesState:
+ break;
+ }
+
+ if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesState
+ || historicalLigaturesState() == FontDescription::EnabledLigaturesState
+ || contextualLigaturesState() == FontDescription::EnabledLigaturesState) {
+ m_typesettingFeatures |= WebCore::Ligatures;
+ }
}
}
« 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