Chromium Code Reviews| 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 | |
| 374 static FX_BOOL RetrieveStockFont(int iFontObject, | 375 static FX_BOOL RetrieveStockFont(int iFontObject, |
| 375 uint8_t charSet, | 376 uint8_t charSet, |
| 376 LOGFONTA& lf) { | 377 LOGFONTA& lf) { |
| 377 HFONT hFont = (HFONT)::GetStockObject(iFontObject); | 378 HFONT hFont = (HFONT)::GetStockObject(iFontObject); |
| 378 if (hFont != NULL) { | 379 if (hFont != NULL) { |
| 379 memset(&lf, 0, sizeof(LOGFONTA)); | 380 memset(&lf, 0, sizeof(LOGFONTA)); |
| 380 int iRet = ::GetObject(hFont, sizeof(LOGFONTA), &lf); | 381 int iRet = ::GetObject(hFont, sizeof(LOGFONTA), &lf); |
| 381 if (iRet > 0 && (lf.lfCharSet == charSet || charSet == 255)) { | 382 if (iRet > 0 && (lf.lfCharSet == charSet || charSet == 255)) { |
| 382 return RetrieveSpecificFont(lf); | 383 return RetrieveSpecificFont(lf); |
| 383 } | 384 } |
| 384 } | 385 } |
| 385 return FALSE; | 386 return FALSE; |
| 386 } | 387 } |
| 387 #endif | 388 #endif |
| 389 #endif | |
|
Lei Zhang
2015/11/24 23:38:10
These 2 needs to be labeled.
Tom Sepez
2015/11/25 18:51:45
I will label all in next CL.
Tom Sepez
2015/11/25 21:01:39
Am I blind? I see no matching ifdef!
Lei Zhang
2015/11/25 21:20:21
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ on li
| |
| 388 | 390 |
| 389 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, | 391 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, |
| 390 CFX_ByteString csFontName) { | 392 CFX_ByteString csFontName) { |
| 391 if (!pDocument || csFontName.IsEmpty()) | 393 if (!pDocument || csFontName.IsEmpty()) |
| 392 return nullptr; | 394 return nullptr; |
| 393 | 395 |
| 394 if (csFontName == "ZapfDingbats") | 396 if (csFontName == "ZapfDingbats") |
| 395 return pDocument->AddStandardFont(csFontName.c_str(), nullptr); | 397 return pDocument->AddStandardFont(csFontName.c_str(), nullptr); |
| 396 | 398 |
| 397 CPDF_FontEncoding encoding(PDFFONT_ENCODING_WINANSI); | 399 CPDF_FontEncoding encoding(PDFFONT_ENCODING_WINANSI); |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1270 FDF_ImportField(pField, L"", bNotify); | 1272 FDF_ImportField(pField, L"", bNotify); |
| 1271 } | 1273 } |
| 1272 if (bNotify && m_pFormNotify != NULL) { | 1274 if (bNotify && m_pFormNotify != NULL) { |
| 1273 m_pFormNotify->AfterFormImportData(this); | 1275 m_pFormNotify->AfterFormImportData(this); |
| 1274 } | 1276 } |
| 1275 return TRUE; | 1277 return TRUE; |
| 1276 } | 1278 } |
| 1277 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1279 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
| 1278 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1280 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
| 1279 } | 1281 } |
| OLD | NEW |