OLD | NEW |
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 "core/include/fpdfdoc/fpdf_doc.h" | 7 #include "core/include/fpdfdoc/fpdf_doc.h" |
8 #include "doc_utils.h" | 8 #include "doc_utils.h" |
9 | 9 |
10 const int nMaxRecursion = 32; | 10 const int nMaxRecursion = 32; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 LPCSTR pcsFontName, | 364 LPCSTR pcsFontName, |
365 LOGFONTA& lf) { | 365 LOGFONTA& lf) { |
366 memset(&lf, 0, sizeof(LOGFONTA)); | 366 memset(&lf, 0, sizeof(LOGFONTA)); |
367 lf.lfCharSet = charSet; | 367 lf.lfCharSet = charSet; |
368 lf.lfPitchAndFamily = pitchAndFamily; | 368 lf.lfPitchAndFamily = pitchAndFamily; |
369 if (pcsFontName != NULL) { | 369 if (pcsFontName != NULL) { |
370 strcpy(lf.lfFaceName, pcsFontName); | 370 strcpy(lf.lfFaceName, pcsFontName); |
371 } | 371 } |
372 return RetrieveSpecificFont(lf); | 372 return RetrieveSpecificFont(lf); |
373 } | 373 } |
| 374 #ifdef PDF_ENABLE_XFA |
| 375 static FX_BOOL RetrieveStockFont(int iFontObject, |
| 376 uint8_t charSet, |
| 377 LOGFONTA& lf) { |
| 378 HFONT hFont = (HFONT)::GetStockObject(iFontObject); |
| 379 if (hFont != NULL) { |
| 380 memset(&lf, 0, sizeof(LOGFONTA)); |
| 381 int iRet = ::GetObject(hFont, sizeof(LOGFONTA), &lf); |
| 382 if (iRet > 0 && (lf.lfCharSet == charSet || charSet == 255)) { |
| 383 return RetrieveSpecificFont(lf); |
| 384 } |
| 385 } |
| 386 return FALSE; |
| 387 } |
| 388 #endif |
374 #endif | 389 #endif |
375 | 390 |
376 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, | 391 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, |
377 CFX_ByteString csFontName) { | 392 CFX_ByteString csFontName) { |
378 if (!pDocument || csFontName.IsEmpty()) | 393 if (!pDocument || csFontName.IsEmpty()) |
379 return nullptr; | 394 return nullptr; |
380 | 395 |
381 if (csFontName == "ZapfDingbats") | 396 if (csFontName == "ZapfDingbats") |
382 return pDocument->AddStandardFont(csFontName.c_str(), nullptr); | 397 return pDocument->AddStandardFont(csFontName.c_str(), nullptr); |
383 | 398 |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 FDF_ImportField(pField, L"", bNotify); | 1272 FDF_ImportField(pField, L"", bNotify); |
1258 } | 1273 } |
1259 if (bNotify && m_pFormNotify != NULL) { | 1274 if (bNotify && m_pFormNotify != NULL) { |
1260 m_pFormNotify->AfterFormImportData(this); | 1275 m_pFormNotify->AfterFormImportData(this); |
1261 } | 1276 } |
1262 return TRUE; | 1277 return TRUE; |
1263 } | 1278 } |
1264 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1279 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
1265 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1280 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
1266 } | 1281 } |
OLD | NEW |