OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ |
| 8 #define CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ |
| 9 |
| 10 #include <map> |
| 11 #include <memory> |
| 12 |
| 13 #include "core/fxge/include/fx_font.h" |
| 14 |
| 15 class IFX_SystemFontInfo; |
| 16 class CFX_FontMapper; |
| 17 |
| 18 class CFX_FontMgr { |
| 19 public: |
| 20 CFX_FontMgr(); |
| 21 ~CFX_FontMgr(); |
| 22 |
| 23 void InitFTLibrary(); |
| 24 |
| 25 FXFT_Face GetCachedFace(const CFX_ByteString& face_name, |
| 26 int weight, |
| 27 FX_BOOL bItalic, |
| 28 uint8_t*& pFontData); |
| 29 FXFT_Face AddCachedFace(const CFX_ByteString& face_name, |
| 30 int weight, |
| 31 FX_BOOL bItalic, |
| 32 uint8_t* pData, |
| 33 uint32_t size, |
| 34 int face_index); |
| 35 FXFT_Face GetCachedTTCFace(int ttc_size, |
| 36 uint32_t checksum, |
| 37 int font_offset, |
| 38 uint8_t*& pFontData); |
| 39 FXFT_Face AddCachedTTCFace(int ttc_size, |
| 40 uint32_t checksum, |
| 41 uint8_t* pData, |
| 42 uint32_t size, |
| 43 int font_offset); |
| 44 FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); |
| 45 FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index); |
| 46 void ReleaseFace(FXFT_Face face); |
| 47 void SetSystemFontInfo(std::unique_ptr<IFX_SystemFontInfo> pFontInfo); |
| 48 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, |
| 49 FX_BOOL bTrueType, |
| 50 uint32_t flags, |
| 51 int weight, |
| 52 int italic_angle, |
| 53 int CharsetCP, |
| 54 CFX_SubstFont* pSubstFont); |
| 55 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); |
| 56 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } |
| 57 FXFT_Library GetFTLibrary() const { return m_FTLibrary; } |
| 58 bool FTLibrarySupportsHinting() const { return m_FTLibrarySupportsHinting; } |
| 59 |
| 60 private: |
| 61 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper; |
| 62 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; |
| 63 FXFT_Library m_FTLibrary; |
| 64 bool m_FTLibrarySupportsHinting; |
| 65 }; |
| 66 |
| 67 #endif // CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ |
OLD | NEW |