Clean-up.

This commit is contained in:
Werner Lemberg 2005-11-12 07:34:40 +00:00
parent f2c5330a86
commit cee37a3b0a
18 changed files with 126 additions and 76 deletions

View File

@ -31,42 +31,72 @@
2005-10-28 David Turner <david@freetype.org>
* builds/exports.mk, builds/freetype.mk, builds/compiler/visualc.mk,
builds/dos/dos-def.mk, builds/os2/os2-def.mk,
builds/unix/unix-cc.in, builds/unix/unixddef.mk,
builds/win32/w32-bcc.mk, builds/win32/w32-gcc.mk,
builds/win32/w32-icc.mk, builds/win32/w32-intl.mk,
builds/win32/w32-mingw32.mk, builds/win32/w32-vcc.mk,
builds/win32/w32-wat.mk, builds/win32/w32-def.mk, Jamfile: Update
build system to support the generation of a list of exported symbols
or Windows .DEF files by parsing the public headers with the
Update build system to support the generation of a list of exported
symbols or Windows .DEF files by parsing the public headers with the
`apinames' tool located in src/tools/apinames.c.
Only tested on Unix at the moment. On Windows, the .DEF file is
generated but isn't used yet to generate a DLL.
* src/pfr/pfrtypes.h, src/pfr/pfrobjs.h, src/pfr/pfrload.c,
src/pfr/pfrobjs.c, src/pfr/pfrgload.c: integrated memory optimization
without FT_OPTIMIZE_MEMORY
* builds/exports.mk: New file.
* src/base/fttrigon.c (ft_trig_prenorm), src/base/ftcalc.c
(FT_MulFix): Performance optimizations.
* builds/freetype.mk: Include exports.mk.
(dll): New target.
(clean_project_dos): Fix rule.
* include/freetype/internal/ftgloader.h, src/base/ftgloader.h:
Introduce the FT_GLYPHLOADER_CHECKXXXX macros, and fix a small bug
within FT_GlyphLoader_CheckPoints which caused `AdjustPoints' to be
called everytime.
* builds/compiler/visualc.mk (TE), builds/dos/dos-def.mk (E),
builds/os2/os2-def.mk (E), builds/win32/win32-def.mk (E): New
variables for controlling executable extensions.
* builds/unix/unix-cc.in (EXPORTS_LIST, CCexe),
builds/win32/w32-bcc.mk, builds/win32/w32-gcc.mk,
builds/win32/w32-icc.mk, builds/win32/w32-icc.mk,
builds/win32/w32-mingw32.mk, builds/win32/w32-vcc,
builds/win32/w32-wat.mk (EXPORTS_LIST, EXPORT_OPTIONS,
APINAMES_OPTIONS): New targets for controlling the `apinames' tool.
* Jamfile (GenExportSymbols): Updated.
* src/pfr/pfrtypes.h, src/pfr/pfrload.c, src/pfr/pfrobjs.c
[!FT_OPTIMIZE_MEMORY]: Fold memory optimization code into
FT_OPTIMIZE_MEMORY chunks for better maintainability and simplicity.
* src/base/fttrigon.c (ft_trig_prenorm), src/base/ftcalc.c
(FT_MulFix): Performance optimizations.
* include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
FT_GLYPHLOADER_CHECK_C, FT_GLYPHLOADER_CHECK_POINTS): New macros for
checking points and contours. Update callers to use
FT_GLYPHLOADER_CHECK_POINTS instead of FT_GlyphLoader_CheckPoints
at profile-detected hot-spots.
* src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Set `adjust'
to 0 to not call `AdjustPoints' every time.
* src/autofit/afloader.c, src/truetype/ttgload.c: Performance
optimization: Use FT_GLYPHLOADER_CHECK_POINTS macro on
profile-detected hot-spots.
* src/autofit/aftypes.h (AF_ANGLE_DIFF): New macro to inline
FT_Angle_Diff.
* src/autofit/afhints.c (af_direction_compute): Re-implement. Use
* src/autofit/afhints.c (af_direction_compute): Re-implement.
(af_glyph_hints_compute_inflections, af_glyph_hints_reload): Use
AF_ANGLE_DIFF to speed up the detection of inflexions.
* src/tools/apinames.c: Include <string.h>.
(OutputFormat): New enumeration.
(names_dump): Add two parameters to control output format and DLL
name.
(names_dump_windef): Removed. Code folded into `names_dump'.
(read_header_file): Use isalnum, not isalpha. Otherwise function
names with digits aren't read correctly.
(usage): Updated.
(main): New option `-o' to control output file name.
New option `-d' to indicate DLL file name.
Extend `-w' flag to handle Borland and Watcom compilers and linkers.
2005-10-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* builds/mac/ftlib.prj, builds/mac/freetype.mak: Removed.

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -19,7 +19,7 @@ BUILD_DIR := $(TOP_DIR)/builds/dos
PLATFORM := dos
# The executable file extension (for tools). NOTE: WE INCLUDE THE DOT HERE !!
# The executable file extension (for tools), *with* leading dot.
#
E := .exe

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@ -18,7 +18,7 @@ SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/os2
PLATFORM := os2
# The executable file extension (for tools). NOTE: WE INCLUDE THE DOT HERE !!
# The executable file extension (for tools), *with* leading dot.
#
E := .exe

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000 by
# Copyright 1996-2000, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
#
# Copyright 1996-2000, 2003 by
# Copyright 1996-2000, 2003, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
/* Copyright 2002, 2003 by */
/* Copyright 2002, 2003, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -117,22 +117,24 @@ FT_BEGIN_HEADER
FT_UInt n_points,
FT_UInt n_contours );
#define FT_GLYPHLOADER_CHECK_P(_loader,_count) \
( (_count) == 0 || (int)((_loader)->base.outline.n_points + \
(_loader)->current.outline.n_points + \
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
( (_count) == 0 || (int)((_loader)->base.outline.n_points + \
(_loader)->current.outline.n_points + \
(_count)) <= (int)(_loader)->max_points )
#define FT_GLYPHLOADER_CHECK_C(_loader,_count) \
( (_count) == 0 || (int)((_loader)->base.outline.n_contours + \
(_loader)->current.outline.n_contours + \
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
( (_count) == 0 || (int)((_loader)->base.outline.n_contours + \
(_loader)->current.outline.n_contours + \
(_count)) <= (int)(_loader)->max_contours )
#define FT_GLYPHLOADER_CHECK_POINTS(_loader,_points,_contours) \
( ( FT_GLYPHLOADER_CHECK_P(_loader,_points) && \
FT_GLYPHLOADER_CHECK_C(_loader,_contours) ) \
? 0 \
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
? 0 \
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
/* check that there is enough space to add `n_subs' sub-glyphs to */
/* a glyph loader */
FT_BASE( FT_Error )

View File

@ -274,22 +274,25 @@
#if 1
AF_Direction dir = AF_DIR_NONE;
/* atan(1/12) == 4.7 degrees */
if ( dx < 0 )
{
if ( dy < 0 )
{
if ( -dx*12 < -dy )
if ( -dx * 12 < -dy )
dir = AF_DIR_DOWN;
else if ( -dy*12 < -dx )
else if ( -dy * 12 < -dx )
dir = AF_DIR_LEFT;
}
else /* dy >= 0 */
{
if ( -dx*12 < dy )
if ( -dx * 12 < dy )
dir = AF_DIR_UP;
else if ( dy*12 < -dx )
else if ( dy * 12 < -dx )
dir = AF_DIR_LEFT;
}
}
@ -297,23 +300,26 @@
{
if ( dy < 0 )
{
if ( dx*12 < -dy )
if ( dx * 12 < -dy )
dir = AF_DIR_DOWN;
else if ( -dy*12 < dx )
else if ( -dy * 12 < dx )
dir = AF_DIR_RIGHT;
}
else /* dy >= 0 */
{
if ( dx*12 < dy )
if ( dx * 12 < dy )
dir = AF_DIR_UP;
else if ( dy*12 < dx )
else if ( dy * 12 < dx )
dir = AF_DIR_RIGHT;
}
}
return dir;
#else
return dir;
#else /* 0 */
AF_Direction dir;
FT_Pos ax = FT_ABS( dx );
FT_Pos ay = FT_ABS( dy );
@ -335,7 +341,9 @@
}
return dir;
#endif
#endif /* 0 */
}
@ -394,7 +402,7 @@
} while ( angle_in == angle_seg );
first = start;
first = start;
AF_ANGLE_DIFF( diff_in, angle_in, angle_seg );

View File

@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -402,8 +402,10 @@
if ( a == 0 || b == 0x10000L )
return a;
sa = (a >> (sizeof(a)*8 - 1)); a = (a^sa) - sa;
sb = (b >> (sizeof(b)*8 - 1)); b = (b^sb) - sb;
sa = ( a >> ( sizeof ( a ) * 8 - 1 ) );
a = ( a ^ sa ) - sa;
sb = ( b >> ( sizeof ( b ) * 8 - 1 ) );
b = ( b ^ sb ) - sb;
ua = (FT_ULong)a;
ub = (FT_ULong)b;
@ -422,10 +424,12 @@
}
sa ^= sb,
ua = (FT_ULong)((ua ^ sa) - sa);
ua = (FT_ULong)(( ua ^ sa ) - sa);
return (FT_Long)ua;
#else
#else /* 0 */
FT_Long s;
FT_ULong ua, ub;
@ -453,7 +457,9 @@
}
return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
#endif
#endif /* 0 */
}

View File

@ -4,7 +4,7 @@
/* */
/* Mac FOND support. Written by just@letterror.com. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (body). */
/* */
/* Copyright 2001, 2002, 2003, 2004 by */
/* Copyright 2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -110,23 +110,24 @@
shift = 0;
#if 1
/* determine msb bit index in 'shift' */
if ( z >= (1L << 16 ) )
/* determine msb bit index in `shift' */
if ( z >= ( 1L << 16 ) )
{
z >>= 16;
shift += 16;
}
if ( z >= (1L << 8) )
if ( z >= ( 1L << 8 ) )
{
z >>= 8;
shift += 8;
}
if ( z >= (1L << 4) )
if ( z >= ( 1L << 4 ) )
{
z >>= 4;
shift += 4;
}
if ( z >= (1L << 2) )
if ( z >= ( 1L << 2 ) )
{
z >>= 2;
shift += 2;
@ -136,8 +137,7 @@
if ( shift < 28 )
{
shift = 28-shift;
shift = 28 - shift;
vec->x = x << shift;
vec->y = y << shift;
}
@ -148,7 +148,9 @@
vec->y = y >> shift;
shift = -shift;
}
#else
#else /* 0 */
if ( z < ( 1L << 27 ) )
{
do
@ -171,7 +173,9 @@
vec->y = y >> shift;
shift = -shift;
}
#endif
#endif /* 0 */
return shift;
}

View File

@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (body). */
/* */
/* Copyright 2002, 2003 by */
/* Copyright 2002, 2003, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */