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_font/font_int.h" | 7 #include "core/fpdfapi/fpdf_font/font_int.h" |
8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/pageint.h" |
9 #include "core/include/fpdfapi/cpdf_array.h" | 10 #include "core/include/fpdfapi/cpdf_array.h" |
10 #include "core/include/fpdfapi/cpdf_dictionary.h" | 11 #include "core/include/fpdfapi/cpdf_dictionary.h" |
11 #include "core/include/fpdfapi/cpdf_document.h" | 12 #include "core/include/fpdfapi/cpdf_document.h" |
12 #include "core/include/fpdfapi/cpdf_name.h" | 13 #include "core/include/fpdfapi/cpdf_name.h" |
13 #include "core/include/fpdfapi/cpdf_number.h" | 14 #include "core/include/fpdfapi/cpdf_number.h" |
14 #include "core/include/fpdfapi/cpdf_simple_parser.h" | 15 #include "core/include/fpdfapi/cpdf_simple_parser.h" |
15 #include "core/include/fpdfapi/fpdf_module.h" | 16 #include "core/include/fpdfapi/fpdf_module.h" |
16 #include "core/include/fpdfapi/fpdf_page.h" | 17 #include "core/include/fpdfapi/fpdf_page.h" |
17 #include "core/include/fpdfapi/fpdf_pageobj.h" | 18 #include "core/include/fpdfapi/fpdf_pageobj.h" |
18 #include "core/include/fpdfapi/fpdf_resource.h" | 19 #include "core/include/fpdfapi/fpdf_resource.h" |
19 #include "core/include/fxcrt/fx_ext.h" | 20 #include "core/include/fxcrt/fx_ext.h" |
20 #include "core/include/fxge/fx_freetype.h" | 21 #include "core/include/fxge/fx_freetype.h" |
21 #include "core/src/fpdfapi/fpdf_page/pageint.h" | |
22 #include "third_party/base/stl_util.h" | 22 #include "third_party/base/stl_util.h" |
23 | 23 |
24 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 24 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
25 #include "core/src/fxge/apple/apple_int.h" | 25 #include "core/fxge/apple/apple_int.h" |
26 #endif | 26 #endif |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 30 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
31 struct GlyphNameMap { | 31 struct GlyphNameMap { |
32 const FX_CHAR* m_pStrAdobe; | 32 const FX_CHAR* m_pStrAdobe; |
33 const FX_CHAR* m_pStrUnicode; | 33 const FX_CHAR* m_pStrUnicode; |
34 }; | 34 }; |
35 | 35 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (index < 0 || index >= FX_ArraySize(m_StockFonts)) | 131 if (index < 0 || index >= FX_ArraySize(m_StockFonts)) |
132 return; | 132 return; |
133 m_StockFonts[index].reset(font); | 133 m_StockFonts[index].reset(font); |
134 } | 134 } |
135 | 135 |
136 CPDF_FontGlobals::CPDF_FontGlobals() { | 136 CPDF_FontGlobals::CPDF_FontGlobals() { |
137 FXSYS_memset(m_EmbeddedCharsets, 0, sizeof(m_EmbeddedCharsets)); | 137 FXSYS_memset(m_EmbeddedCharsets, 0, sizeof(m_EmbeddedCharsets)); |
138 FXSYS_memset(m_EmbeddedToUnicodes, 0, sizeof(m_EmbeddedToUnicodes)); | 138 FXSYS_memset(m_EmbeddedToUnicodes, 0, sizeof(m_EmbeddedToUnicodes)); |
139 } | 139 } |
140 | 140 |
141 CPDF_FontGlobals::~CPDF_FontGlobals() { | 141 CPDF_FontGlobals::~CPDF_FontGlobals() {} |
142 } | |
143 | 142 |
144 CPDF_Font* CPDF_FontGlobals::Find(CPDF_Document* pDoc, int index) { | 143 CPDF_Font* CPDF_FontGlobals::Find(CPDF_Document* pDoc, int index) { |
145 auto it = m_StockMap.find(pDoc); | 144 auto it = m_StockMap.find(pDoc); |
146 if (it == m_StockMap.end()) | 145 if (it == m_StockMap.end()) |
147 return nullptr; | 146 return nullptr; |
148 return it->second ? it->second->GetFont(index) : nullptr; | 147 return it->second ? it->second->GetFont(index) : nullptr; |
149 } | 148 } |
150 | 149 |
151 void CPDF_FontGlobals::Set(CPDF_Document* pDoc, int index, CPDF_Font* pFont) { | 150 void CPDF_FontGlobals::Set(CPDF_Document* pDoc, int index, CPDF_Font* pFont) { |
152 if (!pdfium::ContainsKey(m_StockMap, pDoc)) | 151 if (!pdfium::ContainsKey(m_StockMap, pDoc)) |
(...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 return pChar ? pChar->m_BBox : FX_RECT(); | 1805 return pChar ? pChar->m_BBox : FX_RECT(); |
1807 } | 1806 } |
1808 | 1807 |
1809 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) | 1808 CPDF_Type3Char::CPDF_Type3Char(CPDF_Form* pForm) |
1810 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} | 1809 : m_pForm(pForm), m_pBitmap(nullptr), m_bColored(FALSE) {} |
1811 | 1810 |
1812 CPDF_Type3Char::~CPDF_Type3Char() { | 1811 CPDF_Type3Char::~CPDF_Type3Char() { |
1813 delete m_pForm; | 1812 delete m_pForm; |
1814 delete m_pBitmap; | 1813 delete m_pBitmap; |
1815 } | 1814 } |
OLD | NEW |