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

Unified Diff: src/ports/SkFontHost_win_dw.cpp

Issue 214843002: Add a default-default font for DirectWrite. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 9 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: src/ports/SkFontHost_win_dw.cpp
===================================================================
--- src/ports/SkFontHost_win_dw.cpp (revision 13916)
+++ src/ports/SkFontHost_win_dw.cpp (working copy)
@@ -1674,9 +1674,8 @@
if (exists) {
HR(fFontCollection->GetFontFamily(index, fontFamily));
- return S_OK;
}
- return S_FALSE;
+ return S_OK;
}
HRESULT SkFontMgr_DirectWrite::getDefaultFontFamily(IDWriteFontFamily** fontFamily) const {
@@ -1690,7 +1689,6 @@
}
HRM(this->getByFamilyName(metrics.lfMessageFont.lfFaceName, fontFamily),
"Could not create DWrite font family from LOGFONT.");
-
return S_OK;
}
@@ -1709,6 +1707,12 @@
HRNM(this->getDefaultFontFamily(&fontFamily), "Could not get default font family.");
}
+ if (NULL == fontFamily.get()) {
+ // Could not obtain the default font.
+ HRNM(fFontCollection->GetFontFamily(0, &fontFamily),
+ "Could not get default-default font family.");
+ }
+
SkTScopedComPtr<IDWriteFont> font;
DWRITE_FONT_WEIGHT weight = (styleBits & SkTypeface::kBold)
? DWRITE_FONT_WEIGHT_BOLD
« 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