OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "fpdfsdk/cfx_systemhandler.h" | 7 #include "fpdfsdk/cfx_systemhandler.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( | 116 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( |
117 CPDF_Document* pDoc, | 117 CPDF_Document* pDoc, |
118 CFX_ByteString sFontFaceName, | 118 CFX_ByteString sFontFaceName, |
119 uint8_t nCharset) { | 119 uint8_t nCharset) { |
120 if (!pDoc) | 120 if (!pDoc) |
121 return nullptr; | 121 return nullptr; |
122 | 122 |
123 std::unique_ptr<CFX_Font> pFXFont(new CFX_Font); | 123 std::unique_ptr<CFX_Font> pFXFont(new CFX_Font); |
124 pFXFont->LoadSubst(sFontFaceName, TRUE, 0, 0, 0, CharSet2CP(nCharset), false); | 124 pFXFont->LoadSubst(sFontFaceName, true, 0, 0, 0, CharSet2CP(nCharset), false); |
125 return pDoc->AddFont(pFXFont.get(), nCharset, FALSE); | 125 return pDoc->AddFont(pFXFont.get(), nCharset, false); |
126 } | 126 } |
127 | 127 |
128 int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, | 128 int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, |
129 TimerCallback lpTimerFunc) { | 129 TimerCallback lpTimerFunc) { |
130 return m_pFormFillEnv->SetTimer(uElapse, lpTimerFunc); | 130 return m_pFormFillEnv->SetTimer(uElapse, lpTimerFunc); |
131 } | 131 } |
132 | 132 |
133 void CFX_SystemHandler::KillTimer(int32_t nID) { | 133 void CFX_SystemHandler::KillTimer(int32_t nID) { |
134 m_pFormFillEnv->KillTimer(nID); | 134 m_pFormFillEnv->KillTimer(nID); |
135 } | 135 } |
136 | 136 |
137 bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const { | 137 bool CFX_SystemHandler::IsSHIFTKeyDown(uint32_t nFlag) const { |
138 return !!m_pFormFillEnv->IsSHIFTKeyDown(nFlag); | 138 return !!m_pFormFillEnv->IsSHIFTKeyDown(nFlag); |
139 } | 139 } |
140 | 140 |
141 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { | 141 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { |
142 return !!m_pFormFillEnv->IsCTRLKeyDown(nFlag); | 142 return !!m_pFormFillEnv->IsCTRLKeyDown(nFlag); |
143 } | 143 } |
144 | 144 |
145 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { | 145 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { |
146 return !!m_pFormFillEnv->IsALTKeyDown(nFlag); | 146 return !!m_pFormFillEnv->IsALTKeyDown(nFlag); |
147 } | 147 } |
OLD | NEW |