| 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 "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" |
| 11 #include "core/include/fpdfapi/fpdf_resource.h" | 11 #include "core/include/fpdfapi/fpdf_resource.h" |
| 12 #include "core/include/fxcrt/fx_ext.h" | 12 #include "core/include/fxcrt/fx_ext.h" |
| 13 #include "core/include/fxge/fx_freetype.h" | 13 #include "core/include/fxge/fx_freetype.h" |
| 14 #include "core/include/fxge/fx_ge.h" | 14 #include "core/include/fxge/fx_ge.h" |
| 15 #include "core/src/fpdfapi/fpdf_cmaps/cmap_int.h" | 15 #include "core/src/fpdfapi/fpdf_cmaps/cmap_int.h" |
| 16 #include "core/src/fpdfapi/fpdf_font/ttgsubtable.h" |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 const FX_CHAR* const g_CharsetNames[CIDSET_NUM_SETS] = | 20 const FX_CHAR* const g_CharsetNames[CIDSET_NUM_SETS] = |
| 20 {nullptr, "GB1", "CNS1", "Japan1", "Korea1", "UCS"}; | 21 {nullptr, "GB1", "CNS1", "Japan1", "Korea1", "UCS"}; |
| 21 | 22 |
| 22 const int g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200}; | 23 const int g_CharsetCPs[CIDSET_NUM_SETS] = {0, 936, 950, 932, 949, 1200}; |
| 23 | 24 |
| 24 class CPDF_PredefinedCMap { | 25 class CPDF_PredefinedCMap { |
| 25 public: | 26 public: |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 return 0; | 1031 return 0; |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, | 1034 void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, |
| 1034 CIDSet charset, | 1035 CIDSet charset, |
| 1035 FX_BOOL bPromptCJK) { | 1036 FX_BOOL bPromptCJK) { |
| 1036 m_Charset = charset; | 1037 m_Charset = charset; |
| 1037 FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount); | 1038 FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount); |
| 1038 } | 1039 } |
| 1039 | 1040 |
| 1040 #include "ttgsubtable.h" | |
| 1041 CPDF_CIDFont::CPDF_CIDFont() : CPDF_Font(PDFFONT_CIDFONT) { | 1041 CPDF_CIDFont::CPDF_CIDFont() : CPDF_Font(PDFFONT_CIDFONT) { |
| 1042 m_pCMap = NULL; | 1042 m_pCMap = NULL; |
| 1043 m_pAllocatedCMap = NULL; | 1043 m_pAllocatedCMap = NULL; |
| 1044 m_pCID2UnicodeMap = NULL; | 1044 m_pCID2UnicodeMap = NULL; |
| 1045 m_pAnsiWidths = NULL; | 1045 m_pAnsiWidths = NULL; |
| 1046 m_pCIDToGIDMap = NULL; | 1046 m_pCIDToGIDMap = NULL; |
| 1047 m_bCIDIsGID = FALSE; | 1047 m_bCIDIsGID = FALSE; |
| 1048 m_bAdobeCourierStd = FALSE; | 1048 m_bAdobeCourierStd = FALSE; |
| 1049 m_pTTGSUBTable = NULL; | 1049 m_pTTGSUBTable = NULL; |
| 1050 FXSYS_memset(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT)); | 1050 FXSYS_memset(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT)); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 | 1716 |
| 1717 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { | 1717 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { |
| 1718 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1718 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
| 1719 return nullptr; | 1719 return nullptr; |
| 1720 | 1720 |
| 1721 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1721 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
| 1722 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1722 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
| 1723 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1723 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
| 1724 return found ? &found->a : nullptr; | 1724 return found ? &found->a : nullptr; |
| 1725 } | 1725 } |
| OLD | NEW |