sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
ftsizes.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftsizes.h
4 *
5 * FreeType size objects management (specification).
6 *
7 * Copyright (C) 1996-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
19 /**************************************************************************
20 *
21 * Typical application would normally not need to use these functions.
22 * However, they have been placed in a public API for the rare cases where
23 * they are needed.
24 *
25 */
26
27
32#ifndef FTSIZES_H_
33#define FTSIZES_H_
34
35
36#include <freetype/freetype.h>
37
38#ifdef FREETYPE_H
39#error "freetype.h of FreeType 1 has been loaded!"
40#error "Please fix the directory search order for header files"
41#error "so that freetype.h of FreeType 2 is found first."
42#endif
43
44
45FT_BEGIN_HEADER
46
47
48 /**************************************************************************
49 *
50 * @section:
51 * sizes_management
52 *
53 * @title:
54 * Size Management
55 *
56 * @abstract:
57 * Managing multiple sizes per face.
58 *
59 * @description:
60 * When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
61 * object is automatically created and used to store all pixel-size
62 * dependent information, available in the `face->size` field.
63 *
64 * It is however possible to create more sizes for a given face, mostly
65 * in order to manage several character pixel sizes of the same font
66 * family and style. See @FT_New_Size and @FT_Done_Size.
67 *
68 * Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the
69 * contents of the current 'active' size; you thus need to use
70 * @FT_Activate_Size to change it.
71 *
72 * 99% of applications won't need the functions provided here, especially
73 * if they use the caching sub-system, so be cautious when using these.
74 *
75 */
76
77
78 /**************************************************************************
79 *
80 * @function:
81 * FT_New_Size
82 *
83 * @description:
84 * Create a new size object from a given face object.
85 *
86 * @input:
87 * face ::
88 * A handle to a parent face object.
89 *
90 * @output:
91 * asize ::
92 * A handle to a new size object.
93 *
94 * @return:
95 * FreeType error code. 0~means success.
96 *
97 * @note:
98 * You need to call @FT_Activate_Size in order to select the new size for
99 * upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,
100 * @FT_Load_Glyph, @FT_Load_Char, etc.
101 */
102 FT_EXPORT( FT_Error )
103 FT_New_Size( FT_Face face,
104 FT_Size* size );
105
106
107 /**************************************************************************
108 *
109 * @function:
110 * FT_Done_Size
111 *
112 * @description:
113 * Discard a given size object. Note that @FT_Done_Face automatically
114 * discards all size objects allocated with @FT_New_Size.
115 *
116 * @input:
117 * size ::
118 * A handle to a target size object.
119 *
120 * @return:
121 * FreeType error code. 0~means success.
122 */
123 FT_EXPORT( FT_Error )
124 FT_Done_Size( FT_Size size );
125
126
127 /**************************************************************************
128 *
129 * @function:
130 * FT_Activate_Size
131 *
132 * @description:
133 * Even though it is possible to create several size objects for a given
134 * face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
135 * @FT_Load_Char only use the one that has been activated last to
136 * determine the 'current character pixel size'.
137 *
138 * This function can be used to 'activate' a previously created size
139 * object.
140 *
141 * @input:
142 * size ::
143 * A handle to a target size object.
144 *
145 * @return:
146 * FreeType error code. 0~means success.
147 *
148 * @note:
149 * If `face` is the size's parent face object, this function changes the
150 * value of `face->size` to the input size handle.
151 */
152 FT_EXPORT( FT_Error )
153 FT_Activate_Size( FT_Size size );
154
155 /* */
156
157
158FT_END_HEADER
159
160#endif /* FTSIZES_H_ */
161
162
163/* END */