2000-06-22 02:26:54 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftrender.h */
|
|
|
|
/* */
|
2000-07-14 08:16:47 +02:00
|
|
|
/* FreeType renderer modules public interface (specification). */
|
2000-06-22 02:26:54 +02:00
|
|
|
/* */
|
|
|
|
/* Copyright 1996-2000 by */
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
2000-07-11 08:12:20 +02:00
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
2000-06-22 02:26:54 +02:00
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-06-22 02:26:54 +02:00
|
|
|
#ifndef FTRENDER_H
|
|
|
|
#define FTRENDER_H
|
|
|
|
|
|
|
|
#include <freetype/ftmodule.h>
|
2000-07-01 01:12:55 +02:00
|
|
|
#include <freetype/ftglyph.h>
|
|
|
|
|
2000-07-05 06:32:02 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
/* create a new glyph object */
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef FT_Error (*FT_Glyph_Init_Func) ( FT_Glyph glyph,
|
|
|
|
FT_GlyphSlot slot );
|
2000-07-11 08:12:20 +02:00
|
|
|
|
|
|
|
/* destroys a given glyph object */
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef void (*FT_Glyph_Done_Func) ( FT_Glyph glyph );
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef void (*FT_Glyph_Transform_Func)( FT_Glyph glyph,
|
|
|
|
FT_Matrix* matrix,
|
|
|
|
FT_Vector* delta );
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef void (*FT_Glyph_BBox_Func) ( FT_Glyph glyph,
|
|
|
|
FT_BBox* abbox );
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef FT_Error (*FT_Glyph_Copy_Func) ( FT_Glyph source,
|
|
|
|
FT_Glyph target );
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef FT_Error (*FT_Glyph_Prepare_Func) ( FT_Glyph glyph,
|
|
|
|
FT_GlyphSlot slot );
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
struct FT_Glyph_Class_
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
FT_UInt glyph_size;
|
|
|
|
FT_Glyph_Format glyph_format;
|
|
|
|
FT_Glyph_Init_Func glyph_init;
|
|
|
|
FT_Glyph_Done_Func glyph_done;
|
|
|
|
FT_Glyph_Copy_Func glyph_copy;
|
|
|
|
FT_Glyph_Transform_Func glyph_transform;
|
|
|
|
FT_Glyph_BBox_Func glyph_bbox;
|
|
|
|
FT_Glyph_Prepare_Func glyph_prepare;
|
|
|
|
};
|
|
|
|
|
2000-06-22 02:26:54 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef FT_Error (*FTRenderer_render) ( FT_Renderer renderer,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_UInt mode,
|
|
|
|
FT_Vector* origin );
|
2000-06-22 02:26:54 +02:00
|
|
|
|
|
|
|
typedef FT_Error (*FTRenderer_transform)( FT_Renderer renderer,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_Matrix* matrix,
|
|
|
|
FT_Vector* delta );
|
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef void (*FTRenderer_getCBox) ( FT_Renderer renderer,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_BBox* cbox );
|
2000-06-22 02:26:54 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
typedef FT_Error (*FTRenderer_setMode) ( FT_Renderer renderer,
|
|
|
|
FT_ULong mode_tag,
|
|
|
|
FT_Pointer mode_ptr );
|
2000-06-22 02:26:54 +02:00
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Renderer_Class */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The renderer module class descriptor. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* root :: The root FT_Module_Class fields. */
|
|
|
|
/* */
|
|
|
|
/* glyph_format :: The glyph image format this renderer handles. */
|
|
|
|
/* */
|
|
|
|
/* render_glyph :: A method used to render the image that is in a */
|
|
|
|
/* given glyph slot into a bitmap. */
|
|
|
|
/* */
|
|
|
|
/* set_mode :: A method used to pass additional parameters. */
|
|
|
|
/* */
|
|
|
|
/* raster_class :: For `ft_glyph_format_outline' renderers only, this */
|
|
|
|
/* is a pointer to its raster's class. */
|
|
|
|
/* */
|
|
|
|
/* raster :: For `ft_glyph_format_outline' renderers only. this */
|
|
|
|
/* is a pointer to the corresponding raster object, */
|
|
|
|
/* if any. */
|
|
|
|
/* */
|
2000-06-22 02:26:54 +02:00
|
|
|
typedef struct FT_Renderer_Class_
|
|
|
|
{
|
|
|
|
FT_Module_Class root;
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-06-22 02:26:54 +02:00
|
|
|
FT_Glyph_Format glyph_format;
|
2000-07-11 08:12:20 +02:00
|
|
|
|
2000-06-22 02:26:54 +02:00
|
|
|
FTRenderer_render render_glyph;
|
|
|
|
FTRenderer_transform transform_glyph;
|
|
|
|
FTRenderer_getCBox get_glyph_cbox;
|
|
|
|
FTRenderer_setMode set_mode;
|
|
|
|
|
|
|
|
FT_Raster_Funcs* raster_class;
|
|
|
|
|
|
|
|
} FT_Renderer_Class;
|
|
|
|
|
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Get_Renderer */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Retrieves the current renderer for a given glyph format. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to the library object. */
|
|
|
|
/* */
|
|
|
|
/* format :: The glyph format. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* A renderer handle. 0 if none found. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* An error will be returned if a module already exists by that name, */
|
|
|
|
/* or if the module requires a version of FreeType that is too great. */
|
|
|
|
/* */
|
|
|
|
/* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
|
|
|
|
/* renderer by its name, use FT_Get_Module(). */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT_DEF( FT_Renderer ) FT_Get_Renderer( FT_Library library,
|
|
|
|
FT_Glyph_Format format );
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Set_Renderer */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Sets the current renderer to use, and set additional mode. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* library :: A handle to the library object. */
|
|
|
|
/* */
|
|
|
|
/* renderer :: A handle to the renderer object. */
|
|
|
|
/* */
|
|
|
|
/* num_params :: The number of additional parameters. */
|
|
|
|
/* */
|
|
|
|
/* parameters :: Additional parameters. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* In case of success, the renderer will be used to convert glyph */
|
|
|
|
/* images in the renderer's known format into bitmaps. */
|
|
|
|
/* */
|
|
|
|
/* This doesn't change the current renderer for other formats. */
|
|
|
|
/* */
|
2000-10-17 05:38:43 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Set_Renderer( FT_Library library,
|
|
|
|
FT_Renderer renderer,
|
|
|
|
FT_UInt num_params,
|
|
|
|
FT_Parameter* parameters );
|
2000-06-22 02:26:54 +02:00
|
|
|
|
|
|
|
|
2000-07-05 06:32:02 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-11 08:12:20 +02:00
|
|
|
#endif /* FTRENDER_H */
|
2000-06-22 02:26:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|