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/fpdfapi/font/font_int.h" | 7 #include "core/fpdfapi/font/font_int.h" |
8 | 8 |
9 #include "core/fpdfapi/cpdf_modulemgr.h" | 9 #include "core/fpdfapi/cpdf_modulemgr.h" |
10 #include "core/fpdfapi/page/cpdf_form.h" | 10 #include "core/fpdfapi/page/cpdf_form.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 uint32_t CPDF_ToUnicodeMap::GetUnicode() { | 202 uint32_t CPDF_ToUnicodeMap::GetUnicode() { |
203 FX_SAFE_UINT32 uni = m_MultiCharBuf.GetLength(); | 203 FX_SAFE_UINT32 uni = m_MultiCharBuf.GetLength(); |
204 uni = uni * 0x10000 + 0xffff; | 204 uni = uni * 0x10000 + 0xffff; |
205 return uni.ValueOrDefault(0); | 205 return uni.ValueOrDefault(0); |
206 } | 206 } |
207 | 207 |
208 void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream) { | 208 void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream) { |
209 CIDSet cid_set = CIDSET_UNKNOWN; | 209 CIDSet cid_set = CIDSET_UNKNOWN; |
210 CPDF_StreamAcc stream; | 210 CPDF_StreamAcc stream; |
211 stream.LoadAllData(pStream, FALSE); | 211 stream.LoadAllData(pStream, false); |
212 CPDF_SimpleParser parser(stream.GetData(), stream.GetSize()); | 212 CPDF_SimpleParser parser(stream.GetData(), stream.GetSize()); |
213 while (1) { | 213 while (1) { |
214 CFX_ByteStringC word = parser.GetWord(); | 214 CFX_ByteStringC word = parser.GetWord(); |
215 if (word.IsEmpty()) { | 215 if (word.IsEmpty()) { |
216 break; | 216 break; |
217 } | 217 } |
218 if (word == "beginbfchar") { | 218 if (word == "beginbfchar") { |
219 while (1) { | 219 while (1) { |
220 word = parser.GetWord(); | 220 word = parser.GetWord(); |
221 if (word.IsEmpty() || word == "endbfchar") { | 221 if (word.IsEmpty() || word == "endbfchar") { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } else if (word == "/Adobe-CNS1-UCS2") { | 300 } else if (word == "/Adobe-CNS1-UCS2") { |
301 cid_set = CIDSET_CNS1; | 301 cid_set = CIDSET_CNS1; |
302 } else if (word == "/Adobe-GB1-UCS2") { | 302 } else if (word == "/Adobe-GB1-UCS2") { |
303 cid_set = CIDSET_GB1; | 303 cid_set = CIDSET_GB1; |
304 } | 304 } |
305 } | 305 } |
306 if (cid_set) { | 306 if (cid_set) { |
307 m_pBaseMap = CPDF_ModuleMgr::Get() | 307 m_pBaseMap = CPDF_ModuleMgr::Get() |
308 ->GetPageModule() | 308 ->GetPageModule() |
309 ->GetFontGlobals() | 309 ->GetFontGlobals() |
310 ->m_CMapManager.GetCID2UnicodeMap(cid_set, FALSE); | 310 ->m_CMapManager.GetCID2UnicodeMap(cid_set, false); |
311 } else { | 311 } else { |
312 m_pBaseMap = nullptr; | 312 m_pBaseMap = nullptr; |
313 } | 313 } |
314 } | 314 } |
OLD | NEW |