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_page/pageint.h" | 7 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include "core/include/fdrm/fx_crypt.h" | 9 #include "core/include/fdrm/fx_crypt.h" |
10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 for (auto& it : m_FontMap) { | 255 for (auto& it : m_FontMap) { |
256 CPDF_CountedFont* fontData = it.second; | 256 CPDF_CountedFont* fontData = it.second; |
257 CPDF_Font* pFont = fontData->get(); | 257 CPDF_Font* pFont = fontData->get(); |
258 if (!pFont) | 258 if (!pFont) |
259 continue; | 259 continue; |
260 if (pFont->GetBaseFont() != fontName) | 260 if (pFont->GetBaseFont() != fontName) |
261 continue; | 261 continue; |
262 if (pFont->IsEmbedded()) | 262 if (pFont->IsEmbedded()) |
263 continue; | 263 continue; |
264 if (pFont->GetFontType() != PDFFONT_TYPE1) | 264 if (!pFont->IsType1Font()) |
265 continue; | 265 continue; |
266 if (pFont->GetFontDict()->KeyExist("Widths")) | 266 if (pFont->GetFontDict()->KeyExist("Widths")) |
267 continue; | 267 continue; |
268 | 268 |
269 CPDF_Type1Font* pT1Font = pFont->GetType1Font(); | 269 CPDF_Type1Font* pT1Font = pFont->AsType1Font(); |
270 if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding)) | 270 if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding)) |
271 continue; | 271 continue; |
272 | 272 |
273 return fontData->AddRef(); | 273 return fontData->AddRef(); |
274 } | 274 } |
275 | 275 |
276 CPDF_Dictionary* pDict = new CPDF_Dictionary; | 276 CPDF_Dictionary* pDict = new CPDF_Dictionary; |
277 pDict->SetAtName("Type", "Font"); | 277 pDict->SetAtName("Type", "Font"); |
278 pDict->SetAtName("Subtype", "Type1"); | 278 pDict->SetAtName("Subtype", "Type1"); |
279 pDict->SetAtName("BaseFont", fontName); | 279 pDict->SetAtName("BaseFont", fontName); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 } | 598 } |
599 | 599 |
600 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 600 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
601 CPDF_Object* pPatternObj) const { | 601 CPDF_Object* pPatternObj) const { |
602 if (!pPatternObj) | 602 if (!pPatternObj) |
603 return nullptr; | 603 return nullptr; |
604 | 604 |
605 auto it = m_PatternMap.find(pPatternObj); | 605 auto it = m_PatternMap.find(pPatternObj); |
606 return it != m_PatternMap.end() ? it->second : nullptr; | 606 return it != m_PatternMap.end() ? it->second : nullptr; |
607 } | 607 } |
OLD | NEW |