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

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

Issue 25519004: Use Skia API on Windows to get font family name (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 521495c735d9cad00a54adc119bed37db26ce0e9..1cff78debf288c4a64bc70584bd9479043354f9d 100644
--- a/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
+++ b/Source/core/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp
@@ -298,6 +298,7 @@ FontPlatformData::~FontPlatformData()
String FontPlatformData::fontFamilyName() const
{
+#if ENABLE(GDI_FONTS_ON_WINDOWS)
HWndDC dc(0);
HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont()));
WCHAR name[LF_FACESIZE];
@@ -306,6 +307,14 @@ String FontPlatformData::fontFamilyName() const
resultLength--; // ignore the null terminator
SelectObject(dc, oldFont);
return String(name, resultLength);
+#else
+ // FIXME: This returns the requested name, perhaps a better solution would be to
+ // return the list of names provided by SkTypeface::createFamilyNameIterator.
+ ASSERT(typeface());
+ SkString familyName;
+ typeface()->getFamilyName(&familyName);
+ return String::fromUTF8(familyName.c_str());
+#endif
}
bool FontPlatformData::isFixedPitch() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698