vrshoot
diff libs/ft2static/freetype/ftrender.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftrender.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,230 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftrender.h */ 1.7 +/* */ 1.8 +/* FreeType renderer modules public interface (specification). */ 1.9 +/* */ 1.10 +/* Copyright 1996-2001, 2005, 2006, 2010 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTRENDER_H__ 1.23 +#define __FTRENDER_H__ 1.24 + 1.25 + 1.26 +#include <ft2build.h> 1.27 +#include FT_MODULE_H 1.28 +#include FT_GLYPH_H 1.29 + 1.30 + 1.31 +FT_BEGIN_HEADER 1.32 + 1.33 + 1.34 + /*************************************************************************/ 1.35 + /* */ 1.36 + /* <Section> */ 1.37 + /* module_management */ 1.38 + /* */ 1.39 + /*************************************************************************/ 1.40 + 1.41 + 1.42 + /* create a new glyph object */ 1.43 + typedef FT_Error 1.44 + (*FT_Glyph_InitFunc)( FT_Glyph glyph, 1.45 + FT_GlyphSlot slot ); 1.46 + 1.47 + /* destroys a given glyph object */ 1.48 + typedef void 1.49 + (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); 1.50 + 1.51 + typedef void 1.52 + (*FT_Glyph_TransformFunc)( FT_Glyph glyph, 1.53 + const FT_Matrix* matrix, 1.54 + const FT_Vector* delta ); 1.55 + 1.56 + typedef void 1.57 + (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, 1.58 + FT_BBox* abbox ); 1.59 + 1.60 + typedef FT_Error 1.61 + (*FT_Glyph_CopyFunc)( FT_Glyph source, 1.62 + FT_Glyph target ); 1.63 + 1.64 + typedef FT_Error 1.65 + (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, 1.66 + FT_GlyphSlot slot ); 1.67 + 1.68 +/* deprecated */ 1.69 +#define FT_Glyph_Init_Func FT_Glyph_InitFunc 1.70 +#define FT_Glyph_Done_Func FT_Glyph_DoneFunc 1.71 +#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc 1.72 +#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc 1.73 +#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc 1.74 +#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc 1.75 + 1.76 + 1.77 + struct FT_Glyph_Class_ 1.78 + { 1.79 + FT_Long glyph_size; 1.80 + FT_Glyph_Format glyph_format; 1.81 + FT_Glyph_InitFunc glyph_init; 1.82 + FT_Glyph_DoneFunc glyph_done; 1.83 + FT_Glyph_CopyFunc glyph_copy; 1.84 + FT_Glyph_TransformFunc glyph_transform; 1.85 + FT_Glyph_GetBBoxFunc glyph_bbox; 1.86 + FT_Glyph_PrepareFunc glyph_prepare; 1.87 + }; 1.88 + 1.89 + 1.90 + typedef FT_Error 1.91 + (*FT_Renderer_RenderFunc)( FT_Renderer renderer, 1.92 + FT_GlyphSlot slot, 1.93 + FT_UInt mode, 1.94 + const FT_Vector* origin ); 1.95 + 1.96 + typedef FT_Error 1.97 + (*FT_Renderer_TransformFunc)( FT_Renderer renderer, 1.98 + FT_GlyphSlot slot, 1.99 + const FT_Matrix* matrix, 1.100 + const FT_Vector* delta ); 1.101 + 1.102 + 1.103 + typedef void 1.104 + (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, 1.105 + FT_GlyphSlot slot, 1.106 + FT_BBox* cbox ); 1.107 + 1.108 + 1.109 + typedef FT_Error 1.110 + (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, 1.111 + FT_ULong mode_tag, 1.112 + FT_Pointer mode_ptr ); 1.113 + 1.114 +/* deprecated identifiers */ 1.115 +#define FTRenderer_render FT_Renderer_RenderFunc 1.116 +#define FTRenderer_transform FT_Renderer_TransformFunc 1.117 +#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc 1.118 +#define FTRenderer_setMode FT_Renderer_SetModeFunc 1.119 + 1.120 + 1.121 + /*************************************************************************/ 1.122 + /* */ 1.123 + /* <Struct> */ 1.124 + /* FT_Renderer_Class */ 1.125 + /* */ 1.126 + /* <Description> */ 1.127 + /* The renderer module class descriptor. */ 1.128 + /* */ 1.129 + /* <Fields> */ 1.130 + /* root :: The root @FT_Module_Class fields. */ 1.131 + /* */ 1.132 + /* glyph_format :: The glyph image format this renderer handles. */ 1.133 + /* */ 1.134 + /* render_glyph :: A method used to render the image that is in a */ 1.135 + /* given glyph slot into a bitmap. */ 1.136 + /* */ 1.137 + /* transform_glyph :: A method used to transform the image that is in */ 1.138 + /* a given glyph slot. */ 1.139 + /* */ 1.140 + /* get_glyph_cbox :: A method used to access the glyph's cbox. */ 1.141 + /* */ 1.142 + /* set_mode :: A method used to pass additional parameters. */ 1.143 + /* */ 1.144 + /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ 1.145 + /* This is a pointer to its raster's class. */ 1.146 + /* */ 1.147 + typedef struct FT_Renderer_Class_ 1.148 + { 1.149 + FT_Module_Class root; 1.150 + 1.151 + FT_Glyph_Format glyph_format; 1.152 + 1.153 + FT_Renderer_RenderFunc render_glyph; 1.154 + FT_Renderer_TransformFunc transform_glyph; 1.155 + FT_Renderer_GetCBoxFunc get_glyph_cbox; 1.156 + FT_Renderer_SetModeFunc set_mode; 1.157 + 1.158 + FT_Raster_Funcs* raster_class; 1.159 + 1.160 + } FT_Renderer_Class; 1.161 + 1.162 + 1.163 + /*************************************************************************/ 1.164 + /* */ 1.165 + /* <Function> */ 1.166 + /* FT_Get_Renderer */ 1.167 + /* */ 1.168 + /* <Description> */ 1.169 + /* Retrieve the current renderer for a given glyph format. */ 1.170 + /* */ 1.171 + /* <Input> */ 1.172 + /* library :: A handle to the library object. */ 1.173 + /* */ 1.174 + /* format :: The glyph format. */ 1.175 + /* */ 1.176 + /* <Return> */ 1.177 + /* A renderer handle. 0~if none found. */ 1.178 + /* */ 1.179 + /* <Note> */ 1.180 + /* An error will be returned if a module already exists by that name, */ 1.181 + /* or if the module requires a version of FreeType that is too great. */ 1.182 + /* */ 1.183 + /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ 1.184 + /* renderer by its name, use @FT_Get_Module. */ 1.185 + /* */ 1.186 + FT_EXPORT( FT_Renderer ) 1.187 + FT_Get_Renderer( FT_Library library, 1.188 + FT_Glyph_Format format ); 1.189 + 1.190 + 1.191 + /*************************************************************************/ 1.192 + /* */ 1.193 + /* <Function> */ 1.194 + /* FT_Set_Renderer */ 1.195 + /* */ 1.196 + /* <Description> */ 1.197 + /* Set the current renderer to use, and set additional mode. */ 1.198 + /* */ 1.199 + /* <InOut> */ 1.200 + /* library :: A handle to the library object. */ 1.201 + /* */ 1.202 + /* <Input> */ 1.203 + /* renderer :: A handle to the renderer object. */ 1.204 + /* */ 1.205 + /* num_params :: The number of additional parameters. */ 1.206 + /* */ 1.207 + /* parameters :: Additional parameters. */ 1.208 + /* */ 1.209 + /* <Return> */ 1.210 + /* FreeType error code. 0~means success. */ 1.211 + /* */ 1.212 + /* <Note> */ 1.213 + /* In case of success, the renderer will be used to convert glyph */ 1.214 + /* images in the renderer's known format into bitmaps. */ 1.215 + /* */ 1.216 + /* This doesn't change the current renderer for other formats. */ 1.217 + /* */ 1.218 + FT_EXPORT( FT_Error ) 1.219 + FT_Set_Renderer( FT_Library library, 1.220 + FT_Renderer renderer, 1.221 + FT_UInt num_params, 1.222 + FT_Parameter* parameters ); 1.223 + 1.224 + 1.225 + /* */ 1.226 + 1.227 + 1.228 +FT_END_HEADER 1.229 + 1.230 +#endif /* __FTRENDER_H__ */ 1.231 + 1.232 + 1.233 +/* END */