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

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

Issue 22923010: DevTools: Add CSS.getPlatformFontsForNode in protocol.json (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 7 years, 4 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/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
diff --git a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
index 1857d7da73ab8974038a95793f1aad0c3411f5f2..83145c13396e02ccb0074b4c3c6a72f8ecd1205e 100644
--- a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
+++ b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
@@ -211,6 +211,15 @@ SkFontID FontPlatformData::uniqueID() const
return m_typeface->uniqueID();
}
+String FontPlatformData::fontFamilyName() const
+{
+ SkTypeface::LocalizedStrings* fontFamilyIterator = this->typeface()->createFamilyNameIterator();
+ SkTypeface::LocalizedString localizedString;
+ while (fontFamilyIterator->next(&localizedString) && !localizedString.fString.size()) { }
+ fontFamilyIterator->unref();
+ return String(localizedString.fString.c_str());
eae 2013/08/19 19:36:43 This will return the first non-empty name, is that
lushnikov 2013/08/21 13:43:15 Yes, that's intended. I hope in future this will b
+}
+
bool FontPlatformData::operator==(const FontPlatformData& a) const
{
// If either of the typeface pointers are null then we test for pointer

Powered by Google App Engine
This is Rietveld 408576698