From 377bd931d8d77d322095c7dcffd3c2cc31641fba Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 18 May 2018 18:04:46 +0000 Subject: 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 Commit-Queue: Ryan Harrison --- xfa/fxfa/cxfa_fffield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/fxfa/cxfa_fffield.cpp') diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index ce8e70ea0c..f1b8cffa8f 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -119,7 +119,7 @@ void CXFA_FFField::DrawFocus(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) { void CXFA_FFField::SetFWLThemeProvider() { if (m_pNormalWidget) - m_pNormalWidget->SetThemeProvider(GetApp()->GetFWLTheme()); + m_pNormalWidget->SetThemeProvider(GetApp()->GetFWLTheme(GetDoc())); } bool CXFA_FFField::IsLoaded() { -- cgit v1.2.3