1e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov// Copyright 2014 PDFium Authors. All rights reserved.
2e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov// Use of this source code is governed by a BSD-style license that can be
3e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov// found in the LICENSE file.
4e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
5e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
7e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifndef PUBLIC_FPDF_SYSFONTINFO_H_
8e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define PUBLIC_FPDF_SYSFONTINFO_H_
9e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
10e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#include "fpdfview.h"
11e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
12e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Character sets for the font */
13e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_ANSI_CHARSET     0
14e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_DEFAULT_CHARSET  1
15e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_SYMBOL_CHARSET   2
16e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_SHIFTJIS_CHARSET 128
17e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_HANGEUL_CHARSET  129
18e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_GB2312_CHARSET   134
19e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_CHINESEBIG5_CHARSET  136
20e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
21e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Font pitch and family flags */
22e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_FF_FIXEDPITCH    1
23e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_FF_ROMAN         (1<<4)
24e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_FF_SCRIPT        (4<<4)
25e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
26e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Typical weight values */
27e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_FW_NORMAL        400
28e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define FXFONT_FW_BOLD          700
29e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
30e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov// Exported Functions
31e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifdef __cplusplus
32e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganovextern "C" {
33e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif
34e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
35e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
36e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Interface: FPDF_SYSFONTINFO
37e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Interface for getting system font information and font mapping
38e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov */
39e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganovtypedef struct _FPDF_SYSFONTINFO {
40e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
41e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Version number of the interface. Currently must be 1.
42e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
43e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    int version;
44e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
45e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
46e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: Release
47e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Give implementation a chance to release any data after the interface is no longer used
48e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
49e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
50e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
51e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          No
52e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Comments:
53e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Called by Foxit SDK during the final cleanup process.
54e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
55e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
56e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
57e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          None
58e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     */
59e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    void (*Release)(struct _FPDF_SYSFONTINFO* pThis);
60e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
61e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
62e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: EnumFonts
63e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Enumerate all fonts installed on the system
64e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
65e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
66e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
67e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          No
68e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Comments:
69e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Implementation should call FPDF_AddIntalledFont() function for each font found.
70e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
71e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
72e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
73e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pMapper     -   An opaque pointer to internal font mapper, used when calling FPDF_AddInstalledFont
74e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
75e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          None
76e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     */
77e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    void (*EnumFonts)(struct _FPDF_SYSFONTINFO* pThis, void* pMapper);
78e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
79e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
80e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: MapFont
81e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Use the system font mapper to get a font handle from requested parameters
82e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
83e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
84e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
85e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Yes only if GetFont method is not implemented.
86e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Comments:
87e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          If the system supports native font mapper (like Windows), implementation can implement this method to get a font handle.
88e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Otherwise, Foxit SDK will do the mapping and then call GetFont method.
89e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Only TrueType/OpenType and Type1 fonts are accepted by Foxit SDK.
90e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
91e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
92e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          weight      -   Weight of the requested font. 400 is normal and 700 is bold.
93e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          bItalic     -   Italic option of the requested font, TRUE or FALSE.
94e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          charset     -   Character set identifier for the requested font. See above defined constants.
95e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pitch_family -  A combination of flags. See above defined constants.
96e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          face        -   Typeface name. Currently use system local encoding only.
97e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          bExact      -   Pointer to an boolean value receiving the indicator whether mapper found the exact match.
98e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *                          If mapper is not sure whether it's exact match, ignore this paramter.
99e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
100e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          An opaque pointer for font handle, or NULL if system mapping is not supported.
101e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
102e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    void* (*MapFont)(struct _FPDF_SYSFONTINFO* pThis, int weight, int bItalic, int charset, int pitch_family,
103e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov                        const char* face, int* bExact);
104e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
105e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
106e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: GetFont
107e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Get a handle to a particular font by its internal ID
108e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
109e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
110e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
111e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Yes only if MapFont method is not implemented.
112e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Comments:
113e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          If the system mapping not supported, Foxit SDK will do the font mapping and use this method to get a font handle.
114e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
115e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
116e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          face        -   Typeface name. Currently use system local encoding only.
117e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
118e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          An opaque pointer for font handle.
119e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
120e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    void* (*GetFont)(struct _FPDF_SYSFONTINFO* pThis, const char* face);
121e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
122e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
123e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: GetFontData
124e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Get font data from a font
125e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
126e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
127e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
128e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Yes
129e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Comments:
130e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Can read either full font file, or a particular TrueType/OpenType table
131e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
132e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
133e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          hFont       -   Font handle returned by MapFont or GetFont method
134e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          table       -   TrueType/OpenType table identifier (refer to TrueType specification).
135e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *                          0 for the whole font file.
136e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          buffer      -   The buffer receiving the font data. Can be NULL if not provided
137e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          buf_size    -   Buffer size, can be zero if not provided
138e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
139e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Number of bytes needed, if buffer not provided or not large enough,
140e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          or number of bytes written into buffer otherwise.
141e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
142e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    unsigned long (*GetFontData)(struct _FPDF_SYSFONTINFO* pThis, void* hFont,
143e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov            unsigned int table, unsigned char* buffer, unsigned long buf_size);
144e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
145e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
146e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: GetFaceName
147e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Get face name from a font handle
148e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
149e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
150e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
151e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          No
152e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
153e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
154e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          hFont       -   Font handle returned by MapFont or GetFont method
155e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          buffer      -   The buffer receiving the face name. Can be NULL if not provided
156e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          buf_size    -   Buffer size, can be zero if not provided
157e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
158e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Number of bytes needed, if buffer not provided or not large enough,
159e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          or number of bytes written into buffer otherwise.
160e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
161e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    unsigned long (*GetFaceName)(struct _FPDF_SYSFONTINFO* pThis, void* hFont, char* buffer, unsigned long buf_size);
162e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
163e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
164e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: GetFontCharset
165e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Get character set information for a font handle
166e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
167e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
168e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
169e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          No
170e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
171e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
172e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          hFont       -   Font handle returned by MapFont or GetFont method
173e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
174e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Character set identifier. See defined constants above.
175e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
176e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    int (*GetFontCharset)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
177e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
178e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    /**
179e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Method: DeleteFont
180e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Delete a font handle
181e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Interface Version:
182e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          1
183e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Implementation Required:
184e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          Yes
185e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Parameters:
186e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          pThis       -   Pointer to the interface structure itself
187e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          hFont       -   Font handle returned by MapFont or GetFont method
188e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     * Return Value:
189e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     *          None
190e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov     **/
191e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    void (*DeleteFont)(struct _FPDF_SYSFONTINFO* pThis, void* hFont);
192e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov} FPDF_SYSFONTINFO;
193e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
194e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
195e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Struct: FPDF_CharsetFontMap
196e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *    Provides the name of a font to use for a given charset value.
197e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov **/
198e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganovtypedef struct FPDF_CharsetFontMap_
199e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov{
200e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    int charset;  // Character Set Enum value, see FXFONT_*_CHARSET above.
201e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov    const char* fontname;  // Name of default font to use with that charset.
202e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov} FPDF_CharsetFontMap;
203e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
204e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
205e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Function: FPDF_GetDefaultTTFMap
206e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *    Returns a pointer to the default character set to TT Font name map. The
207e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *    map is an array of FPDF_CharsetFontMap structs, with its end indicated
208e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *    by a { -1, NULL } entry.
209e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Parameters:
210e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *     None.
211e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Return Value:
212e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *     Pointer to the Charset Font Map.
213e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov **/
214e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovDLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap();
215e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
216e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
217e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Function: FPDF_AddInstalledFont
218e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Add a system font to the list in Foxit SDK.
219e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Comments:
220e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          This function is only called during the system font list building process.
221e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Parameters:
222e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          mapper          -   Opaque pointer to Foxit font mapper
223e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          face            -   The font face name
224e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          charset         -   Font character set. See above defined constants.
225e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Return Value:
226e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          None.
227e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov **/
228e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovDLLEXPORT void STDCALL FPDF_AddInstalledFont(void* mapper, const char* face, int charset);
229e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
230e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
231e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Function: FPDF_SetSystemFontInfo
232e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Set the system font info interface into Foxit SDK
233e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Comments:
234e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Platform support implementation should implement required methods of FFDF_SYSFONTINFO interface,
235e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          then call this function during SDK initialization process.
236e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Parameters:
237e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          pFontInfo       -   Pointer to a FPDF_SYSFONTINFO structure
238e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Return Value:
239e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          None
240e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov **/
241e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovDLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
242e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
243e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/**
244e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Function: FPDF_GetDefaultSystemFontInfo
245e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Get default system font info interface for current platform
246e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Comments:
247e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          For some platforms Foxit SDK implement a default version of system font info interface.
248e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          The default implementation can be used in FPDF_SetSystemFontInfo function.
249e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Parameters:
250e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          None
251e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Return Value:
252e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Pointer to a FPDF_SYSFONTINFO structure describing the default interface.
253e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Or NULL if the platform doesn't have a default interface.
254e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov *          Application should call FPDF_FreeMemory to free the returned pointer.
255e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov **/
256e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovDLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo();
257e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
258e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifdef __cplusplus
259e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov}
260e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif
261e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov
262e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif  // PUBLIC_FPDF_SYSFONTINFO_H_
263