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

Unified Diff: content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc

Issue 1846433005: Implement direct write fallback proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index d99296ee126519db35e0e0e2f3fe9d41b003176b..b1ba345551075b9deb0fd4d9be15ec6c3c07ea42 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -241,6 +241,20 @@ bool DWriteFontCollectionProxy::LoadFamily(
return SUCCEEDED(hr);
}
+bool DWriteFontCollectionProxy::GetFontFamily(UINT32 family_index,
+ const base::string16& family_name,
+ IDWriteFontFamily** font_family) {
+ if (!CreateFamily(family_index))
ananta 2016/04/12 23:44:39 Please check for valid parameters here, especially
Ilya Kulshin 2016/04/13 01:33:28 Added a dcheck that font_family is not null and fa
+ return false;
+
+ mswr::ComPtr<DWriteFontFamilyProxy>& family = families_[family_index];
+ if (!family->IsLoaded() || family->GetName().empty())
+ family->SetName(family_name);
+
+ family.CopyTo(font_family);
+ return true;
+}
+
bool DWriteFontCollectionProxy::LoadFamilyNames(
UINT32 family_index,
IDWriteLocalizedStrings** localized_strings) {

Powered by Google App Engine
This is Rietveld 408576698