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_INCLUDE_FXGE_FX_FONT_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_FONT_H_ |
8 #define CORE_INCLUDE_FXGE_FX_FONT_H_ | 8 #define CORE_INCLUDE_FXGE_FX_FONT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "../fxcrt/fx_system.h" | 12 #include "../fxcrt/fx_system.h" |
13 #include "fx_dib.h" | 13 #include "fx_dib.h" |
14 | 14 |
15 typedef struct FT_FaceRec_* FXFT_Face; | 15 typedef struct FT_FaceRec_* FXFT_Face; |
16 typedef void* FXFT_Library; | 16 typedef void* FXFT_Library; |
17 class IFX_FontEncoding; | 17 class CFontFileFaceInfo; |
| 18 class CFX_FaceCache; |
| 19 class CFX_FontMapper; |
18 class CFX_PathData; | 20 class CFX_PathData; |
19 class CFX_SubstFont; | 21 class CFX_SubstFont; |
20 class CFX_FaceCache; | |
21 class CFX_FontMapper; | |
22 class IFX_SystemFontInfo; | 22 class IFX_SystemFontInfo; |
23 class CFontFileFaceInfo; | 23 |
24 #define FXFONT_FIXED_PITCH 0x01 | 24 #define FXFONT_FIXED_PITCH 0x01 |
25 #define FXFONT_SERIF 0x02 | 25 #define FXFONT_SERIF 0x02 |
26 #define FXFONT_SYMBOLIC 0x04 | 26 #define FXFONT_SYMBOLIC 0x04 |
27 #define FXFONT_SCRIPT 0x08 | 27 #define FXFONT_SCRIPT 0x08 |
28 #define FXFONT_ITALIC 0x40 | 28 #define FXFONT_ITALIC 0x40 |
29 #define FXFONT_BOLD 0x40000 | 29 #define FXFONT_BOLD 0x40000 |
30 #define FXFONT_USEEXTERNATTR 0x80000 | 30 #define FXFONT_USEEXTERNATTR 0x80000 |
31 #define FXFONT_CIDFONT 0x100000 | 31 #define FXFONT_CIDFONT 0x100000 |
32 #define FXFONT_ANSI_CHARSET 0 | 32 #define FXFONT_ANSI_CHARSET 0 |
33 #define FXFONT_DEFAULT_CHARSET 1 | 33 #define FXFONT_DEFAULT_CHARSET 1 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 void DeleteFace(); | 127 void DeleteFace(); |
128 | 128 |
129 protected: | 129 protected: |
130 FX_BOOL m_bEmbedded; | 130 FX_BOOL m_bEmbedded; |
131 FX_BOOL m_bVertical; | 131 FX_BOOL m_bVertical; |
132 void* m_pOwnedStream; | 132 void* m_pOwnedStream; |
133 }; | 133 }; |
134 #define ENCODING_INTERNAL 0 | 134 #define ENCODING_INTERNAL 0 |
135 #define ENCODING_UNICODE 1 | 135 #define ENCODING_UNICODE 1 |
| 136 |
136 class IFX_FontEncoding { | 137 class IFX_FontEncoding { |
137 public: | 138 public: |
138 virtual ~IFX_FontEncoding() {} | 139 virtual ~IFX_FontEncoding() {} |
139 | 140 |
140 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0; | 141 virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0; |
141 | 142 |
142 virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const = 0; | 143 virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const = 0; |
143 | 144 |
144 virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0; | 145 virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0; |
145 }; | 146 }; |
| 147 |
146 IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont); | 148 IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont); |
147 #define FXFONT_SUBST_MM 0x01 | 149 #define FXFONT_SUBST_MM 0x01 |
148 #define FXFONT_SUBST_GLYPHPATH 0x04 | 150 #define FXFONT_SUBST_GLYPHPATH 0x04 |
149 #define FXFONT_SUBST_CLEARTYPE 0x08 | 151 #define FXFONT_SUBST_CLEARTYPE 0x08 |
150 #define FXFONT_SUBST_TRANSFORM 0x10 | 152 #define FXFONT_SUBST_TRANSFORM 0x10 |
151 #define FXFONT_SUBST_NONSYMBOL 0x20 | 153 #define FXFONT_SUBST_NONSYMBOL 0x20 |
152 #define FXFONT_SUBST_EXACT 0x40 | 154 #define FXFONT_SUBST_EXACT 0x40 |
153 #define FXFONT_SUBST_STANDARD 0x80 | 155 #define FXFONT_SUBST_STANDARD 0x80 |
154 class CFX_SubstFont { | 156 class CFX_SubstFont { |
155 public: | 157 public: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 CFX_SubstFont* pSubstFont); | 223 CFX_SubstFont* pSubstFont); |
222 | 224 |
223 void FreeCache(); | 225 void FreeCache(); |
224 | 226 |
225 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); | 227 FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index); |
226 CFX_FontMapper* m_pBuiltinMapper; | 228 CFX_FontMapper* m_pBuiltinMapper; |
227 CFX_MapByteStringToPtr m_FaceMap; | 229 CFX_MapByteStringToPtr m_FaceMap; |
228 FXFT_Library m_FTLibrary; | 230 FXFT_Library m_FTLibrary; |
229 FoxitFonts m_ExternalFonts[16]; | 231 FoxitFonts m_ExternalFonts[16]; |
230 }; | 232 }; |
| 233 |
231 class IFX_FontEnumerator { | 234 class IFX_FontEnumerator { |
232 public: | 235 public: |
233 virtual ~IFX_FontEnumerator() {} | |
234 | |
235 virtual void HitFont() = 0; | 236 virtual void HitFont() = 0; |
236 | 237 |
237 virtual void Finish() = 0; | 238 virtual void Finish() = 0; |
| 239 |
| 240 protected: |
| 241 virtual ~IFX_FontEnumerator() {} |
238 }; | 242 }; |
| 243 |
239 class IFX_AdditionalFontEnum { | 244 class IFX_AdditionalFontEnum { |
240 public: | 245 public: |
241 virtual ~IFX_AdditionalFontEnum() {} | |
242 virtual int CountFiles() = 0; | 246 virtual int CountFiles() = 0; |
243 virtual IFX_FileStream* GetFontFile(int index) = 0; | 247 virtual IFX_FileStream* GetFontFile(int index) = 0; |
| 248 |
| 249 protected: |
| 250 virtual ~IFX_AdditionalFontEnum() {} |
244 }; | 251 }; |
| 252 |
245 class CFX_FontMapper { | 253 class CFX_FontMapper { |
246 public: | 254 public: |
247 explicit CFX_FontMapper(CFX_FontMgr* mgr); | 255 explicit CFX_FontMapper(CFX_FontMgr* mgr); |
248 ~CFX_FontMapper(); | 256 ~CFX_FontMapper(); |
249 | 257 |
250 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); | 258 void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo); |
251 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; } | 259 IFX_SystemFontInfo* GetSystemFontInfo() { return m_pFontInfo; } |
252 void AddInstalledFont(const CFX_ByteString& name, int charset); | 260 void AddInstalledFont(const CFX_ByteString& name, int charset); |
253 void LoadInstalledFonts(); | 261 void LoadInstalledFonts(); |
254 CFX_ByteStringArray m_InstalledTTFonts; | 262 CFX_ByteStringArray m_InstalledTTFonts; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 typedef struct { | 434 typedef struct { |
427 const CFX_GlyphBitmap* m_pGlyph; | 435 const CFX_GlyphBitmap* m_pGlyph; |
428 int m_OriginX, m_OriginY; | 436 int m_OriginX, m_OriginY; |
429 FX_FLOAT m_fOriginX, m_fOriginY; | 437 FX_FLOAT m_fOriginX, m_fOriginY; |
430 } FXTEXT_GLYPHPOS; | 438 } FXTEXT_GLYPHPOS; |
431 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, | 439 FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, |
432 int nChars, | 440 int nChars, |
433 int anti_alias, | 441 int anti_alias, |
434 FX_FLOAT retinaScaleX = 1.0f, | 442 FX_FLOAT retinaScaleX = 1.0f, |
435 FX_FLOAT retinaScaleY = 1.0f); | 443 FX_FLOAT retinaScaleY = 1.0f); |
| 444 |
436 class IFX_GSUBTable { | 445 class IFX_GSUBTable { |
437 public: | 446 public: |
438 static IFX_GSUBTable* Create(CFX_Font* pFont); | 447 static IFX_GSUBTable* Create(CFX_Font* pFont); |
| 448 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; |
| 449 |
| 450 protected: |
439 virtual ~IFX_GSUBTable() {} | 451 virtual ~IFX_GSUBTable() {} |
440 virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0; | |
441 }; | 452 }; |
442 | 453 |
443 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ | 454 #endif // CORE_INCLUDE_FXGE_FX_FONT_H_ |
OLD | NEW |