OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
dsinclair
2016/07/27 17:36:01
nit: 2016
npm
2016/07/27 18:51:57
Done.
| |
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 | |
dsinclair
2016/07/27 17:36:01
This should have a #include <memory> and #include
npm
2016/07/27 18:51:57
Done.
| |
10 #include "core/fxge/include/fx_font.h" | |
11 | |
12 class IFX_SystemFontInfo; | |
13 class CFX_FontMapper; | |
14 | |
15 class CFX_FontMgr { | |
16 public: | |
17 CFX_FontMgr(); | |
18 ~CFX_FontMgr(); | |
19 | |
20 void InitFTLibrary(); | |
21 | |
22 FXFT_Face GetCachedFace(const CFX_ByteString& face_name, | |
23 int weight, | |
24 FX_BOOL bItalic, | |
25 uint8_t*& pFontData); | |
26 FXFT_Face AddCachedFace(const CFX_ByteString& face_name, | |
27 int weight, | |
28 FX_BOOL bItalic, | |
29 uint8_t* pData, | |
30 uint32_t size, | |
31 int face_index); | |
32 FXFT_Face GetCachedTTCFace(int ttc_size, | |
33 uint32_t checksum, | |
34 int font_offset, | |
35 uint8_t*& pFontData); | |
36 FXFT_Face AddCachedTTCFace(int ttc_size, | |
37 uint32_t checksum, | |
38 uint8_t* pData, | |
39 uint32_t size, | |
40 int font_offset); | |
41 FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index); | |
42 FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index); | |
43 void ReleaseFace(FXFT_Face face); | |
44 void SetSystemFontInfo(std::unique_ptr<IFX_SystemFontInfo> pFontInfo); | |
45 FXFT_Face FindSubstFont(const CFX_ByteString& face_name, | |
46 FX_BOOL bTrueType, | |
47 uint32_t flags, | |
48 int weight, | |
49 int italic_angle, | |
50 int CharsetCP, | |
51 CFX_SubstFont* pSubstFont); | |
52 bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size); | |
53 CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); } | |
54 FXFT_Library GetFTLibrary() const { return m_FTLibrary; } | |
55 bool FTLibrarySupportsHinting() const { return m_FTLibrarySupportsHinting; } | |
56 | |
57 private: | |
58 std::unique_ptr<CFX_FontMapper> m_pBuiltinMapper; | |
59 std::map<CFX_ByteString, CTTFontDesc*> m_FaceMap; | |
60 FXFT_Library m_FTLibrary; | |
61 bool m_FTLibrarySupportsHinting; | |
62 }; | |
63 | |
64 #endif // CORE_FXGE_INCLUDE_CFX_FONTMGR_H_ | |
OLD | NEW |