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 "core/fpdfapi/fpdf_font/cpdf_cidfont.h" | 7 #include "core/fpdfapi/fpdf_font/cpdf_cidfont.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_cmaps/cmap_int.h" | 9 #include "core/fpdfapi/fpdf_cmaps/cmap_int.h" |
10 #include "core/fpdfapi/fpdf_font/font_int.h" | 10 #include "core/fpdfapi/fpdf_font/font_int.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 } else { | 394 } else { |
395 return FALSE; | 395 return FALSE; |
396 } | 396 } |
397 if (!m_pCMap) { | 397 if (!m_pCMap) { |
398 return FALSE; | 398 return FALSE; |
399 } | 399 } |
400 m_Charset = m_pCMap->m_Charset; | 400 m_Charset = m_pCMap->m_Charset; |
401 if (m_Charset == CIDSET_UNKNOWN) { | 401 if (m_Charset == CIDSET_UNKNOWN) { |
402 CPDF_Dictionary* pCIDInfo = pCIDFontDict->GetDictBy("CIDSystemInfo"); | 402 CPDF_Dictionary* pCIDInfo = pCIDFontDict->GetDictBy("CIDSystemInfo"); |
403 if (pCIDInfo) { | 403 if (pCIDInfo) { |
404 m_Charset = CharsetFromOrdering(pCIDInfo->GetStringBy("Ordering")); | 404 m_Charset = |
| 405 CharsetFromOrdering(pCIDInfo->GetStringBy("Ordering").AsStringC()); |
405 } | 406 } |
406 } | 407 } |
407 if (m_Charset != CIDSET_UNKNOWN) | 408 if (m_Charset != CIDSET_UNKNOWN) |
408 m_pCID2UnicodeMap = | 409 m_pCID2UnicodeMap = |
409 CPDF_ModuleMgr::Get() | 410 CPDF_ModuleMgr::Get() |
410 ->GetPageModule() | 411 ->GetPageModule() |
411 ->GetFontGlobals() | 412 ->GetFontGlobals() |
412 ->m_CMapManager.GetCID2UnicodeMap( | 413 ->m_CMapManager.GetCID2UnicodeMap( |
413 m_Charset, | 414 m_Charset, |
414 !m_pFontFile && (m_pCMap->m_Coding == CIDCODING_CID || | 415 !m_pFontFile && (m_pCMap->m_Coding == CIDCODING_CID || |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 897 |
897 const uint8_t* CPDF_CIDFont::GetCIDTransform(uint16_t CID) const { | 898 const uint8_t* CPDF_CIDFont::GetCIDTransform(uint16_t CID) const { |
898 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 899 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
899 return nullptr; | 900 return nullptr; |
900 | 901 |
901 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 902 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
902 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 903 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
903 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 904 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
904 return found ? &found->a : nullptr; | 905 return found ? &found->a : nullptr; |
905 } | 906 } |
OLD | NEW |