Home | History | Annotate | Download | only in android
      1 // Copyright 2016 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_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
      8 #define CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
      9 
     10 #include "core/fxcrt/fx_system.h"
     11 #include "core/fxge/cfx_fontmapper.h"
     12 #include "core/fxge/fx_font.h"
     13 #include "core/fxge/ifx_systemfontinfo.h"
     14 
     15 class CFPF_SkiaFontMgr;
     16 
     17 class CFX_AndroidFontInfo : public IFX_SystemFontInfo {
     18  public:
     19   CFX_AndroidFontInfo();
     20   ~CFX_AndroidFontInfo() override;
     21 
     22   bool Init(CFPF_SkiaFontMgr* pFontMgr);
     23 
     24   // IFX_SystemFontInfo:
     25   bool EnumFontList(CFX_FontMapper* pMapper) override;
     26   void* MapFont(int weight,
     27                 bool bItalic,
     28                 int charset,
     29                 int pitch_family,
     30                 const FX_CHAR* face,
     31                 int& bExact) override;
     32   void* GetFont(const FX_CHAR* face) override;
     33   uint32_t GetFontData(void* hFont,
     34                        uint32_t table,
     35                        uint8_t* buffer,
     36                        uint32_t size) override;
     37   bool GetFaceName(void* hFont, CFX_ByteString& name) override;
     38   bool GetFontCharset(void* hFont, int& charset) override;
     39   void DeleteFont(void* hFont) override;
     40 
     41  protected:
     42   CFPF_SkiaFontMgr* m_pFontMgr;
     43 };
     44 
     45 #endif  // CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
     46