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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 virtual FX_BOOL GetBBox(CFX_Rect& bbox) = 0; | 94 virtual FX_BOOL GetBBox(CFX_Rect& bbox) = 0; |
95 virtual int32_t GetItalicAngle() const = 0; | 95 virtual int32_t GetItalicAngle() const = 0; |
96 virtual void Reset() = 0; | 96 virtual void Reset() = 0; |
97 virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const = 0; | 97 virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const = 0; |
98 virtual void* GetDevFont() const = 0; | 98 virtual void* GetDevFont() const = 0; |
99 virtual void SetFontProvider(IFX_FontProvider* pProvider) = 0; | 99 virtual void SetFontProvider(IFX_FontProvider* pProvider) = 0; |
100 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 100 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
101 virtual void SetLogicalFontStyle(uint32_t dwLogFontStyle) = 0; | 101 virtual void SetLogicalFontStyle(uint32_t dwLogFontStyle) = 0; |
102 #endif | 102 #endif |
103 }; | 103 }; |
104 | |
104 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 105 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
105 struct FX_FONTMATCHPARAMS { | 106 struct FX_FONTMATCHPARAMS { |
106 const FX_WCHAR* pwsFamily; | 107 const FX_WCHAR* pwsFamily; |
107 uint32_t dwFontStyles; | 108 uint32_t dwFontStyles; |
108 uint32_t dwUSB; | 109 uint32_t dwUSB; |
109 uint32_t dwMatchFlags; | 110 uint32_t dwMatchFlags; |
110 FX_WCHAR wUnicode; | 111 FX_WCHAR wUnicode; |
111 uint16_t wCodePage; | 112 uint16_t wCodePage; |
112 }; | 113 }; |
113 typedef FX_FONTMATCHPARAMS* FX_LPFONTMATCHPARAMS; | 114 typedef FX_FONTMATCHPARAMS* FX_LPFONTMATCHPARAMS; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 void* pUserData, | 149 void* pUserData, |
149 const FX_WCHAR* pwsFaceName, | 150 const FX_WCHAR* pwsFaceName, |
150 FX_WCHAR wUnicode); | 151 FX_WCHAR wUnicode); |
151 FX_LPEnumAllFonts FX_GetDefFontEnumerator(); | 152 FX_LPEnumAllFonts FX_GetDefFontEnumerator(); |
152 typedef FX_LPCFONTDESCRIPTOR (*FX_LPMatchFont)(FX_LPFONTMATCHPARAMS pParams, | 153 typedef FX_LPCFONTDESCRIPTOR (*FX_LPMatchFont)(FX_LPFONTMATCHPARAMS pParams, |
153 const CFX_FontDescriptors& fonts, | 154 const CFX_FontDescriptors& fonts, |
154 void* pUserData); | 155 void* pUserData); |
155 FX_LPMatchFont FX_GetDefFontMatchor(); | 156 FX_LPMatchFont FX_GetDefFontMatchor(); |
156 class IFX_FontMgr { | 157 class IFX_FontMgr { |
157 public: | 158 public: |
158 static IFX_FontMgr* Create(FX_LPEnumAllFonts pEnumerator, | 159 static IFX_FontMgr* Create(FX_LPEnumAllFonts pEnumerator); |
dsinclair
2016/04/07 14:59:50
As far as I can see these Create() methods are onl
| |
159 FX_LPMatchFont pMatcher = NULL, | |
160 void* pUserData = NULL); | |
161 virtual ~IFX_FontMgr() {} | 160 virtual ~IFX_FontMgr() {} |
162 virtual void Release() = 0; | 161 virtual void Release() = 0; |
163 virtual IFX_Font* GetDefFontByCodePage( | 162 virtual IFX_Font* GetDefFontByCodePage( |
164 uint16_t wCodePage, | 163 uint16_t wCodePage, |
165 uint32_t dwFontStyles, | 164 uint32_t dwFontStyles, |
166 const FX_WCHAR* pszFontFamily = NULL) = 0; | 165 const FX_WCHAR* pszFontFamily = NULL) = 0; |
167 virtual IFX_Font* GetDefFontByCharset( | 166 virtual IFX_Font* GetDefFontByCharset( |
168 uint8_t nCharset, | 167 uint8_t nCharset, |
169 uint32_t dwFontStyles, | 168 uint32_t dwFontStyles, |
170 const FX_WCHAR* pszFontFamily = NULL) = 0; | 169 const FX_WCHAR* pszFontFamily = NULL) = 0; |
(...skipping 14 matching lines...) Expand all Loading... | |
185 const FX_WCHAR* pszFontAlias = NULL, | 184 const FX_WCHAR* pszFontAlias = NULL, |
186 uint32_t dwFontStyles = 0, | 185 uint32_t dwFontStyles = 0, |
187 uint16_t wCodePage = 0, | 186 uint16_t wCodePage = 0, |
188 FX_BOOL bSaveStream = FALSE) = 0; | 187 FX_BOOL bSaveStream = FALSE) = 0; |
189 virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, | 188 virtual IFX_Font* LoadFont(IFX_Font* pSrcFont, |
190 uint32_t dwFontStyles, | 189 uint32_t dwFontStyles, |
191 uint16_t wCodePage = 0xFFFF) = 0; | 190 uint16_t wCodePage = 0xFFFF) = 0; |
192 virtual void ClearFontCache() = 0; | 191 virtual void ClearFontCache() = 0; |
193 virtual void RemoveFont(IFX_Font* pFont) = 0; | 192 virtual void RemoveFont(IFX_Font* pFont) = 0; |
194 }; | 193 }; |
195 #else | 194 |
196 class IFX_FontMgrDelegate { | 195 #else // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
197 public: | 196 |
198 virtual ~IFX_FontMgrDelegate() {} | |
199 virtual IFX_Font* GetDefFontByCodePage( | |
200 IFX_FontMgr* pFontMgr, | |
201 uint16_t wCodePage, | |
202 uint32_t dwFontStyles, | |
203 const FX_WCHAR* pszFontFamily = NULL) = 0; | |
204 virtual IFX_Font* GetDefFontByCharset( | |
205 IFX_FontMgr* pFontMgr, | |
206 uint8_t nCharset, | |
207 uint32_t dwFontStyles, | |
208 const FX_WCHAR* pszFontFamily = NULL) = 0; | |
209 virtual IFX_Font* GetDefFontByUnicode( | |
210 IFX_FontMgr* pFontMgr, | |
211 FX_WCHAR wUnicode, | |
212 uint32_t dwFontStyles, | |
213 const FX_WCHAR* pszFontFamily = NULL) = 0; | |
214 virtual IFX_Font* GetDefFontByLanguage( | |
215 IFX_FontMgr* pFontMgr, | |
216 uint16_t wLanguage, | |
217 uint32_t dwFontStyles, | |
218 const FX_WCHAR* pszFontFamily = NULL) = 0; | |
219 }; | |
220 class IFX_FontSourceEnum { | 197 class IFX_FontSourceEnum { |
221 public: | 198 public: |
222 virtual ~IFX_FontSourceEnum() {} | 199 virtual ~IFX_FontSourceEnum() {} |
223 virtual void Release() = 0; | 200 virtual void Release() = 0; |
224 virtual FX_POSITION GetStartPosition(void* pUserData = NULL) = 0; | 201 virtual FX_POSITION GetStartPosition(void* pUserData = NULL) = 0; |
225 virtual IFX_FileAccess* GetNext(FX_POSITION& pos, void* pUserData = NULL) = 0; | 202 virtual IFX_FileAccess* GetNext(FX_POSITION& pos, void* pUserData = NULL) = 0; |
226 }; | 203 }; |
227 IFX_FontSourceEnum* FX_CreateDefaultFontSourceEnum(); | 204 IFX_FontSourceEnum* FX_CreateDefaultFontSourceEnum(); |
228 class IFX_FontMgr { | 205 class IFX_FontMgr { |
229 public: | 206 public: |
230 static IFX_FontMgr* Create(IFX_FontSourceEnum* pFontEnum, | 207 static IFX_FontMgr* Create(IFX_FontSourceEnum* pFontEnum); |
231 IFX_FontMgrDelegate* pDelegate = NULL, | |
232 void* pUserData = NULL); | |
233 virtual ~IFX_FontMgr() {} | 208 virtual ~IFX_FontMgr() {} |
234 virtual void Release() = 0; | 209 virtual void Release() = 0; |
235 virtual IFX_Font* GetDefFontByCodePage( | 210 virtual IFX_Font* GetDefFontByCodePage( |
236 uint16_t wCodePage, | 211 uint16_t wCodePage, |
237 uint32_t dwFontStyles, | 212 uint32_t dwFontStyles, |
238 const FX_WCHAR* pszFontFamily = NULL) = 0; | 213 const FX_WCHAR* pszFontFamily = NULL) = 0; |
239 virtual IFX_Font* GetDefFontByCharset( | 214 virtual IFX_Font* GetDefFontByCharset( |
240 uint8_t nCharset, | 215 uint8_t nCharset, |
241 uint32_t dwFontStyles, | 216 uint32_t dwFontStyles, |
242 const FX_WCHAR* pszFontFamily = NULL) = 0; | 217 const FX_WCHAR* pszFontFamily = NULL) = 0; |
(...skipping 30 matching lines...) Expand all Loading... | |
273 int32_t iFaceIndex, | 248 int32_t iFaceIndex, |
274 int32_t* pFaceCount = NULL) = 0; | 249 int32_t* pFaceCount = NULL) = 0; |
275 virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, | 250 virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, |
276 int32_t iFaceIndex, | 251 int32_t iFaceIndex, |
277 int32_t* pFaceCount = NULL, | 252 int32_t* pFaceCount = NULL, |
278 FX_BOOL bSaveStream = FALSE) = 0; | 253 FX_BOOL bSaveStream = FALSE) = 0; |
279 | 254 |
280 virtual void ClearFontCache() = 0; | 255 virtual void ClearFontCache() = 0; |
281 virtual void RemoveFont(IFX_Font* pFont) = 0; | 256 virtual void RemoveFont(IFX_Font* pFont) = 0; |
282 }; | 257 }; |
283 #endif | 258 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
284 | 259 |
285 #endif // XFA_FGAS_FONT_FGAS_FONT_H_ | 260 #endif // XFA_FGAS_FONT_FGAS_FONT_H_ |
OLD | NEW |