Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1215)

Side by Side Diff: core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 1417033004: Merge to XFA: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 1746
1749 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const { 1747 const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const {
1750 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile) 1748 if (m_Charset != CIDSET_JAPAN1 || m_pFontFile)
1751 return nullptr; 1749 return nullptr;
1752 1750
1753 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch( 1751 const struct CIDTransform* found = (const struct CIDTransform*)FXSYS_bsearch(
1754 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs), 1752 &CID, g_Japan1_VertCIDs, FX_ArraySize(g_Japan1_VertCIDs),
1755 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform); 1753 sizeof(g_Japan1_VertCIDs[0]), CompareCIDTransform);
1756 return found ? &found->a : nullptr; 1754 return found ? &found->a : nullptr;
1757 } 1755 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698