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

Unified Diff: Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp

Issue 74413002: Make -webkit-font-kerning actually work. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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-kerning-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp b/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
index e297fe4e220e688875b5bb8cfee54752ed2e37c0..37b7fda2c7fc4736cef5327475dfd22fadbea233 100644
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -508,6 +509,20 @@ void HarfBuzzShaper::setFontFeatures()
m_features.append(vrt2);
}
+ static const hb_tag_t kernTag = HB_TAG('k', 'e', 'r', 'n');
+ static hb_feature_t kern = { kernTag, 1, 0, static_cast<unsigned>(-1) };
+ static hb_feature_t noKern = { kernTag, 0, 0, static_cast<unsigned>(-1) };
+ switch (description.kerning()) {
+ case FontDescription::NormalKerning:
+ m_features.append(kern);
behdad_google 2013/11/15 22:16:37 No need to explicitly turn on. Default is turned
+ break;
+ case FontDescription::NoneKerning:
+ m_features.append(noKern);
+ break;
+ case FontDescription::AutoKerning:
+ break;
+ }
+
FontFeatureSettings* settings = description.featureSettings();
if (!settings)
return;
« no previous file with comments | « LayoutTests/fast/text/font-kerning-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698