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_GEFONT_H_ | 7 #ifndef XFA_FGAS_FONT_FGAS_GEFONT_H_ |
8 #define XFA_FGAS_FONT_FGAS_GEFONT_H_ | 8 #define XFA_FGAS_FONT_FGAS_GEFONT_H_ |
9 | 9 |
10 #include "xfa/fgas/crt/fgas_utils.h" | 10 #include "xfa/fgas/crt/fgas_utils.h" |
11 #include "xfa/fgas/font/fgas_font.h" | 11 #include "xfa/fgas/font/fgas_font.h" |
12 | 12 |
13 #define FXFONT_SUBST_ITALIC 0x02 | 13 #define FXFONT_SUBST_ITALIC 0x02 |
14 | 14 |
| 15 class CXFA_PDFFontMgr; |
| 16 |
15 class CFX_GEFont : public IFX_Font { | 17 class CFX_GEFont : public IFX_Font { |
16 public: | 18 public: |
17 CFX_GEFont(const CFX_GEFont& src, uint32_t dwFontStyles); | 19 CFX_GEFont(const CFX_GEFont& src, uint32_t dwFontStyles); |
18 CFX_GEFont(IFX_FontMgr* pFontMgr); | 20 CFX_GEFont(IFX_FontMgr* pFontMgr); |
19 ~CFX_GEFont(); | 21 ~CFX_GEFont(); |
20 virtual void Release(); | 22 virtual void Release(); |
21 virtual IFX_Font* Retain(); | 23 virtual IFX_Font* Retain(); |
22 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, | 24 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, |
23 uint32_t dwFontStyles, | 25 uint32_t dwFontStyles, |
24 uint16_t wCodePage); | 26 uint16_t wCodePage); |
(...skipping 13 matching lines...) Expand all Loading... |
38 virtual int32_t GetAscent() const; | 40 virtual int32_t GetAscent() const; |
39 virtual int32_t GetDescent() const; | 41 virtual int32_t GetDescent() const; |
40 virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, | 42 virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, |
41 CFX_Rect& bbox, | 43 CFX_Rect& bbox, |
42 FX_BOOL bCharCode = FALSE); | 44 FX_BOOL bCharCode = FALSE); |
43 virtual FX_BOOL GetBBox(CFX_Rect& bbox); | 45 virtual FX_BOOL GetBBox(CFX_Rect& bbox); |
44 virtual int32_t GetItalicAngle() const; | 46 virtual int32_t GetItalicAngle() const; |
45 virtual void Reset(); | 47 virtual void Reset(); |
46 virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const; | 48 virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const; |
47 virtual void* GetDevFont() const { return (void*)m_pFont; } | 49 virtual void* GetDevFont() const { return (void*)m_pFont; } |
48 virtual void SetFontProvider(IFX_FontProvider* pProvider) { | 50 virtual void SetFontProvider(CXFA_PDFFontMgr* pProvider) { |
49 m_pProvider = pProvider; | 51 m_pProvider = pProvider; |
50 } | 52 } |
51 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 53 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
52 virtual void SetLogicalFontStyle(uint32_t dwLogFontStyle) { | 54 virtual void SetLogicalFontStyle(uint32_t dwLogFontStyle) { |
53 m_bUseLogFontStyle = TRUE; | 55 m_bUseLogFontStyle = TRUE; |
54 m_dwLogFontStyle = dwLogFontStyle; | 56 m_dwLogFontStyle = dwLogFontStyle; |
55 } | 57 } |
56 #endif | 58 #endif |
57 | 59 |
58 protected: | 60 protected: |
59 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 61 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
60 FX_BOOL m_bUseLogFontStyle; | 62 FX_BOOL m_bUseLogFontStyle; |
61 uint32_t m_dwLogFontStyle; | 63 uint32_t m_dwLogFontStyle; |
62 #endif | 64 #endif |
63 CFX_Font* m_pFont; | 65 CFX_Font* m_pFont; |
64 IFX_FontMgr* m_pFontMgr; | 66 IFX_FontMgr* m_pFontMgr; |
65 int32_t m_iRefCount; | 67 int32_t m_iRefCount; |
66 FX_BOOL m_bExtFont; | 68 FX_BOOL m_bExtFont; |
67 IFX_Stream* m_pStream; | 69 IFX_Stream* m_pStream; |
68 IFX_FileRead* m_pFileRead; | 70 IFX_FileRead* m_pFileRead; |
69 CFX_UnicodeEncoding* m_pFontEncoding; | 71 CFX_UnicodeEncoding* m_pFontEncoding; |
70 CFX_WordDiscreteArray* m_pCharWidthMap; | 72 CFX_WordDiscreteArray* m_pCharWidthMap; |
71 CFX_RectMassArray* m_pRectArray; | 73 CFX_RectMassArray* m_pRectArray; |
72 CFX_MapPtrToPtr* m_pBBoxMap; | 74 CFX_MapPtrToPtr* m_pBBoxMap; |
73 IFX_FontProvider* m_pProvider; | 75 CXFA_PDFFontMgr* m_pProvider; |
74 uint16_t m_wCharSet; | 76 uint16_t m_wCharSet; |
75 CFX_PtrArray m_SubstFonts; | 77 CFX_PtrArray m_SubstFonts; |
76 CFX_MapPtrToPtr m_FontMapper; | 78 CFX_MapPtrToPtr m_FontMapper; |
77 FX_BOOL InitFont(); | 79 FX_BOOL InitFont(); |
78 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, | 80 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, |
79 CFX_Rect& bbox, | 81 CFX_Rect& bbox, |
80 FX_BOOL bRecursive, | 82 FX_BOOL bRecursive, |
81 FX_BOOL bCharCode = FALSE); | 83 FX_BOOL bCharCode = FALSE); |
82 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, | 84 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, |
83 int32_t& iWidth, | 85 int32_t& iWidth, |
84 FX_BOOL bRecursive, | 86 FX_BOOL bRecursive, |
85 FX_BOOL bCharCode = FALSE); | 87 FX_BOOL bCharCode = FALSE); |
86 int32_t GetGlyphIndex(FX_WCHAR wUnicode, | 88 int32_t GetGlyphIndex(FX_WCHAR wUnicode, |
87 FX_BOOL bRecursive, | 89 FX_BOOL bRecursive, |
88 IFX_Font** ppFont, | 90 IFX_Font** ppFont, |
89 FX_BOOL bCharCode = FALSE); | 91 FX_BOOL bCharCode = FALSE); |
90 }; | 92 }; |
91 | 93 |
92 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ | 94 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ |
OLD | NEW |