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_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ | 7 #ifndef XFA_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ |
8 #define XFA_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ | 8 #define XFA_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ |
9 | 9 |
10 #ifdef _FXPLUS | 10 #ifdef _FXPLUS |
11 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ | 11 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ |
12 _FX_OS_ == _FX_WIN64_ | 12 _FX_OS_ == _FX_WIN64_ |
13 typedef struct _FX_GDIGOCACHE { | 13 typedef struct _FX_GDIGOCACHE { |
14 GLYPHMETRICS gm; | 14 GLYPHMETRICS gm; |
15 uint8_t* pOutline; | 15 uint8_t* pOutline; |
16 } FX_GDIGOCACHE, *FX_LPGDIGOCACHE; | 16 } FX_GDIGOCACHE, *FX_LPGDIGOCACHE; |
17 typedef FX_GDIGOCACHE const* FX_LPCGDIGOCACHE; | 17 typedef FX_GDIGOCACHE const* FX_LPCGDIGOCACHE; |
18 class CFX_GdiFontCache { | 18 class CFX_GdiFontCache { |
19 public: | 19 public: |
20 CFX_GdiFontCache(); | 20 CFX_GdiFontCache(); |
21 ~CFX_GdiFontCache(); | 21 ~CFX_GdiFontCache(); |
22 void SetCachedGlyphOutline(FX_DWORD dwGlyph, | 22 void SetCachedGlyphOutline(FX_DWORD dwGlyph, |
23 const GLYPHMETRICS& gm, | 23 const GLYPHMETRICS& gm, |
24 uint8_t* pOutline); | 24 uint8_t* pOutline); |
25 FX_LPCGDIGOCACHE GetCachedGlyphOutline(FX_DWORD dwGlyph) const; | 25 FX_LPCGDIGOCACHE GetCachedGlyphOutline(FX_DWORD dwGlyph) const; |
26 | 26 |
27 protected: | 27 protected: |
28 CFX_MapPtrToPtr m_GlyphMap; | 28 CFX_MapPtrToPtr m_GlyphMap; |
29 }; | 29 }; |
30 class CFX_GdiFont : public IFX_Font, public CFX_ThreadLock { | 30 class CFX_GdiFont : public IFX_Font { |
31 public: | 31 public: |
32 CFX_GdiFont(IFX_FontMgr* pFontMgr); | 32 CFX_GdiFont(IFX_FontMgr* pFontMgr); |
33 ~CFX_GdiFont(); | 33 ~CFX_GdiFont(); |
34 virtual void Release(); | 34 virtual void Release(); |
35 virtual IFX_Font* Retain(); | 35 virtual IFX_Font* Retain(); |
36 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, | 36 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, |
37 FX_DWORD dwFontStyles, | 37 FX_DWORD dwFontStyles, |
38 FX_WORD wCodePage); | 38 FX_WORD wCodePage); |
39 FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t iLength); | 39 FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t iLength); |
40 FX_BOOL LoadFont(const FX_WCHAR* pszFileName); | 40 FX_BOOL LoadFont(const FX_WCHAR* pszFileName); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 int32_t iHeight, | 99 int32_t iHeight, |
100 uint8_t* pOutline, | 100 uint8_t* pOutline, |
101 FX_DWORD* pDIB, | 101 FX_DWORD* pDIB, |
102 FX_ARGB argb); | 102 FX_ARGB argb); |
103 friend class CFX_GdiFontMgr; | 103 friend class CFX_GdiFontMgr; |
104 }; | 104 }; |
105 #endif | 105 #endif |
106 #endif | 106 #endif |
107 | 107 |
108 #endif // XFA_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ | 108 #endif // XFA_SRC_FGAS_SRC_FONT_FX_GDIFONT_H_ |
OLD | NEW |