summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffapp.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-05-18 18:04:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-18 18:04:46 +0000
commit377bd931d8d77d322095c7dcffd3c2cc31641fba (patch)
tree3e708aa3be33bd3c8ac1ce6e62a365faf6654429 /xfa/fxfa/cxfa_ffapp.cpp
parentdd8da5e2f0f4558d98a8a6f93f9cb14b5b091277 (diff)
downloadpdfium-377bd931d8d77d322095c7dcffd3c2cc31641fba.tar.xz
Fix issues with XFA font loading
This fixes two partially interrelated bugs with font loading in XFA documents. First, it adds falling back to the builtin fonts if there are no viable embedded or installed font for the top-level XFA font manager. Additionally it changes the load font code path in CXFA_FWLTheme to use the top level XFA font manager, instead of the one that just handles the system installed fonts. The main visible issue that this patch fixes is that currently using --font-dir with pdfium_test on a XFA PDF can cause text to not be displayed in widgets and/or NOTREACHED asserts. This occurs if there isn't a needed fonts embedded in the document or in the font directory, since currently PDFium will not correctly fall back to the builtins. BUG=pdfium:1008,pdfium:1020 Change-Id: I451a8aede63d639e401c0cc076443e61d8b7a2f8 Reviewed-on: https://pdfium-review.googlesource.com/32730 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffapp.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffapp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp
index a2b0c005f0..1367a77b87 100644
--- a/xfa/fxfa/cxfa_ffapp.cpp
+++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -51,10 +51,10 @@ CFGAS_FontMgr* CXFA_FFApp::GetFDEFontMgr() {
return m_pFDEFontMgr.get();
}
-CXFA_FWLTheme* CXFA_FFApp::GetFWLTheme() {
+CXFA_FWLTheme* CXFA_FFApp::GetFWLTheme(CXFA_FFDoc* doc) {
if (!m_pFWLTheme) {
auto fwl_theme = pdfium::MakeUnique<CXFA_FWLTheme>(this);
- if (fwl_theme->LoadCalendarFont())
+ if (fwl_theme->LoadCalendarFont(doc))
m_pFWLTheme = std::move(fwl_theme);
}
return m_pFWLTheme.get();