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/src/fpdfapi/fpdf_font/font_int.h" | 7 #include "core/src/fpdfapi/fpdf_font/font_int.h" |
8 | 8 |
9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
10 #include "core/include/fpdfapi/fpdf_page.h" | 10 #include "core/include/fpdfapi/fpdf_page.h" |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 // Static. | 713 // Static. |
714 FX_DWORD CPDF_CMapParser::CMap_GetCode(const CFX_ByteStringC& word) { | 714 FX_DWORD CPDF_CMapParser::CMap_GetCode(const CFX_ByteStringC& word) { |
715 int num = 0; | 715 int num = 0; |
716 if (word.GetAt(0) == '<') { | 716 if (word.GetAt(0) == '<') { |
717 for (int i = 1; i < word.GetLength() && std::isxdigit(word.GetAt(i)); ++i) | 717 for (int i = 1; i < word.GetLength() && std::isxdigit(word.GetAt(i)); ++i) |
718 num = num * 16 + FXSYS_toHexDigit(word.GetAt(i)); | 718 num = num * 16 + FXSYS_toHexDigit(word.GetAt(i)); |
719 return num; | 719 return num; |
720 } | 720 } |
721 | 721 |
722 for (int i = 0; i < word.GetLength() && std::isdigit(word.GetAt(i)); ++i) | 722 for (int i = 0; i < word.GetLength() && std::isdigit(word.GetAt(i)); ++i) |
723 num = num * 10 + FXSYS_toDecimalDigit(word.GetAt(i)); | 723 num = num * 10 + FXSYS_toDecimalDigit(static_cast<FX_WCHAR>(word.GetAt(i))); |
724 return num; | 724 return num; |
725 } | 725 } |
726 | 726 |
727 // Static. | 727 // Static. |
728 bool CPDF_CMapParser::CMap_GetCodeRange(CMap_CodeRange& range, | 728 bool CPDF_CMapParser::CMap_GetCodeRange(CMap_CodeRange& range, |
729 const CFX_ByteStringC& first, | 729 const CFX_ByteStringC& first, |
730 const CFX_ByteStringC& second) { | 730 const CFX_ByteStringC& second) { |
731 if (first.GetLength() == 0 || first.GetAt(0) != '<') | 731 if (first.GetLength() == 0 || first.GetAt(0) != '<') |
732 return false; | 732 return false; |
733 | 733 |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 | 1730 |
1731 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { | 1731 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { |
1732 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1732 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
1733 return nullptr; | 1733 return nullptr; |
1734 | 1734 |
1735 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1735 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
1736 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1736 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
1737 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1737 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
1738 return found ? &found->a : nullptr; | 1738 return found ? &found->a : nullptr; |
1739 } | 1739 } |
OLD | NEW |