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_FX_FONT_H_ | 7 #ifndef CORE_FXGE_FX_FONT_H_ |
8 #define CORE_FXGE_FX_FONT_H_ | 8 #define CORE_FXGE_FX_FONT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void AdjustMMParams(int glyph_index, int width, int weight) const; | 163 void AdjustMMParams(int glyph_index, int width, int weight) const; |
164 | 164 |
165 static const size_t kAngleSkewArraySize = 30; | 165 static const size_t kAngleSkewArraySize = 30; |
166 static const char s_AngleSkew[kAngleSkewArraySize]; | 166 static const char s_AngleSkew[kAngleSkewArraySize]; |
167 static const size_t kWeightPowArraySize = 100; | 167 static const size_t kWeightPowArraySize = 100; |
168 static const uint8_t s_WeightPow[kWeightPowArraySize]; | 168 static const uint8_t s_WeightPow[kWeightPowArraySize]; |
169 static const uint8_t s_WeightPow_11[kWeightPowArraySize]; | 169 static const uint8_t s_WeightPow_11[kWeightPowArraySize]; |
170 static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize]; | 170 static const uint8_t s_WeightPow_SHIFTJIS[kWeightPowArraySize]; |
171 | 171 |
172 #ifdef PDF_ENABLE_XFA | 172 #ifdef PDF_ENABLE_XFA |
173 | |
174 protected: | 173 protected: |
175 CFX_BinaryBuf m_OtfFontData; | |
176 bool m_bShallowCopy; | 174 bool m_bShallowCopy; |
177 FXFT_StreamRec* m_pOwnedStream; | 175 FXFT_StreamRec* m_pOwnedStream; |
178 #endif // PDF_ENABLE_XFA | 176 #endif // PDF_ENABLE_XFA |
179 | 177 |
180 private: | 178 private: |
181 friend class CFX_FaceCache; | 179 friend class CFX_FaceCache; |
182 CFX_PathData* LoadGlyphPathImpl(uint32_t glyph_index, | 180 CFX_PathData* LoadGlyphPathImpl(uint32_t glyph_index, |
183 int dest_width = 0) const; | 181 int dest_width = 0) const; |
184 | |
185 private: | |
186 CFX_FaceCache* GetFaceCache() const; | 182 CFX_FaceCache* GetFaceCache() const; |
187 | |
188 void ReleasePlatformResource(); | 183 void ReleasePlatformResource(); |
189 void DeleteFace(); | 184 void DeleteFace(); |
190 | |
191 void ClearFaceCache(); | 185 void ClearFaceCache(); |
192 | 186 |
193 FXFT_Face m_Face; | 187 FXFT_Face m_Face; |
194 mutable CFX_FaceCache* m_FaceCache; // not owned. | 188 mutable CFX_FaceCache* m_FaceCache; // not owned. |
195 std::unique_ptr<CFX_SubstFont> m_pSubstFont; | 189 std::unique_ptr<CFX_SubstFont> m_pSubstFont; |
196 std::vector<uint8_t> m_pFontDataAllocation; | 190 std::vector<uint8_t> m_pFontDataAllocation; |
197 uint8_t* m_pFontData; | 191 uint8_t* m_pFontData; |
198 uint8_t* m_pGsubData; | 192 uint8_t* m_pGsubData; |
199 uint32_t m_dwSize; | 193 uint32_t m_dwSize; |
200 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 194 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 FX_FLOAT retinaScaleX = 1.0f, | 235 FX_FLOAT retinaScaleX = 1.0f, |
242 FX_FLOAT retinaScaleY = 1.0f); | 236 FX_FLOAT retinaScaleY = 1.0f); |
243 | 237 |
244 CFX_ByteString GetNameFromTT(const uint8_t* name_table, | 238 CFX_ByteString GetNameFromTT(const uint8_t* name_table, |
245 uint32_t name_table_size, | 239 uint32_t name_table_size, |
246 uint32_t name); | 240 uint32_t name); |
247 | 241 |
248 int PDF_GetStandardFontName(CFX_ByteString* name); | 242 int PDF_GetStandardFontName(CFX_ByteString* name); |
249 | 243 |
250 #endif // CORE_FXGE_FX_FONT_H_ | 244 #endif // CORE_FXGE_FX_FONT_H_ |
OLD | NEW |