* devel/ftoption.h: Synchronize with

include/freetype/config/ftoption.h.

* src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
variable declaration.
(gray_convert_glyph): Fix compiler warnings.

Formatting, copyright years.
This commit is contained in:
Werner Lemberg 2006-09-03 06:18:45 +00:00
parent bd50295ca4
commit 2d8629b393
9 changed files with 146 additions and 89 deletions

View File

@ -1,11 +1,38 @@
2006-09-03 Werner Lemberg <wl@gnu.org>
* devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.
* src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
variable declaration.
(gray_convert_glyph): Fix compiler warnings.
2006-09-01 David Turner <david@freetype.org> 2006-09-01 David Turner <david@freetype.org>
* src/truetype/ttobjs.c: updated the TrueType loader to recognize * src/truetype/ttobjs.c (tt_face_init): Update the TrueType loader
a few fonts that require the automatic unpatented loader to recognize a few fonts that require the automatic unpatented
loader.
* src/smooth/ftgrays.c: optmized the performance of the anti-aliased * src/smooth/ftgrays.c: Optmize the performance of the anti-aliased
rasterizer. The speed gains is between 15% and 25%, depending on rasterizer. The speed improvement is between 15% and 25%, depending
content on the font data.
(GRAYS_USE_GAMMA, GRAYS_COMPACT): Removed, and all associated code.
(TCell): Redefine.
(TRaster): New members `buffer', `buffer_size', `ycells', `ycount'.
(gray_init_cells): Updated.
(gray_find_cell, gray_alloc_cell): New functions.
(gray_record_cell): Rewritten to use `gray_find_cell' and
`gray_alloc_cell'.
(PACK, LESS_THAN, SWAP_CELLS, DEBUG_SORT, QUICK_SORT, SHELL_SORT,
QSORT_THRESHOLD):
Removed.
(gray_shell_sort, gray_quick_sort, gray_check_sort,
gray_dump_cells): Removed.
(gray_sweep): Rewritten.
(gray_convert_glyph): Rewrite code which used one of the sorting
functions.
(gray_raster_render): Updated.
2006-08-29 Dr. Werner Fink <werner@suse.de> 2006-08-29 Dr. Werner Fink <werner@suse.de>
@ -14,28 +41,45 @@
2006-08-27 David Turner <david@freetype.org> 2006-08-27 David Turner <david@freetype.org>
<TO BE WRITTEN> * include/freetype/config/ftoption.h (TT_USE_BYTECODE_INTERPRETER):
New macro, defined if either TT_CONFIG_OPTION_BYTECODE_INTERPRETER
or TT_CONFIG_OPTION_UNPATENTED_HINTING is defined.
* include/freetype/internal/ftcalc.h, src/base/ftcalc.c,
src/truetype/truetype.c, src/truetype/ttdriver.c,
src/truetype/ttgload.c, src/truetype/ttgload.h,
src/truetype/ttinterp.c, src/truetype/ttobjs.c,
src/truetype/ttobjs.h, src/truetype/ttpload.c, src/type42/t42drivr.c:
s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
member `force_autohint'.
* src/base/ftobjs.c (FT_Load_Glyph): Use `force_autohint'.
* src/truetype/ttobjs.c (tt_face_init): Prepare code for testing
against a list of font names which need the bytecode interpreter.
2006-08-27 Jens Claudius <jens.claudius@yahoo.com> 2006-08-27 Jens Claudius <jens.claudius@yahoo.com>
Fix miscellaneous compiler warnings. Fix miscellaneous compiler warnings.
* freetype2/include/freetype/internal/ftobjs.h: close * freetype2/include/freetype/internal/ftobjs.h: Close comment with
comment with `*/' to avoid `/* in comment' compiler warning. `*/' to avoid `/* in comment' compiler warning.
* freetype2/src/base/ftdbgmem.c (ft_mem_table_get_source): Turn * freetype2/src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast
cast `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on
since on 64-bit platforms void* is larger than FT_UInt32. 64-bit platforms void* is larger than FT_UInt32.
* freetype2/src/base/ftobjs.c (t_validator_error): cast * freetype2/src/base/ftobjs.c (t_validator_error): Cast away
away volatileness of argument to ft_longjmp. Spotted by volatileness of argument to ft_longjmp. Spotted by Werner
Werner `Putzfrau' Lemberg. `Putzfrau' Lemberg.
* freetype2/src/bdf/bdflib.c (bdf_load_font): initialize * freetype2/src/bdf/bdflib.c (bdf_load_font): Initialize local
local variable `lineno'. variable `lineno'.
* freetype2/src/gxvalid/gxvmod.c (classic_kern_validate): * freetype2/src/gxvalid/gxvmod.c (classic_kern_validate): Mark local
mark local variable `error' volatile. variable `error' as volatile.
2006-08-27 Werner Lemberg <wl@gnu.org> 2006-08-27 Werner Lemberg <wl@gnu.org>
@ -1248,10 +1292,10 @@
(FTC_CMapCache_Lookup) [FT_CONFIG_OPTION_OLD_INTERNALS]: New (FTC_CMapCache_Lookup) [FT_CONFIG_OPTION_OLD_INTERNALS]: New
compatibility code. compatibility code.
* src/cache/ftcbasic.c: fixed a silly bug that prevented our super-duper * src/cache/ftcbasic.c: Fix a silly bug that prevented our `hack' to
"hack" to support rogue clients compiled against 2.1.7 to work correctly. support rogue clients compiled against 2.1.7 to work correctly.
Probably explains the GNUstep crashes with the second release This probably explains the GNUstep crashes with the second release
candidate. candidate.
2006-02-23 Chia-I Wu <b90201047@ntu.edu.tw> 2006-02-23 Chia-I Wu <b90201047@ntu.edu.tw>

View File

@ -471,7 +471,7 @@ FT_BEGIN_HEADER
/* component offsets in composite glyphs. */ /* component offsets in composite glyphs. */
/* */ /* */
/* Apple and MS disagree on the default behavior of component offsets */ /* Apple and MS disagree on the default behavior of component offsets */
/* in composites. Apple says that they should be scaled by the scale */ /* in composites. Apple says that they should be scaled by the scaling */
/* factors in the transformation matrix (roughly, it's more complex) */ /* factors in the transformation matrix (roughly, it's more complex) */
/* while MS says they should not. OpenType defines two bits in the */ /* while MS says they should not. OpenType defines two bits in the */
/* composite flags array which can be used to disambiguate, but old */ /* composite flags array which can be used to disambiguate, but old */
@ -594,6 +594,16 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_OLD_INTERNALS #undef FT_CONFIG_OPTION_OLD_INTERNALS
/*
* This variable is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#endif
FT_END_HEADER FT_END_HEADER

View File

@ -572,7 +572,7 @@ FT_BEGIN_HEADER
#define AF_CONFIG_OPTION_CJK #define AF_CONFIG_OPTION_CJK
/* */ /* */
/* /*
* This temporary macro is used to control various optimizations for * This temporary macro is used to control various optimizations for
@ -594,14 +594,14 @@ FT_BEGIN_HEADER
#define FT_CONFIG_OPTION_OLD_INTERNALS #define FT_CONFIG_OPTION_OLD_INTERNALS
/* /*
* this variable is defined if either unpatented or native TrueType * This variable is defined if either unpatented or native TrueType
* hinting is requested by the definitions above. * hinting is requested by the definitions above.
*/ */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
# define TT_USE_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING #elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
# define TT_USE_BYTECODE_INTERPRETER #define TT_USE_BYTECODE_INTERPRETER
#endif #endif
FT_END_HEADER FT_END_HEADER

View File

@ -212,25 +212,25 @@ FT_BEGIN_HEADER
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
/* */ /* */
/* force_autohing :: */ /* force_autohing :: */
/* this boolean flag is used to instruct the glyph loader to */ /* This boolean flag instructs the glyph loader to ignore the */
/* ignore the format-specific hinter, and use the auto-hinter */ /* format-specific hinter, and to use the auto-hinter instead to */
/* instead to load all glyphs. */ /* load all glyphs. */
/* */ /* */
/* if the unpatented bytecode interpreter was compiled withing */ /* If the unpatented bytecode interpreter is compiled into the */
/* the library then: */ /* library, then: */
/* */ /* */
/* - if this is one of the tricky Asian fonts, like Gulim, which */ /* - if this is one of the tricky Asian fonts, like Gulim, which */
/* absolutely require a bytecode interpreter to load anything */ /* absolutely require a bytecode interpreter to load anything */
/* properly, the flag will be set to FALSE */ /* properly, the flag is set to FALSE */
/* */ /* */
/* - for other fonts, the flag will be set to TRUE, and the */ /* - for other fonts, the flag is set to TRUE, and the auto-hinter */
/* auto-hinter will be used to scale the glyphs. */ /* is used to scale the glyphs. */
/* */ /* */
/* if the unpatented bytecode interpretr was *not* compiled */ /* If the unpatented bytecode interpreter is not compiled into */
/* within the librayr, the flag will always be FALSE */ /* the library, the flag is always set to FALSE. */
/* */ /* */
/* the detection of "tricky" fonts is located in the TrueType */ /* The detection of `tricky' fonts is located in the TrueType */
/* face loader. */ /* face loader, testing against a bunch of font names. */
/* */ /* */
typedef struct FT_Face_InternalRec_ typedef struct FT_Face_InternalRec_
{ {
@ -644,8 +644,8 @@ FT_BEGIN_HEADER
/* Set this debug hook to a non-null pointer to force unpatented hinting */ /* Set this debug hook to a non-null pointer to force unpatented hinting */
/* for all faces when both TT_USE_BYTECODE_INTERPRETER and */ /* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used */ /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
/* during debugging. */ /* during debugging. */
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1 #define FT_DEBUG_HOOK_UNPATENTED_HINTING 1

View File

@ -133,10 +133,8 @@
#define FT_TRACE( x ) do ; while ( 0 ) /* nothing */ #define FT_TRACE( x ) do ; while ( 0 ) /* nothing */
#endif #endif
#else /* _STANDALONE_ */ #else /* _STANDALONE_ */
#include <ft2build.h> #include <ft2build.h>
#include "ftgrays.h" #include "ftgrays.h"
#include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_OBJECTS_H
@ -148,7 +146,6 @@
#define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph #define ErrRaster_Invalid_Mode Smooth_Err_Cannot_Render_Glyph
#define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline #define ErrRaster_Invalid_Outline Smooth_Err_Invalid_Outline
#endif /* _STANDALONE_ */ #endif /* _STANDALONE_ */
@ -326,13 +323,13 @@ typedef struct TCell_
ras.buffer = buffer; ras.buffer = buffer;
ras.buffer_size = byte_size; ras.buffer_size = byte_size;
ras.ycells = (PCell*) buffer; ras.ycells = (PCell*) buffer;
ras.cells = NULL; ras.cells = NULL;
ras.max_cells = 0; ras.max_cells = 0;
ras.num_cells = 0; ras.num_cells = 0;
ras.area = 0; ras.area = 0;
ras.cover = 0; ras.cover = 0;
ras.invalid = 1; ras.invalid = 1;
} }
@ -385,11 +382,12 @@ typedef struct TCell_
/* Record the current cell in the table. */ /* Record the current cell in the table. */
/* */ /* */
static PCell* static PCell*
gray_find_cell( RAS_ARG_ TCoord x, gray_find_cell( RAS_ARG_ TCoord x,
TCoord y ) TCoord y )
{ {
PCell *pnode, node; PCell *pnode, node;
pnode = &ras.ycells[y]; pnode = &ras.ycells[y];
for (;;) for (;;)
{ {
@ -399,15 +397,17 @@ typedef struct TCell_
pnode = &node->next; pnode = &node->next;
} }
return pnode;
return pnode;
} }
static PCell static PCell
gray_alloc_cell( RAS_ARG_ TCoord x ) gray_alloc_cell( RAS_ARG_ TCoord x )
{ {
PCell cell; PCell cell;
if ( ras.num_cells >= ras.max_cells ) if ( ras.num_cells >= ras.max_cells )
ft_longjmp( ras.jump_buffer, 1 ); ft_longjmp( ras.jump_buffer, 1 );
@ -423,13 +423,10 @@ typedef struct TCell_
static void static void
gray_record_cell( RAS_ARG ) gray_record_cell( RAS_ARG )
{ {
PCell cell;
if ( !ras.invalid && ( ras.area | ras.cover ) ) if ( !ras.invalid && ( ras.area | ras.cover ) )
{ {
TCoord x = (TCoord)(ras.ex - ras.min_ex); TCoord x = (TCoord)( ras.ex - ras.min_ex );
TCoord y = (TCoord)(ras.ey - ras.min_ey); TCoord y = (TCoord)( ras.ey - ras.min_ey );
PCell *pparent = gray_find_cell( RAS_VAR_ x, y ); PCell *pparent = gray_find_cell( RAS_VAR_ x, y );
PCell cell = *pparent; PCell cell = *pparent;
@ -445,6 +442,7 @@ typedef struct TCell_
} }
} }
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Set the current cell to a new position. */ /* Set the current cell to a new position. */
@ -1257,6 +1255,7 @@ typedef struct TCell_
FT_UNUSED( target ); FT_UNUSED( target );
if ( ras.num_cells == 0 ) if ( ras.num_cells == 0 )
return; return;
@ -1268,15 +1267,18 @@ typedef struct TCell_
TCoord cover = 0; TCoord cover = 0;
TCoord x = 0; TCoord x = 0;
for ( ; cell != NULL; cell = cell->next ) for ( ; cell != NULL; cell = cell->next )
{ {
TArea area; TArea area;
if ( cell->x > x && cover != 0 ) if ( cell->x > x && cover != 0 )
gray_hline( RAS_VAR_ x, yindex, cover*(ONE_PIXEL*2), cell->x - x ); gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ),
cell->x - x );
cover += cell->cover; cover += cell->cover;
area = cover*(ONE_PIXEL*2) - cell->area; area = cover * ( ONE_PIXEL * 2 ) - cell->area;
if ( area != 0 && cell->x >= 0 ) if ( area != 0 && cell->x >= 0 )
gray_hline( RAS_VAR_ cell->x, yindex, area, 1 ); gray_hline( RAS_VAR_ cell->x, yindex, area, 1 );
@ -1285,8 +1287,8 @@ typedef struct TCell_
} }
if ( cover != 0 ) if ( cover != 0 )
gray_hline( RAS_VAR_ x, yindex, cover*(ONE_PIXEL*2), gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ),
(ras.max_ex - x) ); ras.max_ex - x );
} }
if ( ras.render_span && ras.num_gray_spans > 0 ) if ( ras.render_span && ras.num_gray_spans > 0 )
@ -1294,6 +1296,7 @@ typedef struct TCell_
ras.gray_spans, ras.render_span_data ); ras.gray_spans, ras.render_span_data );
} }
#ifdef _STANDALONE_ #ifdef _STANDALONE_
/*************************************************************************/ /*************************************************************************/
@ -1646,9 +1649,10 @@ typedef struct TCell_
int error; int error;
{ {
PCell cells_max; PCell cells_max;
int yindex, ycount; int yindex;
long cell_start, cell_mod; long cell_start, cell_mod;
ras.ycells = (PCell*)ras.buffer; ras.ycells = (PCell*)ras.buffer;
ras.ycount = band->max - band->min; ras.ycount = band->max - band->min;
@ -1656,18 +1660,18 @@ typedef struct TCell_
for ( yindex = 0; yindex < ras.ycount; yindex++ ) for ( yindex = 0; yindex < ras.ycount; yindex++ )
ras.ycells[yindex] = NULL; ras.ycells[yindex] = NULL;
cell_start = sizeof(PCell)*ras.ycount; cell_start = sizeof ( PCell ) * ras.ycount;
cell_mod = cell_start % sizeof(TCell); cell_mod = cell_start % sizeof ( TCell );
if ( cell_mod > 0 ) if ( cell_mod > 0 )
cell_start += sizeof(TCell) - cell_mod; cell_start += sizeof ( TCell ) - cell_mod;
cells_max = (PCell)(ras.buffer + ras.buffer_size); cells_max = (PCell)( (char*)ras.buffer + ras.buffer_size );
ras.cells = (PCell)((char*)ras.buffer + cell_start); ras.cells = (PCell)( (char*)ras.buffer + cell_start );
if ( ras.cells >= cells_max ) if ( ras.cells >= cells_max )
goto ReduceBands; goto ReduceBands;
ras.max_cells = (cells_max - ras.cells); ras.max_cells = cells_max - ras.cells;
if (ras.max_cells < 2) if ( ras.max_cells < 2 )
goto ReduceBands; goto ReduceBands;
} }

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType TrueType driver component (body only). */ /* FreeType TrueType driver component (body only). */
/* */ /* */
/* Copyright 1996-2001, 2004 by */ /* Copyright 1996-2001, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* TrueType Glyph Loader (specification). */ /* TrueType Glyph Loader (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -261,9 +261,8 @@
face->unpatented_hinting = TRUE; face->unpatented_hinting = TRUE;
} }
/* compare the face with a list of well-known "tricky' fonts !! /* Compare the face with a list of well-known `tricky' fonts. */
* this list shall be expanded as we find them /* This list shall be expanded as we find more of them. */
*/
if ( !face->unpatented_hinting ) if ( !face->unpatented_hinting )
{ {
static const char* const trick_names[] = static const char* const trick_names[] =
@ -275,11 +274,11 @@
"PMingLiU", /* mingliu.ttc */ "PMingLiU", /* mingliu.ttc */
NULL NULL
}; };
int nn; int nn;
/* note that we only check the face name at the moment, it might
* be worthy to do more checks for a few special cases /* Note that we only check the face name at the moment; it might */
*/ /* be worth to do more checks for a few special cases. */
for ( nn = 0; trick_names[nn] != NULL; nn++ ) for ( nn = 0; trick_names[nn] != NULL; nn++ )
{ {
if ( ft_strcmp( ttface->family_name, trick_names[nn] ) == 0 ) if ( ft_strcmp( ttface->family_name, trick_names[nn] ) == 0 )

View File

@ -209,9 +209,9 @@
if ( info->is_fixed_pitch ) if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
/* note, only define if we have the patented bytecode interpreter, /* We only set this flag if we have the patented bytecode interpreter. */
* there are no known "tricky" Type42 fonts that could be loaded /* There are no known `tricky' Type42 fonts that could be loaded with */
* with the unpatented interpreter */ /* the unpatented interpreter. */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
root->face_flags |= FT_FACE_FLAG_HINTER; root->face_flags |= FT_FACE_FLAG_HINTER;
#endif #endif