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