sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
ftgasp.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftgasp.h
4 *
5 * Access of TrueType's 'gasp' table (specification).
6 *
7 * Copyright (C) 2007-2025 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
9 *
10 * This file is part of the FreeType project, and may only be used,
11 * modified, and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
15 *
16 */
17
18
23#ifndef FTGASP_H_
24#define FTGASP_H_
25
26#include <freetype/freetype.h>
27
28#ifdef FREETYPE_H
29#error "freetype.h of FreeType 1 has been loaded!"
30#error "Please fix the directory search order for header files"
31#error "so that freetype.h of FreeType 2 is found first."
32#endif
33
34
35FT_BEGIN_HEADER
36
37
38 /**************************************************************************
39 *
40 * @section:
41 * gasp_table
42 *
43 * @title:
44 * Gasp Table
45 *
46 * @abstract:
47 * Retrieving TrueType 'gasp' table entries.
48 *
49 * @description:
50 * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
51 * font for specific entries in its 'gasp' table, if any. This is mainly
52 * useful when implementing native TrueType hinting with the bytecode
53 * interpreter to duplicate the Windows text rendering results.
54 */
55
56 /**************************************************************************
57 *
58 * @enum:
59 * FT_GASP_XXX
60 *
61 * @description:
62 * A list of values and/or bit-flags returned by the @FT_Get_Gasp
63 * function.
64 *
65 * @values:
66 * FT_GASP_NO_TABLE ::
67 * This special value means that there is no GASP table in this face.
68 * It is up to the client to decide what to do.
69 *
70 * FT_GASP_DO_GRIDFIT ::
71 * Grid-fitting and hinting should be performed at the specified ppem.
72 * This **really** means TrueType bytecode interpretation. If this bit
73 * is not set, no hinting gets applied.
74 *
75 * FT_GASP_DO_GRAY ::
76 * Anti-aliased rendering should be performed at the specified ppem.
77 * If not set, do monochrome rendering.
78 *
79 * FT_GASP_SYMMETRIC_SMOOTHING ::
80 * If set, smoothing along multiple axes must be used with ClearType.
81 *
82 * FT_GASP_SYMMETRIC_GRIDFIT ::
83 * Grid-fitting must be used with ClearType's symmetric smoothing.
84 *
85 * @note:
86 * The bit-flags `FT_GASP_DO_GRIDFIT` and `FT_GASP_DO_GRAY` are to be
87 * used for standard font rasterization only. Independently of that,
88 * `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to
89 * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and
90 * `FT_GASP_DO_GRAY` are consequently ignored).
91 *
92 * 'ClearType' is Microsoft's implementation of LCD rendering, partly
93 * protected by patents.
94 *
95 * @since:
96 * 2.3.0
97 */
98#define FT_GASP_NO_TABLE -1
99#define FT_GASP_DO_GRIDFIT 0x01
100#define FT_GASP_DO_GRAY 0x02
101#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
102#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
103
104
105 /**************************************************************************
106 *
107 * @function:
108 * FT_Get_Gasp
109 *
110 * @description:
111 * For a TrueType or OpenType font file, return the rasterizer behaviour
112 * flags from the font's 'gasp' table corresponding to a given character
113 * pixel size.
114 *
115 * @input:
116 * face ::
117 * The source face handle.
118 *
119 * ppem ::
120 * The vertical character pixel size.
121 *
122 * @return:
123 * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
124 * 'gasp' table in the face.
125 *
126 * @note:
127 * If you want to use the MM functionality of OpenType variation fonts
128 * (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
129 * function **after** setting an instance since the return values can
130 * change.
131 *
132 * @since:
133 * 2.3.0
134 */
135 FT_EXPORT( FT_Int )
136 FT_Get_Gasp( FT_Face face,
137 FT_UInt ppem );
138
139 /* */
140
141
142FT_END_HEADER
143
144#endif /* FTGASP_H_ */
145
146
147/* END */