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

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: 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
Index: Source/platform/fonts/FontDescription.cpp
diff --git a/Source/platform/fonts/FontDescription.cpp b/Source/platform/fonts/FontDescription.cpp
index a50c9019eb926db3eb48505c780233ed54144ccf..a59f8015d2c50ed8ddbb2766df0210484d67fffb 100644
--- a/Source/platform/fonts/FontDescription.cpp
+++ b/Source/platform/fonts/FontDescription.cpp
@@ -182,21 +182,26 @@ 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://www.w3.org/TR/CSS2/text.html#propdef-letter-spacing),
Inactive 2014/06/09 13:09:44 Please always point to the latest version of the s
h.joshi 2014/06/09 13:33:53 In "https://developer.mozilla.org/en-US/docs/Web/C
+ // when the resultant space between two characters
+ // is not the same as the default space, user agents should not use 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;
+ }
}
}
« LayoutTests/fast/text/font-ligature-letter-spacing.html ('K') | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698