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