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 "font_int.h" |
8 | 8 |
9 #include "core/src/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
10 #include "core/include/fpdfapi/fpdf_module.h" | 10 #include "core/include/fpdfapi/fpdf_module.h" |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 | 1699 |
1700 char_rect.Transform(&m_FontMatrix); | 1700 char_rect.Transform(&m_FontMatrix); |
1701 rcBBox.left = FXSYS_round(char_rect.left * 1000); | 1701 rcBBox.left = FXSYS_round(char_rect.left * 1000); |
1702 rcBBox.right = FXSYS_round(char_rect.right * 1000); | 1702 rcBBox.right = FXSYS_round(char_rect.right * 1000); |
1703 rcBBox.top = FXSYS_round(char_rect.top * 1000); | 1703 rcBBox.top = FXSYS_round(char_rect.top * 1000); |
1704 rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000); | 1704 rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000); |
1705 | 1705 |
1706 ASSERT(!pdfium::ContainsKey(m_CacheMap, charcode)); | 1706 ASSERT(!pdfium::ContainsKey(m_CacheMap, charcode)); |
1707 CPDF_Type3Char* pCachedChar = pNewChar.release(); | 1707 CPDF_Type3Char* pCachedChar = pNewChar.release(); |
1708 m_CacheMap[charcode] = pCachedChar; | 1708 m_CacheMap[charcode] = pCachedChar; |
1709 if (pCachedChar->m_pForm->CountObjects() == 0) { | 1709 if (pCachedChar->m_pForm->GetPageObjectList()->GetCount() == 0) { |
1710 delete pCachedChar->m_pForm; | 1710 delete pCachedChar->m_pForm; |
1711 pCachedChar->m_pForm = nullptr; | 1711 pCachedChar->m_pForm = nullptr; |
1712 } | 1712 } |
1713 return pCachedChar; | 1713 return pCachedChar; |
1714 } | 1714 } |
1715 | 1715 |
1716 int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level) { | 1716 int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level) { |
1717 if (charcode >= FX_ArraySize(m_CharWidthL)) | 1717 if (charcode >= FX_ArraySize(m_CharWidthL)) |
1718 charcode = 0; | 1718 charcode = 0; |
1719 | 1719 |
(...skipping 16 matching lines...) Expand all Loading... |
1736 rect = pChar->m_BBox; | 1736 rect = pChar->m_BBox; |
1737 } | 1737 } |
1738 | 1738 |
1739 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) | 1739 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) |
1740 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} | 1740 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} |
1741 | 1741 |
1742 CPDF_Type3Char::~CPDF_Type3Char() { | 1742 CPDF_Type3Char::~CPDF_Type3Char() { |
1743 delete m_pForm; | 1743 delete m_pForm; |
1744 delete m_pBitmap; | 1744 delete m_pBitmap; |
1745 } | 1745 } |
OLD | NEW |