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/fxcrt/unowned_ptr.h"
12 #include "core/fxge/cfx_fontmapper.h"
13 #include "core/fxge/systemfontinfo_iface.h"
14 #include "third_party/base/span.h"
15 
16 class CFPF_SkiaFontMgr;
17 
18 class CFX_AndroidFontInfo final : public SystemFontInfoIface {
19  public:
20   CFX_AndroidFontInfo();
21   ~CFX_AndroidFontInfo() override;
22 
23   bool Init(CFPF_SkiaFontMgr* pFontMgr);
24 
25   // SystemFontInfoIface:
26   bool EnumFontList(CFX_FontMapper* pMapper) override;
27   void* MapFont(int weight,
28                 bool bItalic,
29                 int charset,
30                 int pitch_family,
31                 const char* face) override;
32   void* GetFont(const char* face) override;
33   uint32_t GetFontData(void* hFont,
34                        uint32_t table,
35                        pdfium::span<uint8_t> buffer) override;
36   bool GetFaceName(void* hFont, ByteString* name) override;
37   bool GetFontCharset(void* hFont, int* charset) override;
38   void DeleteFont(void* hFont) override;
39 
40  private:
41   UnownedPtr<CFPF_SkiaFontMgr> m_pFontMgr;
42 };
43 
44 #endif  // CORE_FXGE_ANDROID_CFX_ANDROIDFONTINFO_H_
45