1 /***************************************************************************/
5 /* FreeType renderer modules public interface (specification). */
7 /* Copyright 1996-2000 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. */
16 /***************************************************************************/
22 #include <freetype/ftmodule.h>
23 #include <freetype/ftglyph.h>
31 /* create a new glyph object */
32 typedef FT_Error (*FT_Glyph_Init_Func
)( FT_Glyph glyph
,
35 /* destroys a given glyph object */
36 typedef void (*FT_Glyph_Done_Func
)( FT_Glyph glyph
);
38 typedef void (*FT_Glyph_Transform_Func
)( FT_Glyph glyph
,
42 typedef void (*FT_Glyph_BBox_Func
)( FT_Glyph glyph
,
45 typedef FT_Error (*FT_Glyph_Copy_Func
)( FT_Glyph source
,
48 typedef FT_Error (*FT_Glyph_Prepare_Func
)( FT_Glyph glyph
,
51 struct FT_Glyph_Class_
54 FT_Glyph_Format glyph_format
;
55 FT_Glyph_Init_Func glyph_init
;
56 FT_Glyph_Done_Func glyph_done
;
57 FT_Glyph_Copy_Func glyph_copy
;
58 FT_Glyph_Transform_Func glyph_transform
;
59 FT_Glyph_BBox_Func glyph_bbox
;
60 FT_Glyph_Prepare_Func glyph_prepare
;
64 typedef FT_Error (*FTRenderer_render
)( FT_Renderer renderer
,
69 typedef FT_Error (*FTRenderer_transform
)( FT_Renderer renderer
,
74 typedef void (*FTRenderer_getCBox
)( FT_Renderer renderer
,
78 typedef FT_Error (*FTRenderer_setMode
)( FT_Renderer renderer
,
80 FT_Pointer mode_ptr
);
83 /*************************************************************************/
86 /* FT_Renderer_Class */
89 /* The renderer module class descriptor. */
92 /* root :: The root FT_Module_Class fields. */
94 /* glyph_format :: The glyph image format this renderer handles. */
96 /* render_glyph :: A method used to render the image that is in a */
97 /* given glyph slot into a bitmap. */
99 /* set_mode :: A method used to pass additional parameters. */
101 /* raster_class :: For `ft_glyph_format_outline' renderers only, this */
102 /* is a pointer to its raster's class. */
104 /* raster :: For `ft_glyph_format_outline' renderers only. this */
105 /* is a pointer to the corresponding raster object, */
108 typedef struct FT_Renderer_Class_
110 FT_Module_Class root
;
112 FT_Glyph_Format glyph_format
;
114 FTRenderer_render render_glyph
;
115 FTRenderer_transform transform_glyph
;
116 FTRenderer_getCBox get_glyph_cbox
;
117 FTRenderer_setMode set_mode
;
119 FT_Raster_Funcs
* raster_class
;
124 /*************************************************************************/
127 /* FT_Get_Renderer */
130 /* Retrieves the current renderer for a given glyph format. */
133 /* library :: A handle to the library object. */
135 /* format :: The glyph format. */
138 /* A renderer handle. 0 if none found. */
141 /* An error will be returned if a module already exists by that name, */
142 /* or if the module requires a version of FreeType that is too great. */
144 /* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
145 /* renderer by its name, use FT_Get_Module(). */
147 FT_EXPORT_DEF( FT_Renderer
) FT_Get_Renderer( FT_Library library
,
148 FT_Glyph_Format format
);
151 /*************************************************************************/
154 /* FT_Set_Renderer */
157 /* Sets the current renderer to use, and set additional mode. */
160 /* library :: A handle to the library object. */
162 /* renderer :: A handle to the renderer object. */
164 /* num_params :: The number of additional parameters. */
166 /* parameters :: Additional parameters. */
169 /* FreeType error code. 0 means success. */
172 /* In case of success, the renderer will be used to convert glyph */
173 /* images in the renderer's known format into bitmaps. */
175 /* This doesn't change the current renderer for other formats. */
177 FT_EXPORT_DEF(FT_Error
) FT_Set_Renderer( FT_Library library
,
178 FT_Renderer renderer
,
180 FT_Parameter
* parameters
);
188 #endif /* FTRENDER_H */