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

Unified Diff: Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp

Issue 22923010: DevTools: Add CSS.getPlatformFontsForNode in protocol.json (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use HFONT instead of SKTypeface on Win 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/chromium/FontPlatformDataChromiumWin.cpp
diff --git a/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp b/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
index ef95574f1f1821759055fb4dd033dcbeb210c257..79b46e3a5373be1f4215f86a7bef46d4b359cdfa 100644
--- a/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
+++ b/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
@@ -224,6 +224,18 @@ FontPlatformData::~FontPlatformData()
m_scriptCache = 0;
}
+String FontPlatformData::fontFamilyName() const
+{
+ HWndDC dc(0);
+ HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont()));
+ WCHAR name[LF_FACESIZE];
+ unsigned resultLength = GetTextFace(dc, LF_FACESIZE, name);
+ if (resultLength > 0)
+ resultLength--; // ignore the null terminator
+ SelectObject(dc, oldFont);
+ return String(name, resultLength);
+}
+
bool FontPlatformData::isFixedPitch() const
{
#if ENABLE(GDI_FONTS_ON_WINDOWS)

Powered by Google App Engine
This is Rietveld 408576698