summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fontmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_fontmgr.cpp')
-rw-r--r--xfa/fxfa/cxfa_fontmgr.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index 7770825b26..c35b10c9bc 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -13,6 +13,8 @@
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
+#include "core/fxge/cfx_fontmgr.h"
+#include "core/fxge/cfx_gemodule.h"
#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/font/fgas_fontutils.h"
@@ -55,11 +57,22 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
if (pFont)
return pFont;
}
+
if (!pFont) {
pFont = m_pDefFontMgr.GetDefaultFont(hDoc->GetApp()->GetFDEFontMgr(),
wsFontFamily, dwFontStyles);
}
+ if (!pFont) {
+ ByteString font_family =
+ ByteString::Format("%ls", WideString(wsFontFamily).c_str());
+ CPDF_Font* stock_font =
+ CPDF_Font::GetStockFont(hDoc->GetPDFDoc(), font_family.AsStringView());
+ if (stock_font)
+ pFont = CFGAS_GEFont::LoadFont(stock_font->GetFont(),
+ hDoc->GetApp()->GetFDEFontMgr());
+ }
+
if (pFont) {
if (pPDFFont) {
pMgr->SetFont(pFont, pPDFFont);