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 XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 7 #ifndef XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
8 #define XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 8 #define XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 uint32_t dwFontStyles, | 45 uint32_t dwFontStyles, |
46 const FX_WCHAR* pszFontFamily = nullptr) override; | 46 const FX_WCHAR* pszFontFamily = nullptr) override; |
47 CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, | 47 CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, |
48 uint32_t dwFontStyles, | 48 uint32_t dwFontStyles, |
49 uint16_t wCodePage = 0xFFFF) override; | 49 uint16_t wCodePage = 0xFFFF) override; |
50 CFGAS_GEFont* LoadFont(const uint8_t* pBuffer, int32_t iLength) override; | 50 CFGAS_GEFont* LoadFont(const uint8_t* pBuffer, int32_t iLength) override; |
51 CFGAS_GEFont* LoadFont(IFX_Stream* pFontStream, | 51 CFGAS_GEFont* LoadFont(IFX_Stream* pFontStream, |
52 const FX_WCHAR* pszFontAlias = nullptr, | 52 const FX_WCHAR* pszFontAlias = nullptr, |
53 uint32_t dwFontStyles = 0, | 53 uint32_t dwFontStyles = 0, |
54 uint16_t wCodePage = 0, | 54 uint16_t wCodePage = 0, |
55 FX_BOOL bSaveStream = FALSE) override; | 55 bool bSaveStream = false) override; |
56 CFGAS_GEFont* LoadFont(CFGAS_GEFont* pSrcFont, | 56 CFGAS_GEFont* LoadFont(CFGAS_GEFont* pSrcFont, |
57 uint32_t dwFontStyles, | 57 uint32_t dwFontStyles, |
58 uint16_t wCodePage = 0xFFFF) override; | 58 uint16_t wCodePage = 0xFFFF) override; |
59 | 59 |
60 void ClearFontCache() override; | 60 void ClearFontCache() override; |
61 void RemoveFont(CFGAS_GEFont* pFont) override; | 61 void RemoveFont(CFGAS_GEFont* pFont) override; |
62 | 62 |
63 protected: | 63 protected: |
64 void RemoveFont(CFX_MapPtrToPtr& fontMap, CFGAS_GEFont* pFont); | 64 void RemoveFont(CFX_MapPtrToPtr& fontMap, CFGAS_GEFont* pFont); |
65 FX_FONTDESCRIPTOR const* FindFont(const FX_WCHAR* pszFontFamily, | 65 FX_FONTDESCRIPTOR const* FindFont(const FX_WCHAR* pszFontFamily, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 const FX_WCHAR* pszFontFamily) override; | 171 const FX_WCHAR* pszFontFamily) override; |
172 CFGAS_GEFont* GetFontByLanguage(uint16_t wLanguage, | 172 CFGAS_GEFont* GetFontByLanguage(uint16_t wLanguage, |
173 uint32_t dwFontStyles, | 173 uint32_t dwFontStyles, |
174 const FX_WCHAR* pszFontFamily) override; | 174 const FX_WCHAR* pszFontFamily) override; |
175 void ClearFontCache() override; | 175 void ClearFontCache() override; |
176 void RemoveFont(CFGAS_GEFont* pFont) override; | 176 void RemoveFont(CFGAS_GEFont* pFont) override; |
177 | 177 |
178 CFGAS_GEFont* LoadFont(const CFX_WideString& wsFaceName, | 178 CFGAS_GEFont* LoadFont(const CFX_WideString& wsFaceName, |
179 int32_t iFaceIndex, | 179 int32_t iFaceIndex, |
180 int32_t* pFaceCount); | 180 int32_t* pFaceCount); |
181 FX_BOOL EnumFonts(); | 181 bool EnumFonts(); |
182 FX_BOOL EnumFontsFromFontMapper(); | 182 bool EnumFontsFromFontMapper(); |
183 FX_BOOL EnumFontsFromFiles(); | 183 bool EnumFontsFromFiles(); |
184 | 184 |
185 protected: | 185 protected: |
186 void RegisterFace(FXFT_Face pFace, | 186 void RegisterFace(FXFT_Face pFace, |
187 const CFX_WideString* pFaceName); | 187 const CFX_WideString* pFaceName); |
188 void RegisterFaces(IFX_SeekableReadStream* pFontStream, | 188 void RegisterFaces(IFX_SeekableReadStream* pFontStream, |
189 const CFX_WideString* pFaceName); | 189 const CFX_WideString* pFaceName); |
190 void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names); | 190 void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names); |
191 std::vector<uint16_t> GetCharsets(FXFT_Face pFace) const; | 191 std::vector<uint16_t> GetCharsets(FXFT_Face pFace) const; |
192 void GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB); | 192 void GetUSBCSB(FXFT_Face pFace, uint32_t* USB, uint32_t* CSB); |
193 uint32_t GetFlags(FXFT_Face pFace); | 193 uint32_t GetFlags(FXFT_Face pFace); |
194 FX_BOOL VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode); | 194 bool VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode); |
195 FX_BOOL VerifyUnicode(CFGAS_GEFont* pFont, FX_WCHAR wcUnicode); | 195 bool VerifyUnicode(CFGAS_GEFont* pFont, FX_WCHAR wcUnicode); |
196 int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); | 196 int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2); |
197 int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, | 197 int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, |
198 uint16_t wCodePage, | 198 uint16_t wCodePage, |
199 uint32_t dwFontStyles, | 199 uint32_t dwFontStyles, |
200 const CFX_WideString& FontName, | 200 const CFX_WideString& FontName, |
201 FX_WCHAR wcUnicode = 0xFFFE); | 201 FX_WCHAR wcUnicode = 0xFFFE); |
202 int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, | 202 int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, |
203 uint16_t wCodePage, | 203 uint16_t wCodePage, |
204 uint32_t dwFontStyles, | 204 uint32_t dwFontStyles, |
205 const CFX_WideString& FontName, | 205 const CFX_WideString& FontName, |
206 FX_WCHAR wcUnicode = 0xFFFE); | 206 FX_WCHAR wcUnicode = 0xFFFE); |
207 FXFT_Face LoadFace(IFX_SeekableReadStream* pFontStream, int32_t iFaceIndex); | 207 FXFT_Face LoadFace(IFX_SeekableReadStream* pFontStream, int32_t iFaceIndex); |
208 IFX_SeekableReadStream* CreateFontStream(CFX_FontMapper* pFontMapper, | 208 IFX_SeekableReadStream* CreateFontStream(CFX_FontMapper* pFontMapper, |
209 IFX_SystemFontInfo* pSystemFontInfo, | 209 IFX_SystemFontInfo* pSystemFontInfo, |
210 uint32_t index); | 210 uint32_t index); |
211 IFX_SeekableReadStream* CreateFontStream(const CFX_ByteString& bsFaceName); | 211 IFX_SeekableReadStream* CreateFontStream(const CFX_ByteString& bsFaceName); |
212 | 212 |
213 CFX_FontDescriptors m_InstalledFonts; | 213 CFX_FontDescriptors m_InstalledFonts; |
214 CFX_MapPtrTemplate<uint32_t, CFX_FontDescriptorInfos*> m_Hash2CandidateList; | 214 CFX_MapPtrTemplate<uint32_t, CFX_FontDescriptorInfos*> m_Hash2CandidateList; |
215 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<CFGAS_GEFont*>*> m_Hash2Fonts; | 215 CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<CFGAS_GEFont*>*> m_Hash2Fonts; |
216 CFX_MapPtrTemplate<CFGAS_GEFont*, IFX_SeekableReadStream*> m_IFXFont2FileRead; | 216 CFX_MapPtrTemplate<CFGAS_GEFont*, IFX_SeekableReadStream*> m_IFXFont2FileRead; |
217 CFX_MapPtrTemplate<FX_WCHAR, CFGAS_GEFont*> m_FailedUnicodes2Nullptr; | 217 CFX_MapPtrTemplate<FX_WCHAR, CFGAS_GEFont*> m_FailedUnicodes2Nullptr; |
218 CFX_FontSourceEnum_File* const m_pFontSource; | 218 CFX_FontSourceEnum_File* const m_pFontSource; |
219 }; | 219 }; |
220 #endif | 220 #endif |
221 | 221 |
222 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ | 222 #endif // XFA_FGAS_FONT_FGAS_STDFONTMGR_H_ |
OLD | NEW |