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

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: address behdad's comments and add vkrn 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..852d143785718de5b7fd6d46e759b037b94e45f7 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,19 @@ void HarfBuzzShaper::setFontFeatures()
m_features.append(vrt2);
}
+ static hb_feature_t noKern = { HB_TAG('k', 'e', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
+ static hb_feature_t noVkrn = { HB_TAG('v', 'k', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
+ switch (description.kerning()) {
+ case FontDescription::NormalKerning:
+ // kern/vkrn are enabled by default
+ break;
+ case FontDescription::NoneKerning:
+ m_features.append(description.orientation() == Vertical ? noVkrn : 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