OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_IFX_SYSTEMFONTINFO_H_ | 7 #ifndef CORE_FXGE_IFX_SYSTEMFONTINFO_H_ |
8 #define CORE_FXGE_IFX_SYSTEMFONTINFO_H_ | 8 #define CORE_FXGE_IFX_SYSTEMFONTINFO_H_ |
9 | 9 |
10 #include "core/fxge/cfx_fontmapper.h" | 10 #include "core/fxge/cfx_fontmapper.h" |
11 #include "core/fxge/fx_font.h" | 11 #include "core/fxge/fx_font.h" |
12 | 12 |
13 const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name"); | 13 const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name"); |
14 const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); | 14 const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf"); |
15 | 15 |
16 class IFX_SystemFontInfo { | 16 class IFX_SystemFontInfo { |
17 public: | 17 public: |
18 static std::unique_ptr<IFX_SystemFontInfo> CreateDefault( | 18 static std::unique_ptr<IFX_SystemFontInfo> CreateDefault( |
19 const char** pUserPaths); | 19 const char** pUserPaths); |
20 | 20 |
21 virtual ~IFX_SystemFontInfo() {} | 21 virtual ~IFX_SystemFontInfo() {} |
22 | 22 |
23 virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; | 23 virtual bool EnumFontList(CFX_FontMapper* pMapper) = 0; |
24 virtual void* MapFont(int weight, | 24 virtual void* MapFont(int weight, |
25 FX_BOOL bItalic, | 25 bool bItalic, |
26 int charset, | 26 int charset, |
27 int pitch_family, | 27 int pitch_family, |
28 const FX_CHAR* face, | 28 const FX_CHAR* face, |
29 int& iExact) = 0; | 29 int& iExact) = 0; |
30 | 30 |
31 #ifdef PDF_ENABLE_XFA | 31 #ifdef PDF_ENABLE_XFA |
32 virtual void* MapFontByUnicode(uint32_t dwUnicode, | 32 virtual void* MapFontByUnicode(uint32_t dwUnicode, |
33 int weight, | 33 int weight, |
34 FX_BOOL bItalic, | 34 bool bItalic, |
35 int pitch_family); | 35 int pitch_family); |
36 #endif // PDF_ENABLE_XFA | 36 #endif // PDF_ENABLE_XFA |
37 | 37 |
38 virtual void* GetFont(const FX_CHAR* face) = 0; | 38 virtual void* GetFont(const FX_CHAR* face) = 0; |
39 virtual uint32_t GetFontData(void* hFont, | 39 virtual uint32_t GetFontData(void* hFont, |
40 uint32_t table, | 40 uint32_t table, |
41 uint8_t* buffer, | 41 uint8_t* buffer, |
42 uint32_t size) = 0; | 42 uint32_t size) = 0; |
43 virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0; | 43 virtual bool GetFaceName(void* hFont, CFX_ByteString& name) = 0; |
44 virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0; | 44 virtual bool GetFontCharset(void* hFont, int& charset) = 0; |
45 virtual int GetFaceIndex(void* hFont); | 45 virtual int GetFaceIndex(void* hFont); |
46 virtual void DeleteFont(void* hFont) = 0; | 46 virtual void DeleteFont(void* hFont) = 0; |
47 }; | 47 }; |
48 | 48 |
49 #endif // CORE_FXGE_IFX_SYSTEMFONTINFO_H_ | 49 #endif // CORE_FXGE_IFX_SYSTEMFONTINFO_H_ |
OLD | NEW |