1 /****************************************************************************
5 * FreeType size objects management (specification).
7 * Copyright (C) 1996-2020 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
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.
19 /**************************************************************************
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
32 #include <freetype/freetype.h>
35 #error "freetype.h of FreeType 1 has been loaded!"
36 #error "Please fix the directory search order for header files"
37 #error "so that freetype.h of FreeType 2 is found first."
44 /**************************************************************************
53 * Managing multiple sizes per face.
56 * When creating a new face object (e.g., with @FT_New_Face), an @FT_Size
57 * object is automatically created and used to store all pixel-size
58 * dependent information, available in the `face->size` field.
60 * It is however possible to create more sizes for a given face, mostly
61 * in order to manage several character pixel sizes of the same font
62 * family and style. See @FT_New_Size and @FT_Done_Size.
64 * Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the
65 * contents of the current 'active' size; you thus need to use
66 * @FT_Activate_Size to change it.
68 * 99% of applications won't need the functions provided here, especially
69 * if they use the caching sub-system, so be cautious when using these.
74 /**************************************************************************
80 * Create a new size object from a given face object.
84 * A handle to a parent face object.
88 * A handle to a new size object.
91 * FreeType error code. 0~means success.
94 * You need to call @FT_Activate_Size in order to select the new size for
95 * upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,
96 * @FT_Load_Glyph, @FT_Load_Char, etc.
99 FT_New_Size( FT_Face face,
103 /**************************************************************************
109 * Discard a given size object. Note that @FT_Done_Face automatically
110 * discards all size objects allocated with @FT_New_Size.
114 * A handle to a target size object.
117 * FreeType error code. 0~means success.
119 FT_EXPORT( FT_Error )
120 FT_Done_Size( FT_Size size );
123 /**************************************************************************
129 * Even though it is possible to create several size objects for a given
130 * face (see @FT_New_Size for details), functions like @FT_Load_Glyph or
131 * @FT_Load_Char only use the one that has been activated last to
132 * determine the 'current character pixel size'.
134 * This function can be used to 'activate' a previously created size
139 * A handle to a target size object.
142 * FreeType error code. 0~means success.
145 * If `face` is the size's parent face object, this function changes the
146 * value of `face->size` to the input size handle.
148 FT_EXPORT( FT_Error )
149 FT_Activate_Size( FT_Size size );
156 #endif /* FTSIZES_H_ */