@ -110,11 +110,10 @@
/* convert a slot's glyph image into a bitmap */
static FT_Error
ft_smooth_render_generic ( FT_Renderer render ,
FT_GlyphSlot slot ,
FT_Render_Mode mode ,
const FT_Vector * origin ,
FT_Render_Mode required_mode )
ft_smooth_render ( FT_Renderer render ,
FT_GlyphSlot slot ,
FT_Render_Mode mode ,
const FT_Vector * origin )
{
FT_Error error = FT_Err_Ok ;
FT_Outline * outline = & slot - > outline ;
@ -136,7 +135,9 @@
}
/* check mode */
if ( mode ! = required_mode )
if ( mode ! = FT_RENDER_MODE_NORMAL & &
mode ! = FT_RENDER_MODE_LIGHT & &
! hmul & & ! vmul )
{
error = FT_THROW ( Cannot_Render_Glyph ) ;
goto Exit ;
@ -383,45 +384,6 @@
}
/* convert a slot's glyph image into a bitmap */
static FT_Error
ft_smooth_render ( FT_Renderer render ,
FT_GlyphSlot slot ,
FT_Render_Mode mode ,
const FT_Vector * origin )
{
if ( mode = = FT_RENDER_MODE_LIGHT )
mode = FT_RENDER_MODE_NORMAL ;
return ft_smooth_render_generic ( render , slot , mode , origin ,
FT_RENDER_MODE_NORMAL ) ;
}
/* convert a slot's glyph image into a horizontal LCD bitmap */
static FT_Error
ft_smooth_render_lcd ( FT_Renderer render ,
FT_GlyphSlot slot ,
FT_Render_Mode mode ,
const FT_Vector * origin )
{
return ft_smooth_render_generic ( render , slot , mode , origin ,
FT_RENDER_MODE_LCD ) ;
}
/* convert a slot's glyph image into a vertical LCD bitmap */
static FT_Error
ft_smooth_render_lcd_v ( FT_Renderer render ,
FT_GlyphSlot slot ,
FT_Render_Mode mode ,
const FT_Vector * origin )
{
return ft_smooth_render_generic ( render , slot , mode , origin ,
FT_RENDER_MODE_LCD_V ) ;
}
FT_DEFINE_RENDERER (
ft_smooth_renderer_class ,
@ -449,58 +411,4 @@
)
FT_DEFINE_RENDERER (
ft_smooth_lcd_renderer_class ,
FT_MODULE_RENDERER ,
sizeof ( FT_RendererRec ) ,
" smooth-lcd " ,
0x10000L ,
0x20000L ,
NULL , /* module specific interface */
( FT_Module_Constructor ) ft_smooth_init , /* module_init */
( FT_Module_Destructor ) NULL , /* module_done */
( FT_Module_Requester ) NULL , /* get_interface */
FT_GLYPH_FORMAT_OUTLINE ,
( FT_Renderer_RenderFunc ) ft_smooth_render_lcd , /* render_glyph */
( FT_Renderer_TransformFunc ) ft_smooth_transform , /* transform_glyph */
( FT_Renderer_GetCBoxFunc ) ft_smooth_get_cbox , /* get_glyph_cbox */
( FT_Renderer_SetModeFunc ) ft_smooth_set_mode , /* set_mode */
( FT_Raster_Funcs * ) & ft_grays_raster /* raster_class */
)
FT_DEFINE_RENDERER (
ft_smooth_lcdv_renderer_class ,
FT_MODULE_RENDERER ,
sizeof ( FT_RendererRec ) ,
" smooth-lcdv " ,
0x10000L ,
0x20000L ,
NULL , /* module specific interface */
( FT_Module_Constructor ) ft_smooth_init , /* module_init */
( FT_Module_Destructor ) NULL , /* module_done */
( FT_Module_Requester ) NULL , /* get_interface */
FT_GLYPH_FORMAT_OUTLINE ,
( FT_Renderer_RenderFunc ) ft_smooth_render_lcd_v , /* render_glyph */
( FT_Renderer_TransformFunc ) ft_smooth_transform , /* transform_glyph */
( FT_Renderer_GetCBoxFunc ) ft_smooth_get_cbox , /* get_glyph_cbox */
( FT_Renderer_SetModeFunc ) ft_smooth_set_mode , /* set_mode */
( FT_Raster_Funcs * ) & ft_grays_raster /* raster_class */
)
/* END */