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_SYSTEMFONTINFO_IFACE_H_
8 #define CORE_FXGE_SYSTEMFONTINFO_IFACE_H_
9 
10 #include "core/fxge/cfx_fontmapper.h"
11 #include "third_party/base/span.h"
12 
13 constexpr uint32_t kTableNAME = CFX_FontMapper::MakeTag('n', 'a', 'm', 'e');
14 constexpr uint32_t kTableTTCF = CFX_FontMapper::MakeTag('t', 't', 'c', 'f');
15 
16 class SystemFontInfoIface {
17  public:
18   virtual ~SystemFontInfoIface() = default;
19 
20   virtual bool EnumFontList(CFX_FontMapper* pMapper) = 0;
21   virtual void* MapFont(int weight,
22                         bool bItalic,
23                         int charset,
24                         int pitch_family,
25                         const char* face) = 0;
26   virtual void* GetFont(const char* face) = 0;
27   virtual uint32_t GetFontData(void* hFont,
28                                uint32_t table,
29                                pdfium::span<uint8_t> buffer) = 0;
30   virtual bool GetFaceName(void* hFont, ByteString* name) = 0;
31   virtual bool GetFontCharset(void* hFont, int* charset) = 0;
32   virtual void DeleteFont(void* hFont) = 0;
33 };
34 
35 #endif  // CORE_FXGE_SYSTEMFONTINFO_IFACE_H_
36