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 e81203ceccba6637fab99ea906bc9aa3e9ea876a..b2acd7003c5c6f62aa429cca5177a4c0c785f066 100644 |
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc |
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc |
@@ -245,6 +245,22 @@ bool DWriteFontCollectionProxy::LoadFamily( |
return SUCCEEDED(hr); |
} |
+bool DWriteFontCollectionProxy::GetFontFamily(UINT32 family_index, |
+ const base::string16& family_name, |
+ IDWriteFontFamily** font_family) { |
+ DCHECK(font_family); |
+ DCHECK(!family_name.empty()); |
+ if (!CreateFamily(family_index)) |
+ 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) { |
@@ -404,6 +420,10 @@ void DWriteFontFamilyProxy::SetName(const base::string16& family_name) { |
family_name_.assign(family_name); |
} |
+const base::string16& DWriteFontFamilyProxy::GetName() { |
+ return family_name_; |
+} |
+ |
bool DWriteFontFamilyProxy::IsLoaded() { |
return family_ != nullptr; |
} |