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

Unified Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 77413003: Make -webkit-font-variant-ligatures actually work. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reftests need ImageOnlyFailure, not Failure Created 6 years, 10 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 | « LayoutTests/fast/text/font-variant-ligatures-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index 8f4915a54c0bf6776e9c2654246d666bb0bb5363..0c5c683084096476c25c7e9e1de73269b867a3aa 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -521,6 +521,42 @@ void HarfBuzzShaper::setFontFeatures()
break;
}
+ static hb_feature_t noClig = { HB_TAG('c', 'l', 'i', 'g'), 0, 0, static_cast<unsigned>(-1) };
+ static hb_feature_t noLiga = { HB_TAG('l', 'i', 'g', 'a'), 0, 0, static_cast<unsigned>(-1) };
+ switch (description.commonLigaturesState()) {
+ case FontDescription::DisabledLigaturesState:
+ m_features.append(noLiga);
+ m_features.append(noClig);
+ break;
+ case FontDescription::EnabledLigaturesState:
+ // liga and clig are on by default
+ break;
+ case FontDescription::NormalLigaturesState:
+ break;
+ }
+ static hb_feature_t dlig = { HB_TAG('d', 'l', 'i', 'g'), 1, 0, static_cast<unsigned>(-1) };
+ switch (description.discretionaryLigaturesState()) {
+ case FontDescription::DisabledLigaturesState:
+ // dlig is off by default
+ break;
+ case FontDescription::EnabledLigaturesState:
+ m_features.append(dlig);
+ break;
+ case FontDescription::NormalLigaturesState:
+ break;
+ }
+ static hb_feature_t hlig = { HB_TAG('h', 'l', 'i', 'g'), 1, 0, static_cast<unsigned>(-1) };
+ switch (description.historicalLigaturesState()) {
+ case FontDescription::DisabledLigaturesState:
+ // hlig is off by default
+ break;
+ case FontDescription::EnabledLigaturesState:
+ m_features.append(hlig);
+ break;
+ case FontDescription::NormalLigaturesState:
+ break;
+ }
+
FontFeatureSettings* settings = description.featureSettings();
if (!settings)
return;
« no previous file with comments | « LayoutTests/fast/text/font-variant-ligatures-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698