blob: 440c32943918f7797e07445490f97b7d0a9609b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef CORE_INCLUDE_FXGE_FPF_H_
#define CORE_INCLUDE_FXGE_FPF_H_
class IFPF_DeviceModule;
class IFPF_FontMgr;
class IFPF_Font;
class IFPF_DeviceModule
{
public:
virtual ~IFPF_DeviceModule() { }
virtual void Destroy() = 0;
virtual IFPF_FontMgr* GetFontMgr() = 0;
};
IFPF_DeviceModule* FPF_GetDeviceModule();
#define FPF_MATCHFONT_REPLACEANSI 1
typedef struct FPF_HFONT_ {
FX_LPVOID pData;
}* FPF_HFONT;
class IFPF_Font
{
public:
virtual void Release() = 0;
virtual IFPF_Font* Retain() = 0;
virtual FPF_HFONT GetHandle() = 0;
virtual CFX_ByteString GetFamilyName() = 0;
virtual CFX_WideString GetPsName() = 0;
virtual FX_DWORD GetFontStyle() const = 0;
virtual FX_BYTE GetCharset() const = 0;
virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode) = 0;
virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex) = 0;
virtual FX_INT32 GetAscent() const = 0;
virtual FX_INT32 GetDescent() const = 0;
virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox) = 0;
virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0;
virtual FX_INT32 GetHeight() const = 0;
virtual FX_INT32 GetItalicAngle() const = 0;
virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize) = 0;
protected:
~IFPF_Font() { }
};
class IFPF_FontMgr
{
public:
virtual ~IFPF_FontMgr() { }
virtual void LoadSystemFonts() = 0;
virtual void LoadPrivateFont(IFX_FileRead* pFontFile) = 0;
virtual void LoadPrivateFont(FX_BSTR bsFileName) = 0;
virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer) = 0;
virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE charset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0) = 0;
};
#endif // CORE_INCLUDE_FXGE_FPF_H_
|