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_FPDF_FONT_INCLUDE_CPDF_FONT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ |
8 #define CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ | 8 #define CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> |
11 | 12 |
12 #include "core/fxcrt/include/fx_string.h" | 13 #include "core/fxcrt/include/fx_string.h" |
13 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
14 #include "core/fxge/include/fx_font.h" | 15 #include "core/fxge/include/fx_font.h" |
15 | 16 |
16 #define PDFFONT_FIXEDPITCH 1 | 17 #define PDFFONT_FIXEDPITCH 1 |
17 #define PDFFONT_SERIF 2 | 18 #define PDFFONT_SERIF 2 |
18 #define PDFFONT_SYMBOLIC 4 | 19 #define PDFFONT_SYMBOLIC 4 |
19 #define PDFFONT_SCRIPT 8 | 20 #define PDFFONT_SCRIPT 8 |
20 #define PDFFONT_NONSYMBOLIC 32 | 21 #define PDFFONT_NONSYMBOLIC 32 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 97 |
97 protected: | 98 protected: |
98 CPDF_Font(); | 99 CPDF_Font(); |
99 | 100 |
100 virtual FX_BOOL Load() = 0; | 101 virtual FX_BOOL Load() = 0; |
101 | 102 |
102 FX_BOOL Initialize(); | 103 FX_BOOL Initialize(); |
103 void LoadUnicodeMap() const; // logically const only. | 104 void LoadUnicodeMap() const; // logically const only. |
104 void LoadPDFEncoding(CPDF_Object* pEncoding, | 105 void LoadPDFEncoding(CPDF_Object* pEncoding, |
105 int& iBaseEncoding, | 106 int& iBaseEncoding, |
106 CFX_ByteString*& pCharNames, | 107 std::vector<CFX_ByteString>* pCharNames, |
107 FX_BOOL bEmbedded, | 108 FX_BOOL bEmbedded, |
108 FX_BOOL bTrueType); | 109 FX_BOOL bTrueType); |
109 void LoadFontDescriptor(CPDF_Dictionary* pDict); | 110 void LoadFontDescriptor(CPDF_Dictionary* pDict); |
110 void CheckFontMetrics(); | 111 void CheckFontMetrics(); |
111 | 112 |
112 const FX_CHAR* GetAdobeCharName(int iBaseEncoding, | 113 const FX_CHAR* GetAdobeCharName(int iBaseEncoding, |
113 const CFX_ByteString* pCharNames, | 114 const std::vector<CFX_ByteString>& charnames, |
114 int charcode); | 115 int charcode); |
115 | 116 |
116 CFX_ByteString m_BaseFont; | 117 CFX_ByteString m_BaseFont; |
117 CPDF_StreamAcc* m_pFontFile; | 118 CPDF_StreamAcc* m_pFontFile; |
118 CPDF_Dictionary* m_pFontDict; | 119 CPDF_Dictionary* m_pFontDict; |
119 mutable std::unique_ptr<CPDF_ToUnicodeMap> m_pToUnicodeMap; | 120 mutable std::unique_ptr<CPDF_ToUnicodeMap> m_pToUnicodeMap; |
120 mutable FX_BOOL m_bToUnicodeLoaded; | 121 mutable FX_BOOL m_bToUnicodeLoaded; |
121 int m_Flags; | 122 int m_Flags; |
122 FX_RECT m_FontBBox; | 123 FX_RECT m_FontBBox; |
123 int m_StemV; | 124 int m_StemV; |
124 int m_Ascent; | 125 int m_Ascent; |
125 int m_Descent; | 126 int m_Descent; |
126 int m_ItalicAngle; | 127 int m_ItalicAngle; |
127 }; | 128 }; |
128 | 129 |
129 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ | 130 #endif // CORE_FPDFAPI_FPDF_FONT_INCLUDE_CPDF_FONT_H_ |
OLD | NEW |