| 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_FONT_H_ | 7 #ifndef XFA_FGAS_FONT_FGAS_FONT_H_ |
| 8 #define XFA_FGAS_FONT_FGAS_FONT_H_ | 8 #define XFA_FGAS_FONT_FGAS_FONT_H_ |
| 9 | 9 |
| 10 #include "core/fxge/include/fx_font.h" | 10 #include "core/fxge/include/fx_font.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #define FX_FONTMATCHPARA_MacthFamily 0x02 | 73 #define FX_FONTMATCHPARA_MacthFamily 0x02 |
| 74 #define FX_FONTMATCHPARA_MacthUnicode 0x04 | 74 #define FX_FONTMATCHPARA_MacthUnicode 0x04 |
| 75 typedef void (*FX_LPEnumAllFonts)(CFX_FontDescriptors& fonts, | 75 typedef void (*FX_LPEnumAllFonts)(CFX_FontDescriptors& fonts, |
| 76 const FX_WCHAR* pwsFaceName, | 76 const FX_WCHAR* pwsFaceName, |
| 77 FX_WCHAR wUnicode); | 77 FX_WCHAR wUnicode); |
| 78 FX_LPEnumAllFonts FX_GetDefFontEnumerator(); | 78 FX_LPEnumAllFonts FX_GetDefFontEnumerator(); |
| 79 typedef FX_FONTDESCRIPTOR const* (*FX_LPMatchFont)( | 79 typedef FX_FONTDESCRIPTOR const* (*FX_LPMatchFont)( |
| 80 FX_LPFONTMATCHPARAMS pParams, | 80 FX_LPFONTMATCHPARAMS pParams, |
| 81 const CFX_FontDescriptors& fonts); | 81 const CFX_FontDescriptors& fonts); |
| 82 FX_LPMatchFont FX_GetDefFontMatchor(); | 82 FX_LPMatchFont FX_GetDefFontMatchor(); |
| 83 |
| 83 class IFGAS_FontMgr { | 84 class IFGAS_FontMgr { |
| 84 public: | 85 public: |
| 85 static IFGAS_FontMgr* Create(FX_LPEnumAllFonts pEnumerator); | |
| 86 virtual ~IFGAS_FontMgr() {} | 86 virtual ~IFGAS_FontMgr() {} |
| 87 virtual void Release() = 0; | 87 |
| 88 static std::unique_ptr<IFGAS_FontMgr> Create(FX_LPEnumAllFonts pEnumerator); |
| 89 |
| 88 virtual CFGAS_GEFont* GetDefFontByCodePage( | 90 virtual CFGAS_GEFont* GetDefFontByCodePage( |
| 89 uint16_t wCodePage, | 91 uint16_t wCodePage, |
| 90 uint32_t dwFontStyles, | 92 uint32_t dwFontStyles, |
| 91 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 93 const FX_WCHAR* pszFontFamily = nullptr) = 0; |
| 92 virtual CFGAS_GEFont* GetDefFontByCharset( | 94 virtual CFGAS_GEFont* GetDefFontByCharset( |
| 93 uint8_t nCharset, | 95 uint8_t nCharset, |
| 94 uint32_t dwFontStyles, | 96 uint32_t dwFontStyles, |
| 95 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 97 const FX_WCHAR* pszFontFamily = nullptr) = 0; |
| 96 virtual CFGAS_GEFont* GetDefFontByUnicode( | 98 virtual CFGAS_GEFont* GetDefFontByUnicode( |
| 97 FX_WCHAR wUnicode, | 99 FX_WCHAR wUnicode, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 114 uint32_t dwFontStyles, | 116 uint32_t dwFontStyles, |
| 115 uint16_t wCodePage = 0xFFFF) = 0; | 117 uint16_t wCodePage = 0xFFFF) = 0; |
| 116 virtual void ClearFontCache() = 0; | 118 virtual void ClearFontCache() = 0; |
| 117 virtual void RemoveFont(CFGAS_GEFont* pFont) = 0; | 119 virtual void RemoveFont(CFGAS_GEFont* pFont) = 0; |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 122 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 121 | 123 |
| 122 class IFGAS_FontMgr { | 124 class IFGAS_FontMgr { |
| 123 public: | 125 public: |
| 124 static IFGAS_FontMgr* Create(CFX_FontSourceEnum_File* pFontEnum); | |
| 125 virtual ~IFGAS_FontMgr() {} | 126 virtual ~IFGAS_FontMgr() {} |
| 126 virtual void Release() = 0; | 127 |
| 127 virtual CFGAS_GEFont* GetDefFontByCodePage( | 128 static std::unique_ptr<IFGAS_FontMgr> Create( |
| 128 uint16_t wCodePage, | 129 CFX_FontSourceEnum_File* pFontEnum); |
| 129 uint32_t dwFontStyles, | 130 |
| 130 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 131 virtual CFGAS_GEFont* GetDefFontByCodePage(uint16_t wCodePage, |
| 131 virtual CFGAS_GEFont* GetDefFontByCharset( | 132 uint32_t dwFontStyles, |
| 132 uint8_t nCharset, | 133 const FX_WCHAR* pszFontFamily) = 0; |
| 133 uint32_t dwFontStyles, | 134 virtual CFGAS_GEFont* GetDefFontByCharset(uint8_t nCharset, |
| 134 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 135 uint32_t dwFontStyles, |
| 135 virtual CFGAS_GEFont* GetDefFontByUnicode( | 136 const FX_WCHAR* pszFontFamily) = 0; |
| 136 FX_WCHAR wUnicode, | 137 virtual CFGAS_GEFont* GetDefFontByUnicode(FX_WCHAR wUnicode, |
| 137 uint32_t dwFontStyles, | 138 uint32_t dwFontStyles, |
| 138 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 139 const FX_WCHAR* pszFontFamily) = 0; |
| 139 virtual CFGAS_GEFont* GetDefFontByLanguage( | 140 virtual CFGAS_GEFont* GetDefFontByLanguage(uint16_t wLanguage, |
| 140 uint16_t wLanguage, | 141 uint32_t dwFontStyles, |
| 141 uint32_t dwFontStyles, | 142 const FX_WCHAR* pszFontFamily) = 0; |
| 142 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 143 virtual CFGAS_GEFont* GetFontByCodePage(uint16_t wCodePage, |
| 143 virtual CFGAS_GEFont* GetFontByCodePage( | 144 uint32_t dwFontStyles, |
| 144 uint16_t wCodePage, | 145 const FX_WCHAR* pszFontFamily) = 0; |
| 145 uint32_t dwFontStyles, | |
| 146 const FX_WCHAR* pszFontFamily = nullptr) = 0; | |
| 147 inline CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, | 146 inline CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, |
| 148 uint32_t dwFontStyles, | 147 uint32_t dwFontStyles, |
| 149 uint16_t wCodePage) { | 148 uint16_t wCodePage) { |
| 150 return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); | 149 return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily); |
| 151 } | 150 } |
| 152 virtual CFGAS_GEFont* GetFontByCharset( | 151 virtual CFGAS_GEFont* GetFontByCharset(uint8_t nCharset, |
| 153 uint8_t nCharset, | 152 uint32_t dwFontStyles, |
| 154 uint32_t dwFontStyles, | 153 const FX_WCHAR* pszFontFamily) = 0; |
| 155 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 154 virtual CFGAS_GEFont* GetFontByUnicode(FX_WCHAR wUnicode, |
| 156 virtual CFGAS_GEFont* GetFontByUnicode( | 155 uint32_t dwFontStyles, |
| 157 FX_WCHAR wUnicode, | 156 const FX_WCHAR* pszFontFamily) = 0; |
| 158 uint32_t dwFontStyles, | 157 virtual CFGAS_GEFont* GetFontByLanguage(uint16_t wLanguage, |
| 159 const FX_WCHAR* pszFontFamily = nullptr) = 0; | 158 uint32_t dwFontStyles, |
| 160 virtual CFGAS_GEFont* GetFontByLanguage( | 159 const FX_WCHAR* pszFontFamily) = 0; |
| 161 uint16_t wLanguage, | |
| 162 uint32_t dwFontStyles, | |
| 163 const FX_WCHAR* pszFontFamily = nullptr) = 0; | |
| 164 virtual void ClearFontCache() = 0; | 160 virtual void ClearFontCache() = 0; |
| 165 virtual void RemoveFont(CFGAS_GEFont* pFont) = 0; | 161 virtual void RemoveFont(CFGAS_GEFont* pFont) = 0; |
| 166 }; | 162 }; |
| 167 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 163 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| 168 | 164 |
| 169 #endif // XFA_FGAS_FONT_FGAS_FONT_H_ | 165 #endif // XFA_FGAS_FONT_FGAS_FONT_H_ |
| OLD | NEW |