1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_
8 #define CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_
9 
10 #if _FX_OS_ == _FX_ANDROID_
11 class CFPF_SkiaFontDescriptor;
12 class CFPF_SkiaFontMgr;
13 class SkTypeface;
14 class CFPF_SkiaFont : public IFPF_Font
15 {
16 public:
17     CFPF_SkiaFont();
18     virtual ~CFPF_SkiaFont();
19     virtual void			Release();
20     virtual IFPF_Font*		Retain();
21 
22     virtual FPF_HFONT		GetHandle();
23 
24     virtual CFX_ByteString	GetFamilyName();
25     virtual CFX_WideString	GetPsName();
26 
GetFontStyle()27     virtual FX_DWORD		GetFontStyle() const
28     {
29         return m_dwStyle;
30     }
GetCharset()31     virtual FX_BYTE			GetCharset() const
32     {
33         return m_uCharset;
34     }
35 
36     virtual FX_INT32		GetGlyphIndex(FX_WCHAR wUnicode);
37     virtual FX_INT32		GetGlyphWidth(FX_INT32 iGlyphIndex);
38 
39     virtual FX_INT32		GetAscent() const;
40     virtual FX_INT32		GetDescent() const;
41 
42     virtual FX_BOOL			GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox);
43     virtual FX_BOOL			GetBBox(FX_RECT &rtBBox);
44 
45     virtual FX_INT32		GetHeight() const;
46     virtual FX_INT32		GetItalicAngle() const;
47     virtual FX_DWORD		GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize);
48     FX_BOOL					InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset);
49 protected:
50     CFPF_SkiaFontMgr		*m_pFontMgr;
51     CFPF_SkiaFontDescriptor	*m_pFontDes;
52     FXFT_Face				m_Face;
53     FX_DWORD				m_dwStyle;
54     FX_BYTE					m_uCharset;
55     FX_DWORD				m_dwRefCount;
56 };
57 #endif
58 
59 #endif  // CORE_SRC_FXGE_ANDROID_FPF_SKIAFONT_H_
60