Remove unused Freetype monochrome rasteriser

This commit is contained in:
UnknownShadow200 2022-08-27 14:08:38 +10:00
parent 720f7af4fa
commit 2cdf7d2969
12 changed files with 0 additions and 3561 deletions

View File

@ -342,7 +342,6 @@
<ClCompile Include="_psaux.c" /> <ClCompile Include="_psaux.c" />
<ClCompile Include="_pshinter.c" /> <ClCompile Include="_pshinter.c" />
<ClCompile Include="_psmodule.c" /> <ClCompile Include="_psmodule.c" />
<ClCompile Include="_raster.c" />
<ClCompile Include="_sfnt.c" /> <ClCompile Include="_sfnt.c" />
<ClCompile Include="_smooth.c" /> <ClCompile Include="_smooth.c" />
<ClCompile Include="_truetype.c" /> <ClCompile Include="_truetype.c" />

View File

@ -488,9 +488,6 @@
<ClCompile Include="_psmodule.c"> <ClCompile Include="_psmodule.c">
<Filter>Source Files\Freetype</Filter> <Filter>Source Files\Freetype</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="_raster.c">
<Filter>Source Files\Freetype</Filter>
</ClCompile>
<ClCompile Include="_sfnt.c"> <ClCompile Include="_sfnt.c">
<Filter>Source Files\Freetype</Filter> <Filter>Source Files\Freetype</Filter>
</ClCompile> </ClCompile>

View File

@ -1,27 +0,0 @@
/***************************************************************************/
/* */
/* raster.c */
/* */
/* FreeType monochrome rasterer module component (body only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* 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. */
/* */
/***************************************************************************/
#include "Core.h"
#ifdef CC_BUILD_FREETYPE
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include "freetype/ft2build.h"
#include "freetype/ftraster.c"
#include "freetype/ftrend1.c"
#endif
/* END */

View File

@ -2718,7 +2718,6 @@ FT_BEGIN_HEADER
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) #define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_RECURSE ( 1L << 10 ) #define FT_LOAD_NO_RECURSE ( 1L << 10 )
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) #define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) #define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) #define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
/* Bits 16-19 are used by `FT_LOAD_TARGET_' */ /* Bits 16-19 are used by `FT_LOAD_TARGET_' */
@ -2820,7 +2819,6 @@ FT_BEGIN_HEADER
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
/************************************************************************** /**************************************************************************

View File

@ -57,7 +57,6 @@ FT_BEGIN_HEADER
/* psaux */ /* psaux */
/* pshinter */ /* pshinter */
/* psnames */ /* psnames */
/* raster1 */
/* sfnt */ /* sfnt */
/* smooth, smooth-lcd, smooth-lcdv */ /* smooth, smooth-lcd, smooth-lcdv */
/* truetype */ /* truetype */

View File

@ -17,7 +17,6 @@ FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class ) FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class ) FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )

View File

@ -923,10 +923,6 @@
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags ); FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
if ( mode == FT_RENDER_MODE_NORMAL &&
load_flags & FT_LOAD_MONOCHROME )
mode = FT_RENDER_MODE_MONO;
if ( load_flags & FT_LOAD_RENDER ) if ( load_flags & FT_LOAD_RENDER )
error = FT_Render_Glyph( slot, mode ); error = FT_Render_Glyph( slot, mode );
else else

View File

@ -834,18 +834,6 @@ FT_BEGIN_HEADER
FT_String* glyph_name ); FT_String* glyph_name );
/* Define default raster's interface. The default raster is located in */
/* `src/base/ftraster.c'. */
/* */
/* Client applications can register new rasters through the */
/* FT_Set_Raster() API. */
#ifndef FT_NO_DEFAULT_RASTER
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
#endif
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
/***************************************************************************/
/* */
/* ftraster.h */
/* */
/* The FreeType glyph rasterizer (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTRASTER_H_
#define FTRASTER_H_
#include "ft2build.h"
#include FT_CONFIG_CONFIG_H
#include FT_IMAGE_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Uncomment the following line if you are using ftraster.c as a */
/* standalone module, fully independent of FreeType. */
/* */
/* #define STANDALONE_ */
FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster;
FT_END_HEADER
#endif /* FTRASTER_H_ */
/* END */

View File

@ -1,203 +0,0 @@
/***************************************************************************/
/* */
/* ftrend1.c */
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* 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. */
/* */
/***************************************************************************/
#include "ft2build.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
#include FT_OUTLINE_H
#include "ftrend1.h"
#include "ftraster.h"
#include "rasterrs.h"
/* initialize renderer -- init its raster */
static FT_Error
ft_raster1_init( FT_Renderer render )
{
render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
return FT_Err_Ok;
}
/* set render-specific mode */
static FT_Error
ft_raster1_set_mode( FT_Renderer render,
FT_ULong mode_tag,
FT_Pointer data )
{
/* we simply pass it to the raster */
return render->clazz->raster_class->raster_set_mode( render->raster,
mode_tag,
data );
}
/* transform a given glyph image */
static FT_Error
ft_raster1_transform( FT_Renderer render,
FT_GlyphSlot slot,
const FT_Matrix* matrix,
const FT_Vector* delta )
{
FT_Error error = FT_Err_Ok;
if ( slot->format != render->glyph_format )
{
error = FT_THROW( Invalid_Argument );
goto Exit;
}
if ( matrix )
FT_Outline_Transform( &slot->outline, matrix );
if ( delta )
FT_Outline_Translate( &slot->outline, delta->x, delta->y );
Exit:
return error;
}
/* return the glyph's control box */
static void
ft_raster1_get_cbox( FT_Renderer render,
FT_GlyphSlot slot,
FT_BBox* cbox )
{
FT_ZERO( cbox );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
}
/* convert a slot's glyph image into a bitmap */
static FT_Error
ft_raster1_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;
FT_Bitmap* bitmap = &slot->bitmap;
FT_Memory memory = render->root.memory;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
FT_Raster_Params params;
/* check glyph image format */
if ( slot->format != render->glyph_format )
{
error = FT_THROW( Invalid_Argument );
goto Exit;
}
/* check rendering mode */
if ( mode != FT_RENDER_MODE_MONO )
{
/* raster1 is only capable of producing monochrome bitmaps */
return FT_THROW( Cannot_Render_Glyph );
}
/* release old bitmap buffer */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_FREE( bitmap->buffer );
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
ft_glyphslot_preset_bitmap( slot, mode, origin );
/* allocate new one */
if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
goto Exit;
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
x_shift = -slot->bitmap_left * 64;
y_shift = ( (FT_Int)bitmap->rows - slot->bitmap_top ) * 64;
if ( origin )
{
x_shift += origin->x;
y_shift += origin->y;
}
/* translate outline to render it into the bitmap */
if ( x_shift || y_shift )
FT_Outline_Translate( outline, x_shift, y_shift );
/* set up parameters */
params.target = bitmap;
params.source = outline;
params.flags = FT_RASTER_FLAG_DEFAULT;
/* render outline into the bitmap */
error = render->raster_render( render->raster, &params );
Exit:
if ( !error )
/* everything is fine; the glyph is now officially a bitmap */
slot->format = FT_GLYPH_FORMAT_BITMAP;
else if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_FREE( bitmap->buffer );
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
if ( x_shift || y_shift )
FT_Outline_Translate( outline, -x_shift, -y_shift );
return error;
}
FT_DEFINE_RENDERER(
ft_raster1_renderer_class,
FT_MODULE_RENDERER,
sizeof ( FT_RendererRec ),
"raster1",
0x10000L,
0x20000L,
NULL, /* module specific interface */
(FT_Module_Constructor)ft_raster1_init, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */
(FT_Module_Requester) NULL, /* get_interface */
FT_GLYPH_FORMAT_OUTLINE,
(FT_Renderer_RenderFunc) ft_raster1_render, /* render_glyph */
(FT_Renderer_TransformFunc)ft_raster1_transform, /* transform_glyph */
(FT_Renderer_GetCBoxFunc) ft_raster1_get_cbox, /* get_glyph_cbox */
(FT_Renderer_SetModeFunc) ft_raster1_set_mode, /* set_mode */
(FT_Raster_Funcs*)&ft_standard_raster /* raster_class */
)
/* END */

View File

@ -1,38 +0,0 @@
/***************************************************************************/
/* */
/* ftrend1.h */
/* */
/* The FreeType glyph rasterizer interface (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTREND1_H_
#define FTREND1_H_
#include "ft2build.h"
#include FT_RENDER_H
FT_BEGIN_HEADER
FT_DECLARE_RENDERER( ft_raster1_renderer_class )
FT_END_HEADER
#endif /* FTREND1_H_ */
/* END */