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 "../../../include/fpdfapi/fpdf_module.h" | 7 #include "../../../include/fpdfapi/fpdf_module.h" |
8 #include "../../../include/fpdfapi/fpdf_page.h" | 8 #include "../../../include/fpdfapi/fpdf_page.h" |
9 #include "../../../include/fpdfapi/fpdf_resource.h" | 9 #include "../../../include/fpdfapi/fpdf_resource.h" |
10 #include "../../../include/fxge/fx_freetype.h" | 10 #include "../../../include/fxge/fx_freetype.h" |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 CPDF_Dictionary* pFontDesc = | 1199 CPDF_Dictionary* pFontDesc = |
1200 pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor")); | 1200 pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor")); |
1201 if (pFontDesc) { | 1201 if (pFontDesc) { |
1202 LoadFontDescriptor(pFontDesc); | 1202 LoadFontDescriptor(pFontDesc); |
1203 } | 1203 } |
1204 CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding")); | 1204 CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding")); |
1205 if (pEncoding == NULL) { | 1205 if (pEncoding == NULL) { |
1206 return FALSE; | 1206 return FALSE; |
1207 } | 1207 } |
1208 CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype")); | 1208 CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype")); |
1209 m_bType1 = FALSE; | 1209 m_bType1 = (subtype == FX_BSTRC("CIDFontType0")); |
1210 if (subtype == FX_BSTRC("CIDFontType0")) { | 1210 |
1211 m_bType1 = TRUE; | 1211 if (pEncoding->IsName()) { |
1212 } | |
1213 if (pEncoding->GetType() == PDFOBJ_NAME) { | |
1214 CFX_ByteString cmap = pEncoding->GetString(); | 1212 CFX_ByteString cmap = pEncoding->GetString(); |
1215 m_pCMap = | 1213 m_pCMap = |
1216 CPDF_ModuleMgr::Get() | 1214 CPDF_ModuleMgr::Get() |
1217 ->GetPageModule() | 1215 ->GetPageModule() |
1218 ->GetFontGlobals() | 1216 ->GetFontGlobals() |
1219 ->m_CMapManager.GetPredefinedCMap(cmap, m_pFontFile && m_bType1); | 1217 ->m_CMapManager.GetPredefinedCMap(cmap, m_pFontFile && m_bType1); |
1220 } else if (pEncoding->GetType() == PDFOBJ_STREAM) { | 1218 } else if (pEncoding->GetType() == PDFOBJ_STREAM) { |
1221 m_pAllocatedCMap = m_pCMap = new CPDF_CMap; | 1219 m_pAllocatedCMap = m_pCMap = new CPDF_CMap; |
1222 CPDF_Stream* pStream = (CPDF_Stream*)pEncoding; | 1220 CPDF_Stream* pStream = (CPDF_Stream*)pEncoding; |
1223 CPDF_StreamAcc acc; | 1221 CPDF_StreamAcc acc; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 | 1743 |
1746 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { | 1744 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { |
1747 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) | 1745 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) |
1748 return nullptr; | 1746 return nullptr; |
1749 | 1747 |
1750 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( | 1748 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( |
1751 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), | 1749 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), |
1752 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); | 1750 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); |
1753 return found ? &found->a : nullptr; | 1751 return found ? &found->a : nullptr; |
1754 } | 1752 } |
OLD | NEW |