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 <map> | 10 #include <map> |
11 | 11 |
| 12 #include "core/fxcrt/include/fx_memory.h" |
12 #include "xfa/fgas/crt/fgas_utils.h" | 13 #include "xfa/fgas/crt/fgas_utils.h" |
13 #include "xfa/fgas/font/fgas_font.h" | 14 #include "xfa/fgas/font/fgas_font.h" |
14 | 15 |
15 #define FXFONT_SUBST_ITALIC 0x02 | 16 #define FXFONT_SUBST_ITALIC 0x02 |
16 | 17 |
17 class CXFA_PDFFontMgr; | 18 class CXFA_PDFFontMgr; |
18 | 19 |
19 class CFGAS_GEFont { | 20 class CFGAS_GEFont { |
20 public: | 21 public: |
21 static CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, | 22 static CFGAS_GEFont* LoadFont(const FX_WCHAR* pszFontFamily, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 int32_t GetGlyphIndex(FX_WCHAR wUnicode, | 86 int32_t GetGlyphIndex(FX_WCHAR wUnicode, |
86 FX_BOOL bRecursive, | 87 FX_BOOL bRecursive, |
87 CFGAS_GEFont** ppFont, | 88 CFGAS_GEFont** ppFont, |
88 FX_BOOL bCharCode = FALSE); | 89 FX_BOOL bCharCode = FALSE); |
89 | 90 |
90 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 91 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
91 FX_BOOL m_bUseLogFontStyle; | 92 FX_BOOL m_bUseLogFontStyle; |
92 uint32_t m_dwLogFontStyle; | 93 uint32_t m_dwLogFontStyle; |
93 #endif | 94 #endif |
94 CFX_Font* m_pFont; | 95 CFX_Font* m_pFont; |
95 IFGAS_FontMgr* m_pFontMgr; | 96 IFGAS_FontMgr* const m_pFontMgr; |
96 int32_t m_iRefCount; | 97 int32_t m_iRefCount; |
97 FX_BOOL m_bExtFont; | 98 FX_BOOL m_bExtFont; |
98 IFX_Stream* m_pStream; | 99 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> m_pStream; |
99 IFX_FileRead* m_pFileRead; | 100 std::unique_ptr<IFX_FileRead, ReleaseDeleter<IFX_FileRead>> m_pFileRead; |
100 CFX_UnicodeEncoding* m_pFontEncoding; | 101 std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding; |
101 CFX_DiscreteArrayTemplate<uint16_t>* m_pCharWidthMap; | 102 std::unique_ptr<CFX_DiscreteArrayTemplate<uint16_t>> m_pCharWidthMap; |
102 CFX_MassArrayTemplate<CFX_Rect>* m_pRectArray; | 103 std::unique_ptr<CFX_MassArrayTemplate<CFX_Rect>> m_pRectArray; |
103 CFX_MapPtrToPtr* m_pBBoxMap; | 104 std::unique_ptr<CFX_MapPtrToPtr> m_pBBoxMap; |
104 CXFA_PDFFontMgr* m_pProvider; | 105 CXFA_PDFFontMgr* m_pProvider; // not owned. |
105 CFX_ArrayTemplate<CFGAS_GEFont*> m_SubstFonts; | 106 CFX_ArrayTemplate<CFGAS_GEFont*> m_SubstFonts; |
106 std::map<FX_WCHAR, CFGAS_GEFont*> m_FontMapper; | 107 std::map<FX_WCHAR, CFGAS_GEFont*> m_FontMapper; |
107 }; | 108 }; |
108 | 109 |
109 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ | 110 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ |
OLD | NEW |