Commit 98c2fde0 authored by David Turner's avatar David Turner
Browse files

removed obsolete files... :-(

parent 81bb4ad9
This diff is collapsed.
/***************************************************************************/
/* */
/* ftgrays.h */
/* */
/* FreeType smooth renderer declaration */
/* */
/* Copyright 1996-2000 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 FTGRAYS_H
#define FTGRAYS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _STANDALONE_
#include "ftimage.h"
#else
#include <freetype/ftimage.h>
#endif
/*************************************************************************/
/* */
/* To make ftgrays.h independent from configuration files we check */
/* whether FT_EXPORT_VAR has been defined already. */
/* */
/* On some systems and compilers (Win32 mostly), an extra keyword is */
/* necessary to compile the library as a DLL. */
/* */
#ifndef FT_EXPORT_VAR
#define FT_EXPORT_VAR( x ) extern x
#endif
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_grays_raster;
#ifdef __cplusplus
}
#endif
#endif /* FTGRAYS_H */
/* END */
This diff is collapsed.
/***************************************************************************/
/* */
/* ftraster.h */
/* */
/* The FreeType glyph rasterizer (specification). */
/* */
/* Copyright 1996-2000 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
#ifdef __cplusplus
extern "C" {
#endif
#include <freetype/ftimage.h>
/*************************************************************************/
/* */
/* Uncomment the following line if you are using ftraster.c as a */
/* standalone module, fully independent of FreeType. */
/* */
/* #define _STANDALONE_ */
#ifndef FT_EXPORT_VAR
#define FT_EXPORT_VAR(x) extern x
#endif
FT_EXPORT_VAR(FT_Raster_Funcs) ft_standard_raster;
#ifdef __cplusplus
}
#endif
#endif /* FTRASTER_H */
/* END */
make_module_list: add_renderer_module
# XXX: important, the standard renderer *MUST* be first on this list!
#
add_renderer_module:
$(OPEN_DRIVER)ft_standard_renderer_class$(CLOSE_DRIVER)
$(ECHO_DRIVER)standard $(ECHO_DRIVER_DESC)standard outline renderer module$(ECHO_DRIVER_DONE)
$(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER)
$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)smooth outline renderer module$(ECHO_DRIVER_DONE)
# EOF
/***************************************************************************/
/* */
/* renderer.c */
/* */
/* FreeType renderer module (body). */
/* */
/* Copyright 2000 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 <freetype/internal/ftobjs.h>
/* initialize renderer - init its raster */
static
FT_Error ft_renderer_init( FT_Renderer render )
{
FT_Library library = FT_MODULE_LIBRARY( render );
render->clazz->raster_class->raster_reset( render->raster,
library->raster_pool,
library->raster_pool_size );
return 0;
}
/* set render-specific mode */
static
FT_Error ft_renderer_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_renderer_transform( FT_Renderer render,
FT_GlyphSlot slot,
FT_Matrix* matrix,
FT_Vector* delta )
{
FT_Error error = FT_Err_Ok;
if ( slot->format != render->glyph_format )
{
error = FT_Err_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_renderer_get_cbox( FT_Renderer render,
FT_GlyphSlot slot,
FT_BBox* cbox )
{
MEM_Set( cbox, 0, sizeof ( *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_renderer_render( FT_Renderer render,
FT_GlyphSlot slot,
FT_UInt mode,
FT_Vector* origin )
{
FT_Error error;
FT_Outline* outline;
FT_BBox cbox;
FT_UInt width, height, pitch;
FT_Bitmap* bitmap;
FT_Memory memory;
FT_Raster_Params params;
/* check glyph image format */
if ( slot->format != render->glyph_format )
{
error = FT_Err_Invalid_Argument;
goto Exit;
}
outline = &slot->outline;
/* translate the outline to the new origin if needed */
if ( origin )
FT_Outline_Translate( outline, origin->x, origin->y );
/* compute the control box, and grid fit it */
FT_Outline_Get_CBox( outline, &cbox );
cbox.xMin &= -64;
cbox.yMin &= -64;
cbox.xMax = ( cbox.xMax + 63 ) & -64;
cbox.yMax = ( cbox.yMax + 63 ) & -64;
width = ( cbox.xMax - cbox.xMin ) >> 6;
height = ( cbox.yMax - cbox.yMin ) >> 6;
bitmap = &slot->bitmap;
memory = slot->face->memory;
/* release old bitmap buffer */
if ( ( slot->flags & ft_glyph_own_bitmap ) )
{
FREE( bitmap->buffer );
slot->flags &= ~ft_glyph_own_bitmap;
}
/* allocate new one, depends on pixel format */
if ( mode & ft_render_mode_antialias )
{
pitch = width;
bitmap->pixel_mode = ft_pixel_mode_grays;
bitmap->num_grays = 256;
}
else
{
pitch = ( width + 7 ) >> 3;
bitmap->pixel_mode = ft_pixel_mode_mono;
}
bitmap->width = width;
bitmap->rows = height;
bitmap->pitch = pitch;
if ( ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
goto Exit;
slot->flags |= ft_glyph_own_bitmap;
/* translate outline to render it into the bitmap */
FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin );
/* set up parameters */
params.target = bitmap;
params.source = outline;
params.flags = 0;
if ( bitmap->pixel_mode == ft_pixel_mode_grays )
params.flags |= ft_raster_flag_aa;
/* render outline into the bitmap */
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
slot->format = ft_glyph_format_bitmap;
slot->bitmap_left = cbox.xMin >> 6;
slot->bitmap_top = cbox.yMax >> 6;
Exit:
return error;
}
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
#include <ftraster.h>
const FT_Renderer_Class ft_standard_renderer_class =
{
{
ft_module_renderer,
sizeof ( FT_RendererRec ),
"standard renderer",
0x10000L,
0x20000L,
0, /* module specific interface */
(FT_Module_Constructor)ft_renderer_init,
(FT_Module_Destructor) 0,
(FT_Module_Requester) 0
},
ft_glyph_format_outline,
(FTRenderer_render) ft_renderer_render,
(FTRenderer_transform)ft_renderer_transform,
(FTRenderer_getCBox) ft_renderer_get_cbox,
(FTRenderer_setMode) ft_renderer_set_mode,
(FT_Raster_Funcs*) &ft_standard_raster
};
#endif /* !FT_CONFIG_OPTION_NO_STD_RASTER */
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
#include <ftgrays.h>
const FT_Renderer_Class ft_smooth_renderer_class =
{
{
ft_module_renderer,
sizeof ( FT_RendererRec ),
"smooth renderer",
0x10000L,
0x20000L,
0, /* module specific interface */
(FT_Module_Constructor)ft_renderer_init,
(FT_Module_Destructor) 0,
(FT_Module_Requester) 0
},
ft_glyph_format_outline,
(FTRenderer_render) ft_renderer_render,
(FTRenderer_transform)ft_renderer_transform,
(FTRenderer_getCBox) ft_renderer_get_cbox,
(FTRenderer_setMode) ft_renderer_set_mode,
(FT_Raster_Funcs*) &ft_grays_raster
};
#endif /* !FT_CONFIG_OPTION_NO_SMOOTH_RASTER */
/* END */
/***************************************************************************/
/* */
/* renderer.h */
/* */
/* FreeType renderer module (specification). */
/* */
/* Copyright 2000 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 RENDERER_H
#define RENDERER_H
#include <freetype/ftrender.h>
#ifndef FT_CONFIG_OPTION_NO_STD_RASTER
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_std_renderer_class;
#endif
#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class;
#endif
#endif /* RENDERER_H */
/* END */
#
# FreeType 2 renderer module build rules
#
# Copyright 1996-2000 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.
# renderer driver directory
#
REND_DIR := $(SRC_)renderer
REND_DIR_ := $(REND_DIR)$(SEP)
# additional include flags used when compiling the driver
#
REND_INCLUDE := $(REND_DIR)
# compilation flags for the driver
#
REND_CFLAGS := $(REND_INCLUDE:%=$I%)
REND_COMPILE := $(FT_COMPILE) $(REND_CFLAGS)
# renderer driver sources (i.e., C files)
#
REND_DRV_SRC := $(REND_DIR_)ftraster.c \
$(REND_DIR_)ftgrays.c \
$(REND_DIR_)renderer.c
# renderer driver headers
#
REND_DRV_H := $(REND_DRV_SRC:%c=%h)
# renderer driver object(s)
#
# REND_DRV_OBJ_M is used during `multi' builds.
# REND_DRV_OBJ_S is used during `single' builds.
#
REND_DRV_OBJ_M := $(REND_DRV_SRC:$(REND_DIR_)%.c=$(OBJ_)%.$O)
REND_DRV_OBJ_S := $(REND_DRV_OBJ_M)
# renderer driver source file for single build
#
#REND_DRV_SRC_S := $(REND_DIR_)renderer.c
# renderer driver - single object
#
#$(REND_DRV_OBJ_S): $(REND_DRV_SRC_S) $(REND_DRV_SRC) \
# $(FREETYPE_H) $(REND_DRV_H)
# $(REND_COMPILE) $T$@ $(REND_DRV_SRC_S)
# renderer driver - multiple objects
#
$(OBJ_)%.$O: $(REND_DIR_)%.c $(FREETYPE_H) $(REND_DRV_H)
$(REND_COMPILE) $T$@ $<
# update main driver object lists
#
DRV_OBJS_S += $(REND_DRV_OBJ_M)
DRV_OBJS_M += $(REND_DRV_OBJ_M)
# EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment