#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftobjs.h>
#include <freetype/internal/services/svprop.h>
#include <freetype/ftoutln.h>
#include <freetype/ftbitmap.h>
#include "ftsdfrend.h"
#include "ftsdf.h"
#include "ftsdferrs.h"
#undef FT_COMPONENT
#define FT_COMPONENT …
#define SDF_RENDERER( rend ) …
static FT_Error
sdf_property_set( FT_Module module,
const char* property_name,
const void* value,
FT_Bool value_is_string )
{ … }
static FT_Error
sdf_property_get( FT_Module module,
const char* property_name,
void* value )
{ … }
FT_DEFINE_SERVICE_PROPERTIESREC(
sdf_service_properties,
(FT_Properties_SetFunc)sdf_property_set,
(FT_Properties_GetFunc)sdf_property_get )
FT_DEFINE_SERVICEDESCREC1(
sdf_services,
FT_SERVICE_ID_PROPERTIES, &sdf_service_properties )
static FT_Module_Interface
ft_sdf_requester( FT_Module module,
const char* module_interface )
{ … }
static FT_Error
ft_sdf_init( FT_Module module )
{ … }
static void
ft_sdf_done( FT_Module module )
{ … }
static FT_Error
ft_sdf_render( FT_Renderer module,
FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin )
{ … }
static FT_Error
ft_sdf_transform( FT_Renderer render,
FT_GlyphSlot slot,
const FT_Matrix* matrix,
const FT_Vector* delta )
{ … }
static void
ft_sdf_get_cbox( FT_Renderer render,
FT_GlyphSlot slot,
FT_BBox* cbox )
{ … }
static FT_Error
ft_sdf_set_mode( FT_Renderer render,
FT_ULong mode_tag,
FT_Pointer data )
{ … }
FT_DEFINE_RENDERER(
ft_sdf_renderer_class,
FT_MODULE_RENDERER,
sizeof ( SDF_Renderer_Module ),
"sdf",
0x10000L,
0x20000L,
NULL,
(FT_Module_Constructor)ft_sdf_init,
(FT_Module_Destructor) ft_sdf_done,
(FT_Module_Requester) ft_sdf_requester,
FT_GLYPH_FORMAT_OUTLINE,
(FT_Renderer_RenderFunc) ft_sdf_render,
(FT_Renderer_TransformFunc)ft_sdf_transform,
(FT_Renderer_GetCBoxFunc) ft_sdf_get_cbox,
(FT_Renderer_SetModeFunc) ft_sdf_set_mode,
(FT_Raster_Funcs*)&ft_sdf_raster
)
static FT_Error
ft_bsdf_render( FT_Renderer module,
FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin )
{ … }
FT_DEFINE_RENDERER(
ft_bitmap_sdf_renderer_class,
FT_MODULE_RENDERER,
sizeof ( SDF_Renderer_Module ),
"bsdf",
0x10000L,
0x20000L,
NULL,
(FT_Module_Constructor)ft_sdf_init,
(FT_Module_Destructor) ft_sdf_done,
(FT_Module_Requester) ft_sdf_requester,
FT_GLYPH_FORMAT_BITMAP,
(FT_Renderer_RenderFunc) ft_bsdf_render,
(FT_Renderer_TransformFunc)ft_sdf_transform,
(FT_Renderer_GetCBoxFunc) ft_sdf_get_cbox,
(FT_Renderer_SetModeFunc) ft_sdf_set_mode,
(FT_Raster_Funcs*)&ft_bitmap_sdf_raster
)