Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: fpdfsdk/fpdfview.cpp

Issue 2097523002: Load font maps in XFA. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "public/fpdfview.h" 7 #include "public/fpdfview.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 DLLEXPORT void STDCALL 261 DLLEXPORT void STDCALL
262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { 262 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) {
263 g_pCodecModule = new CCodec_ModuleMgr(); 263 g_pCodecModule = new CCodec_ModuleMgr();
264 264
265 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule); 265 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr, g_pCodecModule);
266 CPDF_ModuleMgr::Create(); 266 CPDF_ModuleMgr::Create();
267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); 267 CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get();
268 pModuleMgr->SetCodecModule(g_pCodecModule); 268 pModuleMgr->SetCodecModule(g_pCodecModule);
269 pModuleMgr->InitPageModule(); 269 pModuleMgr->InitPageModule();
270 pModuleMgr->LoadEmbeddedGB1CMaps();
271 pModuleMgr->LoadEmbeddedJapan1CMaps();
272 pModuleMgr->LoadEmbeddedCNS1CMaps();
273 pModuleMgr->LoadEmbeddedKorea1CMaps();
270 274
271 #ifdef PDF_ENABLE_XFA 275 #ifdef PDF_ENABLE_XFA
272 CPDFXFA_App::GetInstance()->Initialize( 276 CPDFXFA_App::GetInstance()->Initialize(
273 (cfg && cfg->version >= 2) ? static_cast<v8::Isolate*>(cfg->m_pIsolate) 277 (cfg && cfg->version >= 2) ? static_cast<v8::Isolate*>(cfg->m_pIsolate)
274 : nullptr); 278 : nullptr);
275 #else // PDF_ENABLE_XFA
276 pModuleMgr->LoadEmbeddedGB1CMaps();
277 pModuleMgr->LoadEmbeddedJapan1CMaps();
278 pModuleMgr->LoadEmbeddedCNS1CMaps();
279 pModuleMgr->LoadEmbeddedKorea1CMaps();
280 #endif // PDF_ENABLE_XFA 279 #endif // PDF_ENABLE_XFA
281 280
282 if (cfg && cfg->version >= 2) 281 if (cfg && cfg->version >= 2)
283 IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate); 282 IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate);
284 } 283 }
285 284
286 DLLEXPORT void STDCALL FPDF_DestroyLibrary() { 285 DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
287 #ifdef PDF_ENABLE_XFA 286 #ifdef PDF_ENABLE_XFA
288 CPDFXFA_App::ReleaseInstance(); 287 CPDFXFA_App::ReleaseInstance();
289 #endif // PDF_ENABLE_XFA 288 #endif // PDF_ENABLE_XFA
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 if (!buffer) { 1106 if (!buffer) {
1108 *buflen = len; 1107 *buflen = len;
1109 } else if (*buflen >= len) { 1108 } else if (*buflen >= len) {
1110 memcpy(buffer, utf16Name.c_str(), len); 1109 memcpy(buffer, utf16Name.c_str(), len);
1111 *buflen = len; 1110 *buflen = len;
1112 } else { 1111 } else {
1113 *buflen = -1; 1112 *buflen = -1;
1114 } 1113 }
1115 return (FPDF_DEST)pDestObj; 1114 return (FPDF_DEST)pDestObj;
1116 } 1115 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698