| 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 CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ | 7 #ifndef CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ |
| 8 #define CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ | 8 #define CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ |
| 9 | 9 |
| 10 #if _FX_OS_ == _FX_ANDROID_ | 10 #if _FX_OS_ == _FX_ANDROID_ |
| 11 |
| 12 #include "../../../include/fxge/fpf.h" |
| 13 |
| 11 class CFPF_SkiaFontDescriptor; | 14 class CFPF_SkiaFontDescriptor; |
| 12 class CFPF_SkiaFontMgr; | 15 class CFPF_SkiaFontMgr; |
| 13 class SkTypeface; | 16 class SkTypeface; |
| 14 class CFPF_SkiaFont : public IFPF_Font { | 17 class CFPF_SkiaFont : public IFPF_Font { |
| 15 public: | 18 public: |
| 16 CFPF_SkiaFont(); | 19 CFPF_SkiaFont(); |
| 17 virtual ~CFPF_SkiaFont(); | 20 ~CFPF_SkiaFont() override; |
| 18 virtual void Release(); | |
| 19 virtual IFPF_Font* Retain(); | |
| 20 | 21 |
| 21 virtual FPF_HFONT GetHandle(); | 22 // IFPF_Font |
| 23 void Release() override; |
| 24 IFPF_Font* Retain() override; |
| 25 FPF_HFONT GetHandle() override; |
| 26 CFX_ByteString GetFamilyName() override; |
| 27 CFX_WideString GetPsName() override; |
| 28 FX_DWORD GetFontStyle() const override { return m_dwStyle; } |
| 29 uint8_t GetCharset() const override { return m_uCharset; } |
| 30 int32_t GetGlyphIndex(FX_WCHAR wUnicode) override; |
| 31 int32_t GetGlyphWidth(int32_t iGlyphIndex) override; |
| 32 int32_t GetAscent() const override; |
| 33 int32_t GetDescent() const override; |
| 34 FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT& rtBBox) override; |
| 35 FX_BOOL GetBBox(FX_RECT& rtBBox) override; |
| 36 int32_t GetHeight() const override; |
| 37 int32_t GetItalicAngle() const override; |
| 38 FX_DWORD GetFontData(FX_DWORD dwTable, |
| 39 uint8_t* pBuffer, |
| 40 FX_DWORD dwSize) override; |
| 22 | 41 |
| 23 virtual CFX_ByteString GetFamilyName(); | |
| 24 virtual CFX_WideString GetPsName(); | |
| 25 | |
| 26 virtual FX_DWORD GetFontStyle() const { return m_dwStyle; } | |
| 27 virtual uint8_t GetCharset() const { return m_uCharset; } | |
| 28 | |
| 29 virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode); | |
| 30 virtual int32_t GetGlyphWidth(int32_t iGlyphIndex); | |
| 31 | |
| 32 virtual int32_t GetAscent() const; | |
| 33 virtual int32_t GetDescent() const; | |
| 34 | |
| 35 virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT& rtBBox); | |
| 36 virtual FX_BOOL GetBBox(FX_RECT& rtBBox); | |
| 37 | |
| 38 virtual int32_t GetHeight() const; | |
| 39 virtual int32_t GetItalicAngle() const; | |
| 40 virtual FX_DWORD GetFontData(FX_DWORD dwTable, | |
| 41 uint8_t* pBuffer, | |
| 42 FX_DWORD dwSize); | |
| 43 FX_BOOL InitFont(CFPF_SkiaFontMgr* pFontMgr, | 42 FX_BOOL InitFont(CFPF_SkiaFontMgr* pFontMgr, |
| 44 CFPF_SkiaFontDescriptor* pFontDes, | 43 CFPF_SkiaFontDescriptor* pFontDes, |
| 45 const CFX_ByteStringC& bsFamily, | 44 const CFX_ByteStringC& bsFamily, |
| 46 FX_DWORD dwStyle, | 45 FX_DWORD dwStyle, |
| 47 uint8_t uCharset); | 46 uint8_t uCharset); |
| 48 | 47 |
| 49 protected: | 48 protected: |
| 50 CFPF_SkiaFontMgr* m_pFontMgr; | 49 CFPF_SkiaFontMgr* m_pFontMgr; |
| 51 CFPF_SkiaFontDescriptor* m_pFontDes; | 50 CFPF_SkiaFontDescriptor* m_pFontDes; |
| 52 FXFT_Face m_Face; | 51 FXFT_Face m_Face; |
| 53 FX_DWORD m_dwStyle; | 52 FX_DWORD m_dwStyle; |
| 54 uint8_t m_uCharset; | 53 uint8_t m_uCharset; |
| 55 FX_DWORD m_dwRefCount; | 54 FX_DWORD m_dwRefCount; |
| 56 }; | 55 }; |
| 57 #endif | 56 #endif |
| 58 | 57 |
| 59 #endif // CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ | 58 #endif // CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_ |
| OLD | NEW |