OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ | 7 #ifndef CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ |
8 #define CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ | 8 #define CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/fpdfapi/font/cpdf_font.h" | 13 #include "core/fpdfapi/font/cpdf_font.h" |
| 14 #include "core/fxcrt/cfx_maybe_owned.h" |
14 #include "core/fxcrt/fx_string.h" | 15 #include "core/fxcrt/fx_string.h" |
15 #include "core/fxcrt/fx_system.h" | 16 #include "core/fxcrt/fx_system.h" |
16 | 17 |
17 enum CIDSet { | 18 enum CIDSet { |
18 CIDSET_UNKNOWN, | 19 CIDSET_UNKNOWN, |
19 CIDSET_GB1, | 20 CIDSET_GB1, |
20 CIDSET_CNS1, | 21 CIDSET_CNS1, |
21 CIDSET_JAPAN1, | 22 CIDSET_JAPAN1, |
22 CIDSET_KOREA1, | 23 CIDSET_KOREA1, |
23 CIDSET_UNICODE, | 24 CIDSET_UNICODE, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 protected: | 65 protected: |
65 void LoadGB2312(); | 66 void LoadGB2312(); |
66 int GetGlyphIndex(uint32_t unicodeb, bool* pVertGlyph); | 67 int GetGlyphIndex(uint32_t unicodeb, bool* pVertGlyph); |
67 int GetVerticalGlyph(int index, bool* pVertGlyph); | 68 int GetVerticalGlyph(int index, bool* pVertGlyph); |
68 void LoadMetricsArray(CPDF_Array* pArray, | 69 void LoadMetricsArray(CPDF_Array* pArray, |
69 std::vector<uint32_t>* result, | 70 std::vector<uint32_t>* result, |
70 int nElements); | 71 int nElements); |
71 void LoadSubstFont(); | 72 void LoadSubstFont(); |
72 FX_WCHAR GetUnicodeFromCharCode(uint32_t charcode) const; | 73 FX_WCHAR GetUnicodeFromCharCode(uint32_t charcode) const; |
73 | 74 |
74 CPDF_CMap* m_pCMap; | 75 CFX_MaybeOwned<CPDF_CMap> m_pCMap; |
75 std::unique_ptr<CPDF_CMap> m_pAllocatedCMap; | |
76 CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; | 76 CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; |
77 CIDSet m_Charset; | 77 CIDSet m_Charset; |
78 bool m_bType1; | 78 bool m_bType1; |
79 bool m_bCIDIsGID; | 79 bool m_bCIDIsGID; |
80 uint16_t m_DefaultWidth; | 80 uint16_t m_DefaultWidth; |
81 std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc; | 81 std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc; |
82 bool m_bAnsiWidthsFixed; | 82 bool m_bAnsiWidthsFixed; |
83 FX_RECT m_CharBBox[256]; | 83 FX_RECT m_CharBBox[256]; |
84 std::vector<uint32_t> m_WidthList; | 84 std::vector<uint32_t> m_WidthList; |
85 short m_DefaultVY; | 85 short m_DefaultVY; |
86 short m_DefaultW1; | 86 short m_DefaultW1; |
87 std::vector<uint32_t> m_VertMetrics; | 87 std::vector<uint32_t> m_VertMetrics; |
88 bool m_bAdobeCourierStd; | 88 bool m_bAdobeCourierStd; |
89 std::unique_ptr<CFX_CTTGSUBTable> m_pTTGSUBTable; | 89 std::unique_ptr<CFX_CTTGSUBTable> m_pTTGSUBTable; |
90 }; | 90 }; |
91 | 91 |
92 #endif // CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ | 92 #endif // CORE_FPDFAPI_FONT_CPDF_CIDFONT_H_ |
OLD | NEW |