diff options
author | Lei Zhang <thestig@chromium.org> | 2015-09-23 15:31:44 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-09-23 15:31:44 -0700 |
commit | 6f62d53b7650311afc490bfdaa48f5e8536b8b4e (patch) | |
tree | 9b1e1cc17f3d75d6f9bd2413281d5b29450f1fcd /fpdfsdk | |
parent | 5377ebf967ea860eec4b3cfa3877ed30b84509dc (diff) | |
download | pdfium-6f62d53b7650311afc490bfdaa48f5e8536b8b4e.tar.xz |
Merge to XFA: Allow external font-path configuration from pdfium_test.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1268323004 .
(cherry picked from commit 9311163b564785a3a3ccdcb09bd3b7d0b2976d1a)
Review URL: https://codereview.chromium.org/1368513002 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/src/fpdf_sysfontinfo.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 7 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfview_c_api_test.c | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp index 53610b040e..a004e86ba1 100644 --- a/fpdfsdk/src/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp @@ -168,7 +168,7 @@ static void DefaultDeleteFont(struct _FPDF_SYSFONTINFO* pThis, void* hFont) { } DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() { - IFX_SystemFontInfo* pFontInfo = IFX_SystemFontInfo::CreateDefault(); + IFX_SystemFontInfo* pFontInfo = IFX_SystemFontInfo::CreateDefault(nullptr); if (pFontInfo == NULL) return NULL; diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index c2b53bebcd..414ade7070 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -180,9 +180,14 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy) { CCodec_ModuleMgr* g_pCodecModule = nullptr; DLLEXPORT void STDCALL FPDF_InitLibrary() { + FPDF_InitLibraryWithConfig(nullptr); +} + +DLLEXPORT void STDCALL +FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { g_pCodecModule = new CCodec_ModuleMgr(); - CFX_GEModule::Create(); + CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); CPDF_ModuleMgr::Create(); diff --git a/fpdfsdk/src/fpdfview_c_api_test.c b/fpdfsdk/src/fpdfview_c_api_test.c index d16bf99f07..4205ca119e 100644 --- a/fpdfsdk/src/fpdfview_c_api_test.c +++ b/fpdfsdk/src/fpdfview_c_api_test.c @@ -192,6 +192,7 @@ int CheckPDFiumCApi() { // fpdfview.h CHK(FPDF_InitLibrary); + CHK(FPDF_InitLibraryWithConfig); CHK(FPDF_DestroyLibrary); CHK(FPDF_SetSandBoxPolicy); CHK(FPDF_LoadDocument); |