diff options
Diffstat (limited to 'xfa/fwl/theme/cfwl_widgettp.cpp')
-rw-r--r-- | xfa/fwl/theme/cfwl_widgettp.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 630da7793d..b2c1c9aa74 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -274,13 +274,11 @@ bool CFWL_FontData::LoadFont(const WideStringView& wsFontFamily, m_dwStyles = dwFontStyles; m_dwCodePage = dwCodePage; if (!m_pFontMgr) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - m_pFontMgr = CFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); -#else - m_pFontSource = pdfium::MakeUnique<CFX_FontSourceEnum_File>(); - m_pFontMgr = CFGAS_FontMgr::Create(m_pFontSource.get()); -#endif + m_pFontMgr = pdfium::MakeUnique<CFGAS_FontMgr>(); + if (!m_pFontMgr->EnumFonts()) + m_pFontMgr = nullptr; } + // TODO(tsepez): check usage of c_str() below. m_pFont = CFGAS_GEFont::LoadFont(wsFontFamily.unterminated_c_str(), dwFontStyles, dwCodePage, m_pFontMgr.get()); |