Formatting as usual...
Adding trivial argument checking to some functions. Added dynamic driver interface to cidriver. Minor `version' fixes for macfont and psnames modules. Removed unnecessary files
This commit is contained in:
parent
c06aba285f
commit
a8bbc267a2
File diff suppressed because it is too large
Load Diff
@ -664,6 +664,7 @@
|
||||
FT_Memory memory = driver->root.memory;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
slot->library = driver->root.library;
|
||||
|
||||
if ( FT_DRIVER_USES_OUTLINES( driver ) )
|
||||
@ -2040,8 +2041,9 @@
|
||||
/* */
|
||||
/* right_glyph :: The index of the right glyph in the kern pair. */
|
||||
/* */
|
||||
/* kern_mode :: see FT_Kerning_Mode for more info. Determines the */
|
||||
/* scale/dimension of the returned kerning vector */
|
||||
/* kern_mode :: See FT_Kerning_Mode() for more information. */
|
||||
/* Determines the scale/dimension of the returned */
|
||||
/* kerning vector. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* kerning :: The kerning vector. This is in font units for */
|
||||
@ -2057,16 +2059,17 @@
|
||||
/* kernings, are out of the scope of this API function -- they can be */
|
||||
/* implemented through format-specific interfaces. */
|
||||
/* */
|
||||
FT_EXPORT_FUNC(FT_Error) FT_Get_Kerning( FT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph,
|
||||
FT_UInt kern_mode,
|
||||
FT_Vector* kerning )
|
||||
FT_EXPORT_FUNC( FT_Error ) FT_Get_Kerning( FT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph,
|
||||
FT_UInt kern_mode,
|
||||
FT_Vector* kerning )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Driver driver;
|
||||
FT_Memory memory;
|
||||
|
||||
|
||||
if ( !face )
|
||||
return FT_Err_Invalid_Face_Handle;
|
||||
|
||||
@ -2083,17 +2086,17 @@
|
||||
right_glyph,
|
||||
kerning );
|
||||
}
|
||||
if (!error)
|
||||
if ( !error )
|
||||
{
|
||||
if (kern_mode != ft_kerning_unscaled)
|
||||
if ( kern_mode != ft_kerning_unscaled )
|
||||
{
|
||||
kerning->x = FT_MulFix( kerning->x, face->size->metrics.x_scale );
|
||||
kerning->y = FT_MulFix( kerning->y, face->size->metrics.y_scale );
|
||||
|
||||
if (kern_mode != ft_kerning_unfitted)
|
||||
if ( kern_mode != ft_kerning_unfitted )
|
||||
{
|
||||
kerning->x = (kerning->x+32) & -64;
|
||||
kerning->y = (kerning->y+32) & -64;
|
||||
kerning->x = ( kerning->x + 32 ) & -64;
|
||||
kerning->y = ( kerning->y + 32 ) & -64;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2617,9 +2620,9 @@
|
||||
/* slot :: A handle to the glyph slot containing the image to */
|
||||
/* convert. */
|
||||
/* */
|
||||
/* render_mode :: this is the render mode used to render the glyph */
|
||||
/* image into a bitmap. See FT_Render_Mode for a list */
|
||||
/* of possible values. */
|
||||
/* render_mode :: This is the render mode used to render the glyph */
|
||||
/* image into a bitmap. See FT_Render_Mode() for a */
|
||||
/* list of possible values. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
|
@ -815,6 +815,7 @@
|
||||
FT_Vector* vec = outline->points;
|
||||
FT_Vector* limit = vec + outline->n_points;
|
||||
|
||||
|
||||
for ( ; vec < limit; vec++ )
|
||||
FT_Vector_Transform( vec, matrix );
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <freetype/internal/ftstream.h>
|
||||
#include <freetype/ftoutln.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
@ -862,7 +863,7 @@
|
||||
if ( ip[0] != 12 || ip[1] != 17 )
|
||||
{
|
||||
FT_ERROR(( "CID_Parse_CharStrings:" ));
|
||||
FT_ERROR(( " 'pop' expected, found (%d %d)\n",
|
||||
FT_ERROR(( " `pop' expected, found (%d %d)\n",
|
||||
ip[0], ip[1] ));
|
||||
goto Syntax_Error;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
||||
/* memory :: The memory object used for memory operations */
|
||||
/* (allocation resp. reallocation). */
|
||||
/* */
|
||||
typedef struct CID_Table_
|
||||
typedef struct CID_Table_
|
||||
{
|
||||
FT_Byte* block; /* current memory block */
|
||||
FT_Int cursor; /* current cursor in memory block */
|
||||
@ -81,8 +81,8 @@
|
||||
|
||||
LOCAL_DEF
|
||||
FT_Error CID_New_Table( CID_Table* table,
|
||||
FT_Int count,
|
||||
CID_Memory memory );
|
||||
FT_Int count,
|
||||
CID_Memory memory );
|
||||
|
||||
LOCAL_DEF
|
||||
FT_Error CID_Add_Table( CID_Table* table,
|
||||
@ -168,22 +168,22 @@
|
||||
FT_Long CID_ToInt( CID_Parser* parser );
|
||||
|
||||
LOCAL_DEF
|
||||
FT_Int CID_ToCoordArray( CID_Parser* parser,
|
||||
FT_Int max_coords,
|
||||
FT_Short* coords );
|
||||
FT_Int CID_ToCoordArray( CID_Parser* parser,
|
||||
FT_Int max_coords,
|
||||
FT_Short* coords );
|
||||
|
||||
LOCAL_DEF
|
||||
FT_Int CID_ToFixedArray( CID_Parser* parser,
|
||||
FT_Int max_values,
|
||||
FT_Fixed* values,
|
||||
FT_Int power_ten );
|
||||
FT_Int CID_ToFixedArray( CID_Parser* parser,
|
||||
FT_Int max_values,
|
||||
FT_Fixed* values,
|
||||
FT_Int power_ten );
|
||||
|
||||
LOCAL_DEF
|
||||
void CID_Skip_Spaces( CID_Parser* parser );
|
||||
|
||||
|
||||
/* simple enumeration type used to identify token types */
|
||||
typedef enum CID_Token_Type_
|
||||
typedef enum CID_Token_Type_
|
||||
{
|
||||
t1_token_none = 0,
|
||||
t1_token_any,
|
||||
@ -197,7 +197,7 @@
|
||||
|
||||
|
||||
/* a simple structure used to identify tokens */
|
||||
typedef struct CID_Token_Rec_
|
||||
typedef struct CID_Token_Rec_
|
||||
{
|
||||
FT_Byte* start; /* first character of token in input stream */
|
||||
FT_Byte* limit; /* first character after the token */
|
||||
@ -207,12 +207,12 @@
|
||||
|
||||
|
||||
LOCAL_DEF
|
||||
void CID_ToToken( CID_Parser* parser,
|
||||
void CID_ToToken( CID_Parser* parser,
|
||||
CID_Token_Rec* token );
|
||||
|
||||
|
||||
/* enumeration type used to identify object fields */
|
||||
typedef enum CID_Field_Type_
|
||||
typedef enum CID_Field_Type_
|
||||
{
|
||||
t1_field_none = 0,
|
||||
t1_field_bool,
|
||||
@ -228,7 +228,7 @@
|
||||
|
||||
} CID_Field_Type;
|
||||
|
||||
typedef enum CID_Field_Location_
|
||||
typedef enum CID_Field_Location_
|
||||
{
|
||||
t1_field_cid_info,
|
||||
t1_field_font_dict,
|
||||
@ -245,7 +245,7 @@
|
||||
CID_Parser* parser );
|
||||
|
||||
/* structure type used to model object fields */
|
||||
typedef struct CID_Field_Rec_
|
||||
typedef struct CID_Field_Rec_
|
||||
{
|
||||
const char* ident; /* field identifier */
|
||||
CID_Field_Location location;
|
||||
@ -313,19 +313,19 @@
|
||||
|
||||
#define CID_FIELD_NUM_TABLE( _ident, _fname, _fmax ) \
|
||||
CID_NEW_TABLE_FIELD( _ident, t1_field_integer_array, \
|
||||
_fname, _fmax )
|
||||
_fname, _fmax )
|
||||
|
||||
#define CID_FIELD_FIXED_TABLE( _ident, _fname, _fmax ) \
|
||||
CID_NEW_TABLE_FIELD( _ident, t1_field_fixed_array, \
|
||||
_fname, _fmax )
|
||||
_fname, _fmax )
|
||||
|
||||
#define CID_FIELD_NUM_TABLE2( _ident, _fname, _fmax ) \
|
||||
CID_NEW_TABLE_FIELD2( _ident, t1_field_integer_array, \
|
||||
_fname, _fmax )
|
||||
_fname, _fmax )
|
||||
|
||||
#define CID_FIELD_FIXED_TABLE2( _ident, _fname, _fmax ) \
|
||||
CID_NEW_TABLE_FIELD2( _ident, t1_field_fixed_array, \
|
||||
_fname, _fmax )
|
||||
_fname, _fmax )
|
||||
|
||||
#define CID_FIELD_CALLBACK( _ident, _name ) \
|
||||
CID_NEW_CALLBACK_FIELD( _ident, parse_ ## _name )
|
||||
|
@ -47,7 +47,7 @@
|
||||
}
|
||||
|
||||
|
||||
#if 0 /* unimplemented for now.. */
|
||||
#if 0 /* unimplemented yet */
|
||||
|
||||
static
|
||||
FT_Error cid_Get_Kerning( T1_Face face,
|
||||
@ -174,7 +174,7 @@
|
||||
|
||||
const FT_Driver_Class t1cid_driver_class =
|
||||
{
|
||||
/* firs of all, the FT_Module_Class fields */
|
||||
/* first of all, the FT_Module_Class fields */
|
||||
{
|
||||
ft_module_font_driver | ft_module_driver_scalable,
|
||||
sizeof( FT_DriverRec ),
|
||||
@ -215,4 +215,35 @@
|
||||
};
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* getDriverClass */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This function is used when compiling the TrueType driver as a */
|
||||
/* shared library (`.DLL' or `.so'). It will be used by the */
|
||||
/* high-level library of FreeType to retrieve the address of the */
|
||||
/* driver's generic interface. */
|
||||
/* */
|
||||
/* It shouldn't be implemented in a static build, as each driver must */
|
||||
/* have the same function as an exported entry point. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The address of the TrueType's driver generic interface. The */
|
||||
/* format-specific interface can then be retrieved through the method */
|
||||
/* interface->get_format_interface. */
|
||||
/* */
|
||||
EXPORT_FUNC( FT_Driver_Class* ) getDriverClass( void )
|
||||
{
|
||||
return &t1cid_driver_class;
|
||||
}
|
||||
|
||||
|
||||
#endif /* CONFIG_OPTION_DYNAMIC_DRIVERS */
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -74,19 +74,19 @@
|
||||
#define T1TYPE T1_Private
|
||||
#define T1CODE t1_field_private
|
||||
|
||||
CID_FIELD_NUM ( "UniqueID", unique_id )
|
||||
CID_FIELD_NUM ( "lenIV", lenIV )
|
||||
CID_FIELD_NUM ( "LanguageGroup", language_group )
|
||||
CID_FIELD_NUM ( "password", password )
|
||||
CID_FIELD_NUM ( "UniqueID", unique_id )
|
||||
CID_FIELD_NUM ( "lenIV", lenIV )
|
||||
CID_FIELD_NUM ( "LanguageGroup", language_group )
|
||||
CID_FIELD_NUM ( "password", password )
|
||||
|
||||
CID_FIELD_FIXED ( "BlueScale", blue_scale )
|
||||
CID_FIELD_NUM ( "BlueShift", blue_shift )
|
||||
CID_FIELD_NUM ( "BlueFuzz", blue_fuzz )
|
||||
CID_FIELD_FIXED ( "BlueScale", blue_scale )
|
||||
CID_FIELD_NUM ( "BlueShift", blue_shift )
|
||||
CID_FIELD_NUM ( "BlueFuzz", blue_fuzz )
|
||||
|
||||
CID_FIELD_NUM_TABLE( "BlueValues", blue_values, 14 )
|
||||
CID_FIELD_NUM_TABLE( "OtherBlues", other_blues, 10 )
|
||||
CID_FIELD_NUM_TABLE( "FamilyBlues", family_blues, 14 )
|
||||
CID_FIELD_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10 )
|
||||
CID_FIELD_NUM_TABLE ( "BlueValues", blue_values, 14 )
|
||||
CID_FIELD_NUM_TABLE ( "OtherBlues", other_blues, 10 )
|
||||
CID_FIELD_NUM_TABLE ( "FamilyBlues", family_blues, 14 )
|
||||
CID_FIELD_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10 )
|
||||
|
||||
CID_FIELD_NUM_TABLE2( "StdHW", standard_width, 1 )
|
||||
CID_FIELD_NUM_TABLE2( "StdVW", standard_height, 1 )
|
||||
|
@ -31,10 +31,10 @@ CID_COMPILE := $(FT_COMPILE) $(CID_CFLAGS)
|
||||
|
||||
# CID driver sources (i.e., C files)
|
||||
#
|
||||
CID_DRV_SRC := $(CID_DIR_)cidparse.c \
|
||||
$(CID_DIR_)cidload.c \
|
||||
$(CID_DIR_)cidriver.c \
|
||||
$(CID_DIR_)cidgload.c \
|
||||
CID_DRV_SRC := $(CID_DIR_)cidparse.c \
|
||||
$(CID_DIR_)cidload.c \
|
||||
$(CID_DIR_)cidriver.c \
|
||||
$(CID_DIR_)cidgload.c \
|
||||
$(CID_DIR_)cidobjs.c
|
||||
|
||||
# CID driver headers
|
||||
|
@ -514,8 +514,8 @@ error:
|
||||
sizeof ( FT_DriverRec ),
|
||||
|
||||
"fond", /* driver name */
|
||||
100, /* driver version == 1.0 */
|
||||
200, /* driver requires FreeType 2.0 or above */
|
||||
0x10000L, /* driver version == 1.0 */
|
||||
0x20000L, /* driver requires FreeType 2.0 or above */
|
||||
|
||||
(void*)0,
|
||||
|
||||
|
@ -20,15 +20,15 @@
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
#include <psmodule.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h> /* for qsort() */
|
||||
#include <string.h> /* for strcmp(), strncpy() */
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES
|
||||
|
||||
|
||||
/* see the python script `freetype2/docs/glnames.py' which is used */
|
||||
/* to generate the following tables... */
|
||||
/* see the Python script `freetype2/docs/glnames.py' which is used */
|
||||
/* to generate the following file */
|
||||
#include <pstables.h>
|
||||
|
||||
|
||||
@ -53,7 +53,12 @@
|
||||
glyph_name[1] == 'n' &&
|
||||
glyph_name[2] == 'i' )
|
||||
{
|
||||
/* determine wether the following characters are hexadecimal */
|
||||
/* determine whether the next four characters following are */
|
||||
/* hexadecimal. */
|
||||
|
||||
/* XXX: Add code to deal with ligatures, i.e. glyph names like */
|
||||
/* `uniXXXXYYYYZZZZ'... */
|
||||
|
||||
FT_Int count;
|
||||
FT_ULong value = 0;
|
||||
const char* p = glyph_name + 4;
|
||||
@ -74,11 +79,13 @@
|
||||
else
|
||||
d += 10;
|
||||
}
|
||||
/* exit if a non-uppercase-hexadecimal character was found */
|
||||
|
||||
/* exit if a non-uppercase hexadecimal character was found */
|
||||
if ( d >= 16 )
|
||||
break;
|
||||
|
||||
value = ( value << 4 ) + d;
|
||||
|
||||
if ( count == 0 )
|
||||
return value;
|
||||
}
|
||||
@ -92,8 +99,10 @@
|
||||
|
||||
|
||||
p = glyph_name;
|
||||
|
||||
while ( *p && *p != '.' )
|
||||
p++;
|
||||
|
||||
len = p - glyph_name;
|
||||
|
||||
if ( *p && len < 64 )
|
||||
@ -104,7 +113,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* now, lookup the glyph in the Adobe Glyph List */
|
||||
/* now, look up the glyph in the Adobe Glyph List */
|
||||
for ( n = 0; n < NUM_ADOBE_GLYPHS; n++ )
|
||||
{
|
||||
const char* name = t1_standard_glyphs[n];
|
||||
@ -156,6 +165,7 @@
|
||||
|
||||
|
||||
map = table->maps;
|
||||
|
||||
for ( n = 0; n < num_glyphs; n++ )
|
||||
{
|
||||
const char* gname = glyph_names[n];
|
||||
@ -164,6 +174,7 @@
|
||||
if ( gname )
|
||||
{
|
||||
uni_char = PS_Unicode_Value( gname );
|
||||
|
||||
if ( uni_char && uni_char != 0xFFFF )
|
||||
{
|
||||
map->unicode = uni_char;
|
||||
@ -175,6 +186,7 @@
|
||||
|
||||
/* now, compress the table a bit */
|
||||
count = map - table->maps;
|
||||
|
||||
if ( count > 0 && REALLOC( table->maps,
|
||||
num_glyphs * sizeof ( PS_UniMap ),
|
||||
count * sizeof ( PS_UniMap ) ) )
|
||||
@ -205,6 +217,7 @@
|
||||
|
||||
|
||||
/* perform a binary search on the table */
|
||||
|
||||
min = table->maps;
|
||||
max = min + table->num_maps - 1;
|
||||
|
||||
@ -280,8 +293,8 @@
|
||||
sizeof( FT_ModuleRec ),
|
||||
|
||||
"psnames", /* driver name */
|
||||
100, /* driver version */
|
||||
200, /* driver requires FreeType 2 or above */
|
||||
0x10000L, /* driver version */
|
||||
0x20000L, /* driver requires FreeType 2 or above */
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES
|
||||
0,
|
||||
|
@ -1,2 +1,24 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* psnames.c */
|
||||
/* */
|
||||
/* FreeType PSNames module component (body only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#include <psmodule.c>
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -28,7 +28,8 @@
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A simple technical note on how the raster works: */
|
||||
/* A simple technical note on how the raster works */
|
||||
/* ----------------------------------------------- */
|
||||
/* */
|
||||
/* Converting an outline into a bitmap is achieved in several steps: */
|
||||
/* */
|
||||
@ -60,7 +61,7 @@
|
||||
/* */
|
||||
/* ^ ^ */
|
||||
/* | | */
|
||||
/* start of render pool top */
|
||||
/* start of render pool top */
|
||||
/* */
|
||||
/* The top of the profile stack is kept in the `top' variable. */
|
||||
/* */
|
||||
@ -84,7 +85,7 @@
|
||||
/* */
|
||||
/* ^ ^ */
|
||||
/* | | */
|
||||
/* maxBuff sizeBuff = end of pool */
|
||||
/* maxBuff sizeBuff = end of pool */
|
||||
/* */
|
||||
/* This list is later used during the sweep phase in order to */
|
||||
/* optimize performance (see technical note on the sweep below). */
|
||||
@ -176,7 +177,7 @@
|
||||
#define Raster_Err_Gray_Unsupported -5
|
||||
#define Raster_Err_Unsupported -6
|
||||
|
||||
/* FMulDiv means `Fast MulDiv', it is used in case where `b' is */
|
||||
/* FMulDiv means `Fast MulDiv'; it is used in case where `b' is */
|
||||
/* typically a small value and the result of a*b is known to fit into */
|
||||
/* 32 bits. */
|
||||
#define FMulDiv( a, b, c ) ( (a) * (b) / (c) )
|
||||
@ -303,6 +304,7 @@
|
||||
|
||||
#ifdef TT_STATIC_RASTER
|
||||
|
||||
|
||||
#define RAS_ARGS /* void */
|
||||
#define RAS_ARG /* void */
|
||||
|
||||
@ -311,8 +313,10 @@
|
||||
|
||||
#define UNUSED_RASTER do ; while ( 0 )
|
||||
|
||||
|
||||
#else /* TT_STATIC_RASTER */
|
||||
|
||||
|
||||
#define RAS_ARGS TRaster_Instance* raster,
|
||||
#define RAS_ARG TRaster_Instance* raster
|
||||
|
||||
@ -321,6 +325,7 @@
|
||||
|
||||
#define UNUSED_RASTER UNUSED( raster )
|
||||
|
||||
|
||||
#endif /* TT_STATIC_RASTER */
|
||||
|
||||
|
||||
@ -394,6 +399,7 @@
|
||||
PProfile fProfile; /* head of linked list of profiles */
|
||||
PProfile gProfile; /* contour's first profile in case */
|
||||
/* of impact */
|
||||
|
||||
TStates state; /* rendering state */
|
||||
|
||||
FT_Bitmap target; /* description of target bit/pixmap */
|
||||
@ -422,6 +428,7 @@
|
||||
/* Render_Glyph. Note that there is */
|
||||
/* no horizontal pass during gray */
|
||||
/* rendering. */
|
||||
|
||||
TPoint arcs[2 * MaxBezier + 1]; /* The Bezier stack */
|
||||
|
||||
TBand band_stack[16]; /* band stack used for sub-banding */
|
||||
@ -442,6 +449,7 @@
|
||||
/* graylevels pixmaps. */
|
||||
/* gray_lines is a buffer holding two */
|
||||
/* monochrome scanlines */
|
||||
|
||||
Short gray_width; /* width in bytes of one monochrome */
|
||||
/* intermediate scanline of gray_lines. */
|
||||
/* Each gray pixel takes 2 bits long there */
|
||||
@ -779,7 +787,7 @@
|
||||
static
|
||||
void Split_Conic( TPoint* base )
|
||||
{
|
||||
Long a, b;
|
||||
Long a, b;
|
||||
|
||||
|
||||
base[4].x = base[2].x;
|
||||
@ -794,8 +802,8 @@
|
||||
b = base[1].y = ( base[0].y + b ) / 2;
|
||||
base[2].y = ( a + b ) / 2;
|
||||
|
||||
/* hand optimized. gcc doesn't seem too good at common expression */
|
||||
/* substitution and instruction scheduling ;-) */
|
||||
/* hand optimized. gcc doesn't seem to be too good at common */
|
||||
/* expression substitution and instruction scheduling ;-) */
|
||||
}
|
||||
|
||||
|
||||
@ -867,9 +875,12 @@
|
||||
/* SUCCESS on success, FAILURE on render pool overflow. */
|
||||
/* */
|
||||
static
|
||||
Bool Line_Up( RAS_ARGS Long x1, Long y1,
|
||||
Long x2, Long y2,
|
||||
Long miny, Long maxy )
|
||||
Bool Line_Up( RAS_ARGS Long x1,
|
||||
Long y1,
|
||||
Long x2,
|
||||
Long y2,
|
||||
Long miny,
|
||||
Long maxy )
|
||||
{
|
||||
Long Dx, Dy;
|
||||
Int e1, e2, f1, f2, size; /* XXX: is `Short' sufficient? */
|
||||
@ -1003,9 +1014,12 @@
|
||||
/* SUCCESS on success, FAILURE on render pool overflow. */
|
||||
/* */
|
||||
static
|
||||
Bool Line_Down( RAS_ARGS Long x1, Long y1,
|
||||
Long x2, Long y2,
|
||||
Long miny, Long maxy )
|
||||
Bool Line_Down( RAS_ARGS Long x1,
|
||||
Long y1,
|
||||
Long x2,
|
||||
Long y2,
|
||||
Long miny,
|
||||
Long maxy )
|
||||
{
|
||||
Bool result, fresh;
|
||||
|
||||
@ -1275,8 +1289,8 @@
|
||||
switch ( ras.state )
|
||||
{
|
||||
case Ascending:
|
||||
if ( Line_Up ( RAS_VARS ras.lastX, ras.lastY,
|
||||
x, y, ras.minY, ras.maxY ) )
|
||||
if ( Line_Up( RAS_VARS ras.lastX, ras.lastY,
|
||||
x, y, ras.minY, ras.maxY ) )
|
||||
return FAILURE;
|
||||
break;
|
||||
|
||||
@ -1498,7 +1512,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
state_bez = y1 <= y4 ? Ascending : Descending;
|
||||
state_bez = ( y1 <= y4 ) ? Ascending : Descending;
|
||||
|
||||
/* detect a change of direction */
|
||||
if ( ras.state != state_bez )
|
||||
@ -1659,60 +1673,58 @@
|
||||
}
|
||||
|
||||
case FT_Curve_Tag_Conic: /* consume conic arcs */
|
||||
v_control.x = SCALED( point[0].x );
|
||||
v_control.y = SCALED( point[0].y );
|
||||
|
||||
if ( flipped )
|
||||
SWAP_( v_control.x, v_control.y );
|
||||
|
||||
Do_Conic:
|
||||
if ( point < limit )
|
||||
{
|
||||
v_control.x = SCALED( point[0].x );
|
||||
v_control.y = SCALED( point[0].y );
|
||||
FT_Vector v_middle;
|
||||
Long x, y;
|
||||
|
||||
|
||||
point++;
|
||||
tags++;
|
||||
tag = FT_CURVE_TAG( tags[0] );
|
||||
|
||||
x = SCALED( point[0].x );
|
||||
y = SCALED( point[0].y );
|
||||
|
||||
if ( flipped )
|
||||
SWAP_( v_control.x, v_control.y );
|
||||
SWAP_( x, y );
|
||||
|
||||
Do_Conic:
|
||||
if ( point < limit )
|
||||
if ( tag == FT_Curve_Tag_On )
|
||||
{
|
||||
FT_Vector v_middle;
|
||||
Long x, y;
|
||||
|
||||
|
||||
point++;
|
||||
tags++;
|
||||
tag = FT_CURVE_TAG( tags[0] );
|
||||
|
||||
x = SCALED( point[0].x );
|
||||
y = SCALED( point[0].y );
|
||||
|
||||
if ( flipped )
|
||||
SWAP_( x, y );
|
||||
|
||||
if ( tag == FT_Curve_Tag_On )
|
||||
{
|
||||
if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) )
|
||||
goto Fail;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( tag != FT_Curve_Tag_Conic )
|
||||
goto Invalid_Outline;
|
||||
|
||||
v_middle.x = ( v_control.x + x ) / 2;
|
||||
v_middle.y = ( v_control.y + y ) / 2;
|
||||
|
||||
if ( Conic_To( RAS_VARS v_control.x, v_control.y,
|
||||
v_middle.x, v_middle.y ) )
|
||||
if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) )
|
||||
goto Fail;
|
||||
|
||||
v_control.x = x;
|
||||
v_control.y = y;
|
||||
|
||||
goto Do_Conic;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( tag != FT_Curve_Tag_Conic )
|
||||
goto Invalid_Outline;
|
||||
|
||||
v_middle.x = ( v_control.x + x ) / 2;
|
||||
v_middle.y = ( v_control.y + y ) / 2;
|
||||
|
||||
if ( Conic_To( RAS_VARS v_control.x, v_control.y,
|
||||
v_start.x, v_start.y ) )
|
||||
v_middle.x, v_middle.y ) )
|
||||
goto Fail;
|
||||
|
||||
goto Close;
|
||||
v_control.x = x;
|
||||
v_control.y = y;
|
||||
|
||||
goto Do_Conic;
|
||||
}
|
||||
|
||||
if ( Conic_To( RAS_VARS v_control.x, v_control.y,
|
||||
v_start.x, v_start.y ) )
|
||||
goto Fail;
|
||||
|
||||
goto Close;
|
||||
|
||||
default: /* FT_Curve_Tag_Cubic */
|
||||
{
|
||||
Long x1, y1, x2, y2, x3, y3;
|
||||
@ -2005,8 +2017,8 @@
|
||||
/* */
|
||||
/* Vertical Sweep Procedure Set */
|
||||
/* */
|
||||
/* These four routines are used during the vertical black/white */
|
||||
/* sweep phase by the generic Draw_Sweep() function. */
|
||||
/* These four routines are used during the vertical black/white sweep */
|
||||
/* phase by the generic Draw_Sweep() function. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
@ -2057,14 +2069,16 @@
|
||||
|
||||
if ( e2 >= 0 && e1 < ras.bWidth )
|
||||
{
|
||||
if ( e1 < 0 ) e1 = 0;
|
||||
if ( e2 >= ras.bWidth ) e2 = ras.bWidth - 1;
|
||||
if ( e1 < 0 )
|
||||
e1 = 0;
|
||||
if ( e2 >= ras.bWidth )
|
||||
e2 = ras.bWidth - 1;
|
||||
|
||||
c1 = (Short)( e1 >> 3 );
|
||||
c2 = (Short)( e2 >> 3 );
|
||||
|
||||
f1 = (unsigned char)0xFF >> ( e1 & 7 );
|
||||
f2 = ~((unsigned char)0x7F >> ( e2 & 7 ));
|
||||
f1 = (unsigned char)0xFF >> ( e1 & 7 );
|
||||
f2 = ~( (unsigned char)0x7F >> ( e2 & 7 ) );
|
||||
|
||||
if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1;
|
||||
if ( ras.gray_max_x < c2 ) ras.gray_max_x = c2;
|
||||
@ -2447,6 +2461,7 @@
|
||||
Int last_bit = last_pixel & 3;
|
||||
Bool over = 0;
|
||||
|
||||
|
||||
if ( ras.gray_max_x >= last_cell && last_bit != 3 )
|
||||
{
|
||||
ras.gray_max_x = last_cell - 1;
|
||||
@ -2625,13 +2640,13 @@
|
||||
static
|
||||
Bool Draw_Sweep( RAS_ARG )
|
||||
{
|
||||
Short y, y_change, y_height;
|
||||
Short y, y_change, y_height;
|
||||
|
||||
PProfile P, Q, P_Left, P_Right;
|
||||
PProfile P, Q, P_Left, P_Right;
|
||||
|
||||
Short min_Y, max_Y, top, bottom, dropouts;
|
||||
Short min_Y, max_Y, top, bottom, dropouts;
|
||||
|
||||
Long x1, x2, xs, e1, e2;
|
||||
Long x1, x2, xs, e1, e2;
|
||||
|
||||
TProfileList wait;
|
||||
TProfileList draw_left, draw_right;
|
||||
@ -2647,8 +2662,8 @@
|
||||
/* first, compute min and max Y */
|
||||
|
||||
P = ras.fProfile;
|
||||
max_Y = (short)TRUNC( ras.minY );
|
||||
min_Y = (short)TRUNC( ras.maxY );
|
||||
max_Y = (Short)TRUNC( ras.minY );
|
||||
min_Y = (Short)TRUNC( ras.maxY );
|
||||
|
||||
while ( P )
|
||||
{
|
||||
@ -2783,9 +2798,9 @@
|
||||
P_Right = P_Right->link;
|
||||
}
|
||||
|
||||
/* now perform the dropouts _after_ the span drawing */
|
||||
/* drop-outs processing has been moved out of the loop */
|
||||
/* for performance tuning */
|
||||
/* now perform the dropouts _after_ the span drawing -- */
|
||||
/* drop-outs processing has been moved out of the loop */
|
||||
/* for performance tuning */
|
||||
if ( dropouts > 0 )
|
||||
goto Scan_DropOuts;
|
||||
|
||||
@ -3032,7 +3047,6 @@
|
||||
ras.dropOutControl = 2;
|
||||
ras.second_pass = !( ras.outline.flags & ft_outline_single_pass );
|
||||
|
||||
|
||||
/* Vertical Sweep */
|
||||
|
||||
ras.band_top = 0;
|
||||
@ -3055,7 +3069,7 @@
|
||||
ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step;
|
||||
|
||||
error = Render_Single_Pass( RAS_VARS 0 );
|
||||
if (error)
|
||||
if ( error )
|
||||
return error;
|
||||
|
||||
/* Horizontal Sweep */
|
||||
@ -3071,7 +3085,7 @@
|
||||
ras.band_stack[0].y_max = ras.target.width * 2 - 1;
|
||||
|
||||
error = Render_Single_Pass( RAS_VARS 1 );
|
||||
if (error)
|
||||
if ( error )
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -3084,10 +3098,11 @@
|
||||
FT_Error Render_Gray_Glyph( RAS_ARG )
|
||||
{
|
||||
UNUSED_RASTER;
|
||||
|
||||
return FT_Err_Cannot_Render_Glyph;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* FT_RASTER_OPTION_ANTI_ALIASING */
|
||||
|
||||
|
||||
static
|
||||
@ -3096,6 +3111,7 @@
|
||||
FT_UInt n;
|
||||
FT_ULong c;
|
||||
|
||||
|
||||
/* setup count table */
|
||||
for ( n = 0; n < 256; n++ )
|
||||
{
|
||||
@ -3110,23 +3126,27 @@
|
||||
}
|
||||
|
||||
#ifdef FT_RASTER_OPTION_ANTI_ALIASING
|
||||
|
||||
/* set default 5-levels gray palette */
|
||||
for ( n = 0; n < 5; n++ )
|
||||
raster->grays[n] = n * 255 / 4;
|
||||
|
||||
raster->gray_width = RASTER_GRAY_LINES / 2;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/
|
||||
/**** a static object. *****/
|
||||
|
||||
|
||||
#ifdef _STANDALONE_
|
||||
|
||||
|
||||
static
|
||||
int ft_black_new( void* memory,
|
||||
FT_Raster *araster )
|
||||
int ft_black_new( void* memory,
|
||||
FT_Raster *araster )
|
||||
{
|
||||
static FT_RasterRec_ the_raster;
|
||||
|
||||
@ -3183,9 +3203,9 @@
|
||||
|
||||
|
||||
static
|
||||
void ft_black_reset( TRaster_Instance* raster,
|
||||
const char* pool_base,
|
||||
long pool_size )
|
||||
void ft_black_reset( TRaster_Instance* raster,
|
||||
const char* pool_base,
|
||||
long pool_size )
|
||||
{
|
||||
if ( raster && pool_base && pool_size >= 4096 )
|
||||
{
|
||||
@ -3202,6 +3222,7 @@
|
||||
const char* palette )
|
||||
{
|
||||
#ifdef FT_RASTER_OPTION_ANTI_ALIASING
|
||||
|
||||
if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) )
|
||||
{
|
||||
/* set 5-levels gray palette */
|
||||
@ -3211,10 +3232,13 @@
|
||||
raster->grays[3] = palette[3];
|
||||
raster->grays[4] = palette[4];
|
||||
}
|
||||
|
||||
#else
|
||||
UNUSED(raster);
|
||||
UNUSED(mode);
|
||||
UNUSED(palette);
|
||||
|
||||
UNUSED( raster );
|
||||
UNUSED( mode );
|
||||
UNUSED( palette );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3250,7 +3274,7 @@
|
||||
ras.outline = *outline;
|
||||
ras.target = *target_map;
|
||||
|
||||
return ( params->flags & ft_raster_flag_aa
|
||||
return ( ( params->flags & ft_raster_flag_aa )
|
||||
? Render_Gray_Glyph( raster )
|
||||
: Render_Glyph( raster ) );
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <freetype/ftimage.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Uncomment the following line if you are using ftraster.c as a */
|
||||
@ -33,15 +34,16 @@
|
||||
/* #define _STANDALONE_ */
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
#define FT_EXPORT_VAR(x) extern x
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
FT_EXPORT_VAR(FT_Raster_Funcs) ft_standard_raster;
|
||||
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_standard_raster;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FTRASTER_H */
|
||||
|
||||
|
||||
|
@ -1,72 +1,101 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftrend1.c */
|
||||
/* */
|
||||
/* The FreeType glyph rasterizer interface (body). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
#include <freetype/ftoutln.h>
|
||||
#include <raster1.h>
|
||||
#include <ftrend1.h>
|
||||
#include <ftraster.h>
|
||||
|
||||
/* initialise renderer - init its raster */
|
||||
static FT_Error ft_raster1_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;
|
||||
/* initialize renderer -- init its raster */
|
||||
static
|
||||
FT_Error ft_raster1_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 FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* sets render-specific mode */
|
||||
static FT_Error ft_raster1_set_mode( FT_Renderer render,
|
||||
FT_ULong mode_tag,
|
||||
FT_Pointer data )
|
||||
/* 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 );
|
||||
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,
|
||||
FT_Matrix* matrix,
|
||||
FT_Vector* delta )
|
||||
|
||||
/* transform a given glyph image */
|
||||
static
|
||||
FT_Error ft_raster1_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)
|
||||
|
||||
if ( slot->format != render->glyph_format )
|
||||
{
|
||||
error = FT_Err_Invalid_Argument;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (matrix)
|
||||
if ( matrix )
|
||||
FT_Outline_Transform( &slot->outline, matrix );
|
||||
|
||||
if (delta)
|
||||
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 )
|
||||
{
|
||||
MEM_Set( cbox, 0, sizeof(*cbox) );
|
||||
|
||||
if (slot->format == render->glyph_format)
|
||||
/* return the glyph's control box */
|
||||
static
|
||||
void ft_raster1_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_raster1_render( FT_Renderer render,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
FT_Vector* origin )
|
||||
/* convert a slot's glyph image into a bitmap */
|
||||
static
|
||||
FT_Error ft_raster1_render( FT_Renderer render,
|
||||
FT_GlyphSlot slot,
|
||||
FT_UInt mode,
|
||||
FT_Vector* origin )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Outline* outline;
|
||||
@ -77,8 +106,9 @@
|
||||
|
||||
FT_Raster_Params params;
|
||||
|
||||
|
||||
/* check glyph image format */
|
||||
if (slot->format != render->glyph_format)
|
||||
if ( slot->format != render->glyph_format )
|
||||
{
|
||||
error = FT_Err_Invalid_Argument;
|
||||
goto Exit;
|
||||
@ -88,20 +118,20 @@
|
||||
if ( mode != ft_render_mode_mono )
|
||||
{
|
||||
/* raster1 is only capable of producing monochrome bitmaps */
|
||||
if (render->clazz == &ft_raster1_renderer_class)
|
||||
if ( render->clazz == &ft_raster1_renderer_class )
|
||||
return FT_Err_Cannot_Render_Glyph;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* raster5 is only capable of producing 5-gray-levels bitmaps */
|
||||
if (render->clazz == &ft_raster5_renderer_class)
|
||||
if ( render->clazz == &ft_raster5_renderer_class )
|
||||
return FT_Err_Cannot_Render_Glyph;
|
||||
}
|
||||
|
||||
outline = &slot->outline;
|
||||
|
||||
/* translate the outline to the new origin if needed */
|
||||
if (origin)
|
||||
if ( origin )
|
||||
FT_Outline_Translate( outline, origin->x, origin->y );
|
||||
|
||||
/* compute the control box, and grid fit it */
|
||||
@ -109,32 +139,32 @@
|
||||
|
||||
cbox.xMin &= -64;
|
||||
cbox.yMin &= -64;
|
||||
cbox.xMax = (cbox.xMax+63) & -64;
|
||||
cbox.yMax = (cbox.yMax+63) & -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;
|
||||
width = ( cbox.xMax - cbox.xMin ) >> 6;
|
||||
height = ( cbox.yMax - cbox.yMin ) >> 6;
|
||||
bitmap = &slot->bitmap;
|
||||
memory = render->root.memory;
|
||||
|
||||
/* release old bitmap buffer */
|
||||
if ((slot->flags & ft_glyph_own_bitmap))
|
||||
if ( slot->flags & ft_glyph_own_bitmap )
|
||||
{
|
||||
FREE(bitmap->buffer);
|
||||
FREE( bitmap->buffer );
|
||||
slot->flags &= ~ft_glyph_own_bitmap;
|
||||
}
|
||||
|
||||
/* allocate new one, depends on pixel format */
|
||||
if (!(mode & ft_render_mode_mono))
|
||||
if ( !( mode & ft_render_mode_mono ) )
|
||||
{
|
||||
/* we pad to 32 bits, only for backwards compatibility with FT 1.x */
|
||||
pitch = (width+3) & -4;
|
||||
pitch = ( width + 3 ) & -4;
|
||||
bitmap->pixel_mode = ft_pixel_mode_grays;
|
||||
bitmap->num_grays = 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
pitch = (width+7) >> 3;
|
||||
pitch = ( width + 7 ) >> 3;
|
||||
bitmap->pixel_mode = ft_pixel_mode_mono;
|
||||
}
|
||||
|
||||
@ -142,7 +172,7 @@
|
||||
bitmap->rows = height;
|
||||
bitmap->pitch = pitch;
|
||||
|
||||
if (ALLOC( bitmap->buffer, (FT_ULong)pitch * height ))
|
||||
if ( ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
|
||||
goto Exit;
|
||||
|
||||
slot->flags |= ft_glyph_own_bitmap;
|
||||
@ -160,7 +190,8 @@
|
||||
|
||||
/* render outline into the bitmap */
|
||||
error = render->raster_render( render->raster, ¶ms );
|
||||
if (error) goto Exit;
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
slot->format = ft_glyph_format_bitmap;
|
||||
slot->bitmap_left = cbox.xMin >> 6;
|
||||
@ -171,37 +202,37 @@
|
||||
}
|
||||
|
||||
|
||||
const FT_Renderer_Class ft_raster1_renderer_class =
|
||||
const FT_Renderer_Class ft_raster1_renderer_class =
|
||||
{
|
||||
{
|
||||
ft_module_renderer,
|
||||
sizeof( FT_RendererRec ),
|
||||
|
||||
"raster1",
|
||||
0x10000,
|
||||
0x20000,
|
||||
0x10000L,
|
||||
0x20000L,
|
||||
|
||||
0, /* module specific interface */
|
||||
|
||||
(FT_Module_Constructor) ft_raster1_init,
|
||||
(FT_Module_Destructor) 0,
|
||||
(FT_Module_Requester) 0
|
||||
(FT_Module_Constructor)ft_raster1_init,
|
||||
(FT_Module_Destructor) 0,
|
||||
(FT_Module_Requester) 0
|
||||
},
|
||||
|
||||
ft_glyph_format_outline,
|
||||
|
||||
(FTRenderer_render) ft_raster1_render,
|
||||
(FTRenderer_transform) ft_raster1_transform,
|
||||
(FTRenderer_getCBox) ft_raster1_get_cbox,
|
||||
(FTRenderer_setMode) ft_raster1_set_mode,
|
||||
(FTRenderer_render) ft_raster1_render,
|
||||
(FTRenderer_transform)ft_raster1_transform,
|
||||
(FTRenderer_getCBox) ft_raster1_get_cbox,
|
||||
(FTRenderer_setMode) ft_raster1_set_mode,
|
||||
|
||||
(FT_Raster_Funcs*) &ft_standard_raster
|
||||
(FT_Raster_Funcs*) &ft_standard_raster
|
||||
};
|
||||
|
||||
|
||||
/* this renderer is _NOT_ part of the default modules, you'll need */
|
||||
/* to register it by hand in your application. It should only be */
|
||||
/* used for backwards-compatibility with FT 1.x anyway.. */
|
||||
/* this renderer is _NOT_ part of the default modules, you'll need */
|
||||
/* to register it by hand in your application. It should only be */
|
||||
/* used for backwards-compatibility with FT 1.x anyway. */
|
||||
const FT_Renderer_Class ft_raster5_renderer_class =
|
||||
{
|
||||
{
|
||||
@ -209,24 +240,25 @@
|
||||
sizeof( FT_RendererRec ),
|
||||
|
||||
"raster5",
|
||||
0x10000,
|
||||
0x20000,
|
||||
0x10000L,
|
||||
0x20000L,
|
||||
|
||||
0, /* module specific interface */
|
||||
|
||||
(FT_Module_Constructor) ft_raster1_init,
|
||||
(FT_Module_Destructor) 0,
|
||||
(FT_Module_Requester) 0
|
||||
(FT_Module_Constructor)ft_raster1_init,
|
||||
(FT_Module_Destructor) 0,
|
||||
(FT_Module_Requester) 0
|
||||
},
|
||||
|
||||
ft_glyph_format_outline,
|
||||
|
||||
(FTRenderer_render) ft_raster1_render,
|
||||
(FTRenderer_transform) ft_raster1_transform,
|
||||
(FTRenderer_getCBox) ft_raster1_get_cbox,
|
||||
(FTRenderer_setMode) ft_raster1_set_mode,
|
||||
(FTRenderer_render) ft_raster1_render,
|
||||
(FTRenderer_transform)ft_raster1_transform,
|
||||
(FTRenderer_getCBox) ft_raster1_get_cbox,
|
||||
(FTRenderer_setMode) ft_raster1_set_mode,
|
||||
|
||||
(FT_Raster_Funcs*) &ft_standard_raster
|
||||
(FT_Raster_Funcs*) &ft_standard_raster
|
||||
};
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -1,14 +1,37 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftrend1.h */
|
||||
/* */
|
||||
/* The FreeType glyph rasterizer interface (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 FTREND1_H
|
||||
#define FTREND1_H
|
||||
|
||||
#include <freetype/ftrender.h>
|
||||
|
||||
FT_EXPORT_VAR(const FT_Renderer_Class) ft_raster1_renderer_class;
|
||||
|
||||
/* this renderer is _NOT_ part of the default modules, you'll need */
|
||||
/* to register it by hand in your application. It should only be */
|
||||
/* used for backwards-compatibility with FT 1.x anyway.. */
|
||||
/* */
|
||||
FT_EXPORT_VAR(const FT_Renderer_Class) ft_raster5_renderer_class;
|
||||
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster1_renderer_class;
|
||||
|
||||
/* this renderer is _NOT_ part of the default modules, you'll need */
|
||||
/* to register it by hand in your application. It should only be */
|
||||
/* used for backwards-compatibility with FT 1.x anyway. */
|
||||
/* */
|
||||
FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster5_renderer_class;
|
||||
|
||||
|
||||
#endif /* FTREND1_H */
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -1,4 +1,25 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* raster1.c */
|
||||
/* */
|
||||
/* FreeType monochrome rasterer module component (body only). */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#define FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#include <ftraster.c>
|
||||
#include <ftrend1.c>
|
||||
|
||||
|
||||
/* END */
|
||||
|
@ -13,33 +13,34 @@
|
||||
# fully.
|
||||
|
||||
|
||||
# renderer driver directory
|
||||
# raster1 driver directory
|
||||
#
|
||||
RAS1_DIR := $(SRC_)raster1
|
||||
RAS1_DIR_ := $(RAS1_DIR)$(SEP)
|
||||
|
||||
|
||||
# additional include flags used when compiling the driver
|
||||
#
|
||||
RAS1_INCLUDE := $(RAS1_DIR)
|
||||
|
||||
|
||||
# compilation flags for the driver
|
||||
#
|
||||
RAS1_CFLAGS := $(RAS1_INCLUDE:%=$I%)
|
||||
RAS1_COMPILE := $(FT_COMPILE) $(RAS1_CFLAGS)
|
||||
|
||||
|
||||
# RASTER1 driver sources (i.e., C files)
|
||||
# raster1 driver sources (i.e., C files)
|
||||
#
|
||||
RAS1_DRV_SRC := $(RAS1_DIR_)ftraster.c \
|
||||
RAS1_DRV_SRC := $(RAS1_DIR_)ftraster.c \
|
||||
$(RAS1_DIR_)ftrend1.c
|
||||
|
||||
# RASTER1 driver headers
|
||||
|
||||
# raster1 driver headers
|
||||
#
|
||||
RAS1_DRV_H := $(RAS1_DRV_SRC:%c=%h)
|
||||
RAS1_DRV_H := $(RAS1_DRV_SRC:%.c=%.h)
|
||||
|
||||
|
||||
# RASTER1 driver object(s)
|
||||
# raster1 driver object(s)
|
||||
#
|
||||
# RAS1_DRV_OBJ_M is used during `multi' builds.
|
||||
# RAS1_DRV_OBJ_S is used during `single' builds.
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <ttcmap.h>
|
||||
#include <sfobjs.h>
|
||||
|
||||
#include <string.h> /* for strcmp() */
|
||||
|
||||
|
||||
static
|
||||
void* get_sfnt_table( TT_Face face,
|
||||
@ -84,7 +86,8 @@
|
||||
}
|
||||
|
||||
|
||||
static const SFNT_Interface sfnt_interface =
|
||||
static
|
||||
const SFNT_Interface sfnt_interface =
|
||||
{
|
||||
TT_Goto_Table,
|
||||
|
||||
@ -115,23 +118,31 @@
|
||||
TT_Load_PCLT,
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
|
||||
/* see `ttsbit.h' */
|
||||
TT_Load_SBit_Strikes,
|
||||
TT_Load_SBit_Image,
|
||||
TT_Free_SBit_Strikes,
|
||||
|
||||
#else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
||||
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name,
|
||||
TT_Free_Post_Names,
|
||||
|
||||
#else /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
||||
|
||||
0,
|
||||
0,
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
||||
|
||||
/* see `ttcmap.h' */
|
||||
@ -140,7 +151,8 @@
|
||||
};
|
||||
|
||||
|
||||
const FT_Module_Class sfnt_module_class =
|
||||
const
|
||||
FT_Module_Class sfnt_module_class =
|
||||
{
|
||||
0, /* not a font driver or renderer */
|
||||
sizeof( FT_ModuleRec ),
|
||||
|
@ -64,7 +64,7 @@
|
||||
{
|
||||
if ( rec->nameID == nameid )
|
||||
{
|
||||
/* found the name - now create an ASCII string from it */
|
||||
/* found the name -- now create an ASCII string from it */
|
||||
FT_Bool found = 0;
|
||||
|
||||
|
||||
@ -136,7 +136,8 @@
|
||||
|
||||
} TEncoding;
|
||||
|
||||
static const TEncoding tt_encodings[] =
|
||||
static
|
||||
const TEncoding tt_encodings[] =
|
||||
{
|
||||
{ TT_PLATFORM_ISO, -1, ft_encoding_unicode },
|
||||
|
||||
@ -231,7 +232,8 @@
|
||||
|
||||
|
||||
#undef LOAD_
|
||||
#define LOAD_( x ) ( (error = sfnt->load_##x( face, stream )) != TT_Err_Ok )
|
||||
#define LOAD_( x ) ( ( error = sfnt->load_##x( face, stream ) ) \
|
||||
!= TT_Err_Ok )
|
||||
|
||||
|
||||
LOCAL_FUNC
|
||||
@ -382,6 +384,7 @@
|
||||
}
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
|
||||
if ( face->num_sbit_strikes )
|
||||
{
|
||||
face->root.num_fixed_sizes = face->num_sbit_strikes;
|
||||
@ -399,11 +402,14 @@
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
#else /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
||||
|
||||
{
|
||||
root->num_fixed_sizes = 0;
|
||||
root->available_sizes = 0;
|
||||
}
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
||||
|
||||
/*********************************************************************/
|
||||
@ -442,8 +448,8 @@
|
||||
root->underline_position = face->postscript.underlinePosition;
|
||||
root->underline_thickness = face->postscript.underlineThickness;
|
||||
|
||||
/* root->max_points - already set up */
|
||||
/* root->max_contours - already set up */
|
||||
/* root->max_points -- already set up */
|
||||
/* root->max_contours -- already set up */
|
||||
}
|
||||
|
||||
Exit:
|
||||
@ -485,7 +491,7 @@
|
||||
face->num_tables = 0;
|
||||
|
||||
/* freeing the character mapping tables */
|
||||
if (sfnt && sfnt->load_charmaps )
|
||||
if ( sfnt && sfnt->load_charmaps )
|
||||
{
|
||||
FT_UShort n;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user