| 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/fpdf_font/font_int.h" | 7 #include "core/fpdfapi/fpdf_font/font_int.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/ttgsubtable.h" | 10 #include "core/fpdfapi/fpdf_font/ttgsubtable.h" |
| 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" |
| 14 #include "core/fpdfapi/include/cpdf_modulemgr.h" | 14 #include "core/fpdfapi/include/cpdf_modulemgr.h" |
| 15 #include "core/include/fpdfapi/fpdf_resource.h" | 15 #include "core/include/fpdfapi/fpdf_resource.h" |
| 16 #include "core/include/fxcrt/fx_ext.h" | 16 #include "core/include/fxcrt/fx_ext.h" |
| 17 #include "core/include/fxge/fx_freetype.h" | 17 #include "core/include/fxge/fx_freetype.h" |
| 18 #include "core/include/fxge/fx_ge.h" | 18 #include "core/include/fxge/fx_ge.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const FX_CHAR* const g_CharsetNames[CIDSET_NUM_SETS] = { | 22 const FX_CHAR* const g_CharsetNames[CIDSET_NUM_SETS] = { |
| 23 nullptr, "GB1", "CNS1", "Japan1", "Korea1", "UCS"}; | 23 nullptr, "GB1", "CNS1", "Japan1", "Korea1", "UCS"}; |
| 24 | 24 |
| 25 const int g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200}; | 25 const uint16_t g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200}; |
| 26 | 26 |
| 27 class CPDF_PredefinedCMap { | 27 class CPDF_PredefinedCMap { |
| 28 public: | 28 public: |
| 29 const FX_CHAR* m_pName; | 29 const FX_CHAR* m_pName; |
| 30 CIDSet m_Charset; | 30 CIDSet m_Charset; |
| 31 int m_Coding; | 31 CIDCoding m_Coding; |
| 32 CPDF_CMap::CodingScheme m_CodingScheme; | 32 CPDF_CMap::CodingScheme m_CodingScheme; |
| 33 FX_DWORD m_LeadingSegCount; | 33 uint8_t m_LeadingSegCount; |
| 34 uint8_t m_LeadingSegs[4]; | 34 uint8_t m_LeadingSegs[4]; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 const CPDF_PredefinedCMap g_PredefinedCMaps[] = { | 37 const CPDF_PredefinedCMap g_PredefinedCMaps[] = { |
| 38 {"GB-EUC", | 38 {"GB-EUC", |
| 39 CIDSET_GB1, | 39 CIDSET_GB1, |
| 40 CIDCODING_GB, | 40 CIDCODING_GB, |
| 41 CPDF_CMap::MixedTwoBytes, | 41 CPDF_CMap::MixedTwoBytes, |
| 42 1, | 42 1, |
| 43 {0xa1, 0xfe}}, | 43 {0xa1, 0xfe}}, |
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 | 1668 |
| 1669 const uint8_t* CPDF_CIDFont::GetCIDTransform(uint16_t CID) const { | 1669 const uint8_t* CPDF_CIDFont::GetCIDTransform(uint16_t CID) const { |
| 1670 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1670 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
| 1671 return nullptr; | 1671 return nullptr; |
| 1672 | 1672 |
| 1673 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1673 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
| 1674 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1674 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
| 1675 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1675 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
| 1676 return found ? &found->a : nullptr; | 1676 return found ? &found->a : nullptr; |
| 1677 } | 1677 } |
| OLD | NEW |