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 #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_FONT_H_ |
8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ | 8 #define CORE_FXGE_INCLUDE_FX_FONT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 public: | 96 public: |
97 CFX_Font(); | 97 CFX_Font(); |
98 ~CFX_Font(); | 98 ~CFX_Font(); |
99 | 99 |
100 void LoadSubst(const CFX_ByteString& face_name, | 100 void LoadSubst(const CFX_ByteString& face_name, |
101 FX_BOOL bTrueType, | 101 FX_BOOL bTrueType, |
102 uint32_t flags, | 102 uint32_t flags, |
103 int weight, | 103 int weight, |
104 int italic_angle, | 104 int italic_angle, |
105 int CharsetCP, | 105 int CharsetCP, |
106 FX_BOOL bVertical = FALSE); | 106 bool bVertical); |
107 | 107 |
108 FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size); | 108 FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size); |
109 FXFT_Face GetFace() const { return m_Face; } | 109 FXFT_Face GetFace() const { return m_Face; } |
110 CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } | 110 CFX_SubstFont* GetSubstFont() const { return m_pSubstFont.get(); } |
111 | 111 |
112 #ifdef PDF_ENABLE_XFA | 112 #ifdef PDF_ENABLE_XFA |
113 FX_BOOL LoadFile(IFX_FileRead* pFile, | 113 FX_BOOL LoadFile(IFX_FileRead* pFile, |
114 int nFaceIndex = 0, | 114 int nFaceIndex = 0, |
115 int* pFaceCount = nullptr); | 115 int* pFaceCount = nullptr); |
116 | 116 |
(...skipping 16 matching lines...) Expand all Loading... |
133 CFX_TypeFace* GetDeviceCache() const; | 133 CFX_TypeFace* GetDeviceCache() const; |
134 #endif | 134 #endif |
135 | 135 |
136 int GetGlyphWidth(uint32_t glyph_index); | 136 int GetGlyphWidth(uint32_t glyph_index); |
137 int GetAscent() const; | 137 int GetAscent() const; |
138 int GetDescent() const; | 138 int GetDescent() const; |
139 FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); | 139 FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox); |
140 bool IsItalic() const; | 140 bool IsItalic() const; |
141 bool IsBold() const; | 141 bool IsBold() const; |
142 bool IsFixedWidth() const; | 142 bool IsFixedWidth() const; |
143 FX_BOOL IsVertical() const { return m_bVertical; } | 143 bool IsVertical() const { return m_bVertical; } |
144 CFX_ByteString GetPsName() const; | 144 CFX_ByteString GetPsName() const; |
145 CFX_ByteString GetFamilyName() const; | 145 CFX_ByteString GetFamilyName() const; |
146 CFX_ByteString GetFaceName() const; | 146 CFX_ByteString GetFaceName() const; |
147 FX_BOOL IsTTFont() const; | 147 bool IsTTFont() const; |
148 FX_BOOL GetBBox(FX_RECT& bbox); | 148 FX_BOOL GetBBox(FX_RECT& bbox); |
149 int GetHeight() const; | 149 int GetHeight() const; |
150 int GetULPos() const; | 150 int GetULPos() const; |
151 int GetULthickness() const; | 151 int GetULthickness() const; |
152 int GetMaxAdvanceWidth() const; | 152 int GetMaxAdvanceWidth() const; |
153 FX_BOOL IsEmbedded() const { return m_bEmbedded; } | 153 FX_BOOL IsEmbedded() const { return m_bEmbedded; } |
154 uint8_t* GetSubData() const { return m_pGsubData; } | 154 uint8_t* GetSubData() const { return m_pGsubData; } |
155 void SetSubData(uint8_t* data) { m_pGsubData = data; } | 155 void SetSubData(uint8_t* data) { m_pGsubData = data; } |
156 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 156 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
157 void* GetPlatformFont() const { return m_pPlatformFont; } | 157 void* GetPlatformFont() const { return m_pPlatformFont; } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 FXFT_Face m_Face; | 191 FXFT_Face m_Face; |
192 mutable CFX_FaceCache* m_FaceCache; // not owned. | 192 mutable CFX_FaceCache* m_FaceCache; // not owned. |
193 std::unique_ptr<CFX_SubstFont> m_pSubstFont; | 193 std::unique_ptr<CFX_SubstFont> m_pSubstFont; |
194 std::vector<uint8_t> m_pFontDataAllocation; | 194 std::vector<uint8_t> m_pFontDataAllocation; |
195 uint8_t* m_pFontData; | 195 uint8_t* m_pFontData; |
196 uint8_t* m_pGsubData; | 196 uint8_t* m_pGsubData; |
197 uint32_t m_dwSize; | 197 uint32_t m_dwSize; |
198 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 198 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
199 void* m_pPlatformFont; | 199 void* m_pPlatformFont; |
200 #endif | 200 #endif |
201 FX_BOOL m_bEmbedded; | 201 bool m_bEmbedded; |
202 FX_BOOL m_bVertical; | 202 bool m_bVertical; |
203 }; | 203 }; |
204 | 204 |
205 class CFX_FontFaceInfo { | 205 class CFX_FontFaceInfo { |
206 public: | 206 public: |
207 CFX_FontFaceInfo(CFX_ByteString filePath, | 207 CFX_FontFaceInfo(CFX_ByteString filePath, |
208 CFX_ByteString faceName, | 208 CFX_ByteString faceName, |
209 CFX_ByteString fontTables, | 209 CFX_ByteString fontTables, |
210 uint32_t fontOffset, | 210 uint32_t fontOffset, |
211 uint32_t fileSize); | 211 uint32_t fileSize); |
212 | 212 |
(...skipping 26 matching lines...) Expand all Loading... |
239 FX_FLOAT retinaScaleX = 1.0f, | 239 FX_FLOAT retinaScaleX = 1.0f, |
240 FX_FLOAT retinaScaleY = 1.0f); | 240 FX_FLOAT retinaScaleY = 1.0f); |
241 | 241 |
242 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 242 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
243 uint32_t name_table_size, | 243 uint32_t name_table_size, |
244 uint32_t name); | 244 uint32_t name); |
245 | 245 |
246 int PDF_GetStandardFontName(CFX_ByteString* name); | 246 int PDF_GetStandardFontName(CFX_ByteString* name); |
247 | 247 |
248 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ | 248 #endif // CORE_FXGE_INCLUDE_FX_FONT_H_ |
OLD | NEW |