| 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 CFX_GEFont : public IFX_Font { | 15 class CFX_GEFont : public IFX_Font { |
| 16 public: | 16 public: |
| 17 CFX_GEFont(const CFX_GEFont& src, FX_DWORD dwFontStyles); | 17 CFX_GEFont(const CFX_GEFont& src, FX_DWORD dwFontStyles); |
| 18 CFX_GEFont(IFX_FontMgr* pFontMgr); | 18 CFX_GEFont(IFX_FontMgr* pFontMgr); |
| 19 ~CFX_GEFont(); | 19 ~CFX_GEFont(); |
| 20 virtual void Release(); | 20 virtual void Release(); |
| 21 virtual IFX_Font* Retain(); | 21 virtual IFX_Font* Retain(); |
| 22 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, | 22 FX_BOOL LoadFont(const FX_WCHAR* pszFontFamily, |
| 23 FX_DWORD dwFontStyles, | 23 FX_DWORD dwFontStyles, |
| 24 FX_WORD wCodePage); | 24 uint16_t wCodePage); |
| 25 FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t length); | 25 FX_BOOL LoadFont(const uint8_t* pBuffer, int32_t length); |
| 26 FX_BOOL LoadFont(const FX_WCHAR* pszFileName); | 26 FX_BOOL LoadFont(const FX_WCHAR* pszFileName); |
| 27 FX_BOOL LoadFont(IFX_Stream* pFontStream, FX_BOOL bSaveStream); | 27 FX_BOOL LoadFont(IFX_Stream* pFontStream, FX_BOOL bSaveStream); |
| 28 FX_BOOL LoadFont(CFX_Font* pExtFont, FX_BOOL bTakeOver = FALSE); | 28 FX_BOOL LoadFont(CFX_Font* pExtFont, FX_BOOL bTakeOver = FALSE); |
| 29 virtual IFX_Font* Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage = 0); | 29 virtual IFX_Font* Derive(FX_DWORD dwFontStyles, uint16_t wCodePage = 0); |
| 30 virtual void GetFamilyName(CFX_WideString& wsFamily) const; | 30 virtual void GetFamilyName(CFX_WideString& wsFamily) const; |
| 31 virtual void GetPsName(CFX_WideString& wsName) const; | 31 virtual void GetPsName(CFX_WideString& wsName) const; |
| 32 virtual FX_DWORD GetFontStyles() const; | 32 virtual FX_DWORD GetFontStyles() const; |
| 33 virtual uint8_t GetCharSet() const; | 33 virtual uint8_t GetCharSet() const; |
| 34 virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, | 34 virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, |
| 35 int32_t& iWidth, | 35 int32_t& iWidth, |
| 36 FX_BOOL bCharCode = FALSE); | 36 FX_BOOL bCharCode = FALSE); |
| 37 virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); | 37 virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE); |
| 38 virtual int32_t GetAscent() const; | 38 virtual int32_t GetAscent() const; |
| 39 virtual int32_t GetDescent() const; | 39 virtual int32_t GetDescent() const; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 64 IFX_FontMgr* m_pFontMgr; | 64 IFX_FontMgr* m_pFontMgr; |
| 65 int32_t m_iRefCount; | 65 int32_t m_iRefCount; |
| 66 FX_BOOL m_bExtFont; | 66 FX_BOOL m_bExtFont; |
| 67 IFX_Stream* m_pStream; | 67 IFX_Stream* m_pStream; |
| 68 IFX_FileRead* m_pFileRead; | 68 IFX_FileRead* m_pFileRead; |
| 69 CFX_UnicodeEncoding* m_pFontEncoding; | 69 CFX_UnicodeEncoding* m_pFontEncoding; |
| 70 CFX_WordDiscreteArray* m_pCharWidthMap; | 70 CFX_WordDiscreteArray* m_pCharWidthMap; |
| 71 CFX_RectMassArray* m_pRectArray; | 71 CFX_RectMassArray* m_pRectArray; |
| 72 CFX_MapPtrToPtr* m_pBBoxMap; | 72 CFX_MapPtrToPtr* m_pBBoxMap; |
| 73 IFX_FontProvider* m_pProvider; | 73 IFX_FontProvider* m_pProvider; |
| 74 FX_WORD m_wCharSet; | 74 uint16_t m_wCharSet; |
| 75 CFX_PtrArray m_SubstFonts; | 75 CFX_PtrArray m_SubstFonts; |
| 76 CFX_MapPtrToPtr m_FontMapper; | 76 CFX_MapPtrToPtr m_FontMapper; |
| 77 FX_BOOL InitFont(); | 77 FX_BOOL InitFont(); |
| 78 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, | 78 FX_BOOL GetCharBBox(FX_WCHAR wUnicode, |
| 79 CFX_Rect& bbox, | 79 CFX_Rect& bbox, |
| 80 FX_BOOL bRecursive, | 80 FX_BOOL bRecursive, |
| 81 FX_BOOL bCharCode = FALSE); | 81 FX_BOOL bCharCode = FALSE); |
| 82 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, | 82 FX_BOOL GetCharWidth(FX_WCHAR wUnicode, |
| 83 int32_t& iWidth, | 83 int32_t& iWidth, |
| 84 FX_BOOL bRecursive, | 84 FX_BOOL bRecursive, |
| 85 FX_BOOL bCharCode = FALSE); | 85 FX_BOOL bCharCode = FALSE); |
| 86 int32_t GetGlyphIndex(FX_WCHAR wUnicode, | 86 int32_t GetGlyphIndex(FX_WCHAR wUnicode, |
| 87 FX_BOOL bRecursive, | 87 FX_BOOL bRecursive, |
| 88 IFX_Font** ppFont, | 88 IFX_Font** ppFont, |
| 89 FX_BOOL bCharCode = FALSE); | 89 FX_BOOL bCharCode = FALSE); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ | 92 #endif // XFA_FGAS_FONT_FGAS_GEFONT_H_ |
| OLD | NEW |