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_ANDROID_FPF_SKIAFONTMGR_H_ | 7 #ifndef CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ |
8 #define CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ | 8 #define CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ |
9 | 9 |
10 #include "core/fxcrt/fx_system.h" | 10 #include "core/fxcrt/fx_system.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void* m_pBuffer; | 88 void* m_pBuffer; |
89 size_t m_szBuffer; | 89 size_t m_szBuffer; |
90 }; | 90 }; |
91 | 91 |
92 class CFPF_SkiaFontMgr { | 92 class CFPF_SkiaFontMgr { |
93 public: | 93 public: |
94 CFPF_SkiaFontMgr(); | 94 CFPF_SkiaFontMgr(); |
95 ~CFPF_SkiaFontMgr(); | 95 ~CFPF_SkiaFontMgr(); |
96 | 96 |
97 void LoadSystemFonts(); | 97 void LoadSystemFonts(); |
98 void LoadPrivateFont(IFX_FileRead* pFontFile); | |
99 void LoadPrivateFont(const CFX_ByteStringC& bsFileName); | |
100 void LoadPrivateFont(void* pBuffer, size_t szBuffer); | |
101 CFPF_SkiaFont* CreateFont(const CFX_ByteStringC& bsFamilyname, | 98 CFPF_SkiaFont* CreateFont(const CFX_ByteStringC& bsFamilyname, |
102 uint8_t uCharset, | 99 uint8_t uCharset, |
103 uint32_t dwStyle, | 100 uint32_t dwStyle, |
104 uint32_t dwMatch = 0); | 101 uint32_t dwMatch = 0); |
105 | 102 |
106 FX_BOOL InitFTLibrary(); | 103 bool InitFTLibrary(); |
107 FXFT_Face GetFontFace(IFX_FileRead* pFileRead, int32_t iFaceIndex = 0); | 104 FXFT_Face GetFontFace(IFX_FileRead* pFileRead, int32_t iFaceIndex = 0); |
108 FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0); | 105 FXFT_Face GetFontFace(const CFX_ByteStringC& bsFile, int32_t iFaceIndex = 0); |
109 FXFT_Face GetFontFace(const uint8_t* pBuffer, | 106 FXFT_Face GetFontFace(const uint8_t* pBuffer, |
110 size_t szBuffer, | 107 size_t szBuffer, |
111 int32_t iFaceIndex = 0); | 108 int32_t iFaceIndex = 0); |
112 | 109 |
113 protected: | 110 private: |
114 void ScanPath(const CFX_ByteString& path); | 111 void ScanPath(const CFX_ByteString& path); |
115 void ScanFile(const CFX_ByteString& file); | 112 void ScanFile(const CFX_ByteString& file); |
116 void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc); | 113 void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor* pFontDesc); |
117 void OutputSystemFonts(); | |
118 | 114 |
119 FX_BOOL m_bLoaded; | 115 bool m_bLoaded; |
120 FXFT_Library m_FTLibrary; | 116 FXFT_Library m_FTLibrary; |
121 std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces; | 117 std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces; |
122 std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts; | 118 std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts; |
123 }; | 119 }; |
124 | 120 |
125 #endif // _FX_OS_ == _FX_ANDROID_ | 121 #endif // _FX_OS_ == _FX_ANDROID_ |
126 | 122 |
127 #endif // CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ | 123 #endif // CORE_FXGE_ANDROID_FPF_SKIAFONTMGR_H_ |
OLD | NEW |