| 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> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 FX_BOOL bSaveStream); | 37 FX_BOOL bSaveStream); |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 ~CFGAS_GEFont(); | 40 ~CFGAS_GEFont(); |
| 41 | 41 |
| 42 void Release(); | 42 void Release(); |
| 43 CFGAS_GEFont* Retain(); | 43 CFGAS_GEFont* Retain(); |
| 44 CFGAS_GEFont* Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); | 44 CFGAS_GEFont* Derive(uint32_t dwFontStyles, uint16_t wCodePage = 0); |
| 45 void GetFamilyName(CFX_WideString& wsFamily) const; | 45 void GetFamilyName(CFX_WideString& wsFamily) const; |
| 46 uint32_t GetFontStyles() const; | 46 uint32_t GetFontStyles() const; |
| 47 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, | 47 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t& iWidth, bool bCharCode); |
| 48 int32_t& iWidth, | |
| 49 FX_BOOL bCharCode = FALSE); | |
| 50 int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); | 48 int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); |
| 51 int32_t GetAscent() const; | 49 int32_t GetAscent() const; |
| 52 int32_t GetDescent() const; | 50 int32_t GetDescent() const; |
| 53 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, | 51 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, |
| 54 CFX_Rect& bbox, | 52 CFX_Rect& bbox, |
| 55 FX_BOOL bCharCode = FALSE); | 53 FX_BOOL bCharCode = FALSE); |
| 56 FX_BOOL GetBBox(CFX_Rect& bbox); | 54 FX_BOOL GetBBox(CFX_Rect& bbox); |
| 57 int32_t GetItalicAngle() const; | 55 int32_t GetItalicAngle() const; |
| 58 void Reset(); | 56 void Reset(); |
| 59 CFGAS_GEFont* GetSubstFont(int32_t iGlyphIndex) const; | 57 CFGAS_GEFont* GetSubstFont(int32_t iGlyphIndex) const; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 79 #endif | 77 #endif |
| 80 FX_BOOL LoadFontInternal(CFX_Font* pExternalFont); | 78 FX_BOOL LoadFontInternal(CFX_Font* pExternalFont); |
| 81 FX_BOOL LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont); | 79 FX_BOOL LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont); |
| 82 FX_BOOL InitFont(); | 80 FX_BOOL InitFont(); |
| 83 FX_BOOL GetCharBBoxInternal(FX_WCHAR wUnicode, | 81 FX_BOOL GetCharBBoxInternal(FX_WCHAR wUnicode, |
| 84 CFX_Rect& bbox, | 82 CFX_Rect& bbox, |
| 85 FX_BOOL bRecursive, | 83 FX_BOOL bRecursive, |
| 86 FX_BOOL bCharCode = FALSE); | 84 FX_BOOL bCharCode = FALSE); |
| 87 FX_BOOL GetCharWidthInternal(FX_WCHAR wUnicode, | 85 FX_BOOL GetCharWidthInternal(FX_WCHAR wUnicode, |
| 88 int32_t& iWidth, | 86 int32_t& iWidth, |
| 89 FX_BOOL bRecursive, | 87 bool bRecursive, |
| 90 FX_BOOL bCharCode = FALSE); | 88 bool bCharCode); |
| 91 int32_t GetGlyphIndex(FX_WCHAR wUnicode, | 89 int32_t GetGlyphIndex(FX_WCHAR wUnicode, |
| 92 FX_BOOL bRecursive, | 90 FX_BOOL bRecursive, |
| 93 CFGAS_GEFont** ppFont, | 91 CFGAS_GEFont** ppFont, |
| 94 FX_BOOL bCharCode = FALSE); | 92 FX_BOOL bCharCode = FALSE); |
| 95 | 93 |
| 96 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ | 94 #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ |
| 97 FX_BOOL m_bUseLogFontStyle; | 95 FX_BOOL m_bUseLogFontStyle; |
| 98 uint32_t m_dwLogFontStyle; | 96 uint32_t m_dwLogFontStyle; |
| 99 #endif | 97 #endif |
| 100 CFX_Font* m_pFont; | 98 CFX_Font* m_pFont; |
| 101 CFGAS_GEFont* const m_pSrcFont; | 99 CFGAS_GEFont* const m_pSrcFont; |
| 102 IFGAS_FontMgr* const m_pFontMgr; | 100 IFGAS_FontMgr* const m_pFontMgr; |
| 103 int32_t m_iRefCount; | 101 int32_t m_iRefCount; |
| 104 bool m_bExternalFont; | 102 bool m_bExternalFont; |
| 105 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> m_pStream; | 103 std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> m_pStream; |
| 106 std::unique_ptr<IFX_FileRead, ReleaseDeleter<IFX_FileRead>> m_pFileRead; | 104 std::unique_ptr<IFX_FileRead, ReleaseDeleter<IFX_FileRead>> m_pFileRead; |
| 107 std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding; | 105 std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding; |
| 108 std::unique_ptr<CFX_DiscreteArrayTemplate<uint16_t>> m_pCharWidthMap; | 106 std::unique_ptr<CFX_DiscreteArrayTemplate<uint16_t>> m_pCharWidthMap; |
| 109 std::unique_ptr<CFX_MassArrayTemplate<CFX_Rect>> m_pRectArray; | 107 std::unique_ptr<CFX_MassArrayTemplate<CFX_Rect>> m_pRectArray; |
| 110 std::unique_ptr<CFX_MapPtrToPtr> m_pBBoxMap; | 108 std::unique_ptr<CFX_MapPtrToPtr> m_pBBoxMap; |
| 111 CXFA_PDFFontMgr* m_pProvider; // not owned. | 109 CXFA_PDFFontMgr* m_pProvider; // not owned. |
| 112 CFX_ArrayTemplate<CFGAS_GEFont*> m_SubstFonts; | 110 CFX_ArrayTemplate<CFGAS_GEFont*> m_SubstFonts; |
| 113 std::map<FX_WCHAR, CFGAS_GEFont*> m_FontMapper; | 111 std::map<FX_WCHAR, CFGAS_GEFont*> m_FontMapper; |
| 114 }; | 112 }; |
| 115 | 113 |
| 116 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ | 114 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ |
| OLD | NEW |