sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
ftadvanc.h
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* ftadvanc.h
4
*
5
* Quick computation of advance widths (specification only).
6
*
7
* Copyright (C) 2008-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 FTADVANC_H_
24
#define FTADVANC_H_
25
26
27
#include <
freetype/freetype.h
>
28
29
#ifdef FREETYPE_H
30
#error "freetype.h of FreeType 1 has been loaded!"
31
#error "Please fix the directory search order for header files"
32
#error "so that freetype.h of FreeType 2 is found first."
33
#endif
34
35
36
FT_BEGIN_HEADER
37
38
39
/**************************************************************************
40
*
41
* @section:
42
* quick_advance
43
*
44
* @title:
45
* Quick retrieval of advance values
46
*
47
* @abstract:
48
* Retrieve horizontal and vertical advance values without processing
49
* glyph outlines, if possible.
50
*
51
* @description:
52
* This section contains functions to quickly extract advance values
53
* without handling glyph outlines, if possible.
54
*
55
* @order:
56
* FT_Get_Advance
57
* FT_Get_Advances
58
*
59
*/
60
61
62
/**************************************************************************
63
*
64
* @enum:
65
* FT_ADVANCE_FLAG_FAST_ONLY
66
*
67
* @description:
68
* A bit-flag to be OR-ed with the `flags` parameter of the
69
* @FT_Get_Advance and @FT_Get_Advances functions.
70
*
71
* If set, it indicates that you want these functions to fail if the
72
* corresponding hinting mode or font driver doesn't allow for very quick
73
* advance computation.
74
*
75
* Typically, glyphs that are either unscaled, unhinted, bitmapped, or
76
* light-hinted can have their advance width computed very quickly.
77
*
78
* Normal and bytecode hinted modes that require loading, scaling, and
79
* hinting of the glyph outline, are extremely slow by comparison.
80
*/
81
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
82
83
84
/**************************************************************************
85
*
86
* @function:
87
* FT_Get_Advance
88
*
89
* @description:
90
* Retrieve the advance value of a given glyph outline in an @FT_Face.
91
*
92
* @input:
93
* face ::
94
* The source @FT_Face handle.
95
*
96
* gindex ::
97
* The glyph index.
98
*
99
* load_flags ::
100
* A set of bit flags similar to those used when calling
101
* @FT_Load_Glyph, used to determine what kind of advances you need.
102
*
103
* @output:
104
* padvance ::
105
* The advance value. If scaling is performed (based on the value of
106
* `load_flags`), the advance value is in 16.16 format. Otherwise, it
107
* is in font units.
108
*
109
* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
110
* corresponding to a vertical layout. Otherwise, it is the horizontal
111
* advance in a horizontal layout.
112
*
113
* @return:
114
* FreeType error code. 0 means success.
115
*
116
* @note:
117
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
118
* the corresponding font backend doesn't have a quick way to retrieve
119
* the advances.
120
*
121
* A scaled advance is returned in 16.16 format but isn't transformed by
122
* the affine transformation specified by @FT_Set_Transform.
123
*/
124
FT_EXPORT( FT_Error )
125
FT_Get_Advance( FT_Face face,
126
FT_UInt gindex,
127
FT_Int32 load_flags,
128
FT_Fixed *padvance );
129
130
131
/**************************************************************************
132
*
133
* @function:
134
* FT_Get_Advances
135
*
136
* @description:
137
* Retrieve the advance values of several glyph outlines in an @FT_Face.
138
*
139
* @input:
140
* face ::
141
* The source @FT_Face handle.
142
*
143
* start ::
144
* The first glyph index.
145
*
146
* count ::
147
* The number of advance values you want to retrieve.
148
*
149
* load_flags ::
150
* A set of bit flags similar to those used when calling
151
* @FT_Load_Glyph.
152
*
153
* @output:
154
* padvance ::
155
* The advance values. This array, to be provided by the caller, must
156
* contain at least `count` elements.
157
*
158
* If scaling is performed (based on the value of `load_flags`), the
159
* advance values are in 16.16 format. Otherwise, they are in font
160
* units.
161
*
162
* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
163
* corresponding to a vertical layout. Otherwise, they are the
164
* horizontal advances in a horizontal layout.
165
*
166
* @return:
167
* FreeType error code. 0 means success.
168
*
169
* @note:
170
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
171
* the corresponding font backend doesn't have a quick way to retrieve
172
* the advances.
173
*
174
* Scaled advances are returned in 16.16 format but aren't transformed by
175
* the affine transformation specified by @FT_Set_Transform.
176
*/
177
FT_EXPORT( FT_Error )
178
FT_Get_Advances( FT_Face face,
179
FT_UInt start,
180
FT_UInt count,
181
FT_Int32 load_flags,
182
FT_Fixed *padvances );
183
184
/* */
185
186
187
FT_END_HEADER
188
189
#endif
/* FTADVANC_H_ */
190
191
192
/* END */
freetype.h
freetype
include
freetype
ftadvanc.h
Generated by
1.18.0