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 "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 #include "../../include/fxcrt/fx_xml.h" | 8 #include "../../include/fxcrt/fx_xml.h" |
9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); | 9 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict); |
10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu
ment* pDocument); | 10 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Docu
ment* pDocument); |
(...skipping 447 matching lines...) Loading... |
458 } | 458 } |
459 CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid
eString csFontName, FX_BYTE iCharSet) | 459 CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid
eString csFontName, FX_BYTE iCharSet) |
460 { | 460 { |
461 if (pDocument == NULL || csFontName.IsEmpty()) { | 461 if (pDocument == NULL || csFontName.IsEmpty()) { |
462 return NULL; | 462 return NULL; |
463 } | 463 } |
464 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 464 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
465 if (iCharSet == 1) { | 465 if (iCharSet == 1) { |
466 iCharSet = GetNativeCharSet(); | 466 iCharSet = GetNativeCharSet(); |
467 } | 467 } |
468 HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PR
ECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontN
ame); | 468 HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PR
ECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontN
ame.c_str()); |
469 if (hFont != NULL) { | 469 if (hFont != NULL) { |
470 LOGFONTA lf; | 470 LOGFONTA lf; |
471 memset(&lf, 0, sizeof(LOGFONTA)); | 471 memset(&lf, 0, sizeof(LOGFONTA)); |
472 ::GetObject(hFont, sizeof(LOGFONTA), &lf); | 472 ::GetObject(hFont, sizeof(LOGFONTA), &lf); |
473 ::DeleteObject(hFont); | 473 ::DeleteObject(hFont); |
474 if (strlen(lf.lfFaceName) > 0) { | 474 if (strlen(lf.lfFaceName) > 0) { |
475 return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE)
; | 475 return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE)
; |
476 } | 476 } |
477 } | 477 } |
478 #endif | 478 #endif |
(...skipping 1171 matching lines...) Loading... |
1650 continue; | 1650 continue; |
1651 } | 1651 } |
1652 CPDF_FormControl* pControl = NULL; | 1652 CPDF_FormControl* pControl = NULL; |
1653 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) { | 1653 if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) { |
1654 return iNewPage; | 1654 return iNewPage; |
1655 } | 1655 } |
1656 } | 1656 } |
1657 } while (TRUE); | 1657 } while (TRUE); |
1658 return -1; | 1658 return -1; |
1659 } | 1659 } |
OLD | NEW |