* docs/CHANGES, docs/INSTALL.ANY: Updated.

* include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
Add `OTvalid'.

* src/autofit/aferrors.h: New file.

* src/autofit/afglobal.c, src/autofit/afhints.c,
src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
Include aferrors.h.

* src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.

* src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
This commit is contained in:
Werner Lemberg 2005-03-23 16:45:24 +00:00
parent 665279f0d5
commit a37745bad4
11 changed files with 119 additions and 53 deletions

View File

@ -1,7 +1,24 @@
2005-03-23 Werner Lemberg <wl@gnu.org>
* docs/CHANGES, docs/INSTALL.ANY: Updated.
* include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
Add `OTvalid'.
* src/autofit/aferrors.h: New file.
* src/autofit/afglobal.c, src/autofit/afhints.c,
src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
Include aferrors.h.
* src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.
* src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
2005-03-22 David Turner <david@freetype.org> 2005-03-22 David Turner <david@freetype.org>
* src/autohint/*, Jamfile: removing the 'autohint' module * src/autohint/*: Removed.
from the build. * Jamfile: Updated.
2005-03-15 David Turner <david@freetype.org> 2005-03-15 David Turner <david@freetype.org>

View File

@ -38,9 +38,10 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
memory-mapped font files (which is the default on Unix systems memory-mapped font files (which is the default on Unix systems
which support them). which support them).
- The auto-hinter has been completely rewritten as a new module, - The auto-hinter has been replaced with a new module, called the
called the `auto-fitter', which is now the default auto-hinting `auto-fitter'. It consumes less memory than its predecessor,
module. It consumes a lot less memory than its predecessor. and it is prepared to support non-latin scripts better in next
releases.
- George Williams contributed code to read kerning data from PFM - George Williams contributed code to read kerning data from PFM
files. files.
@ -74,19 +75,21 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
- A new option `--ftversion' has been added to freetype-config to - A new option `--ftversion' has been added to freetype-config to
return the FreeType version. return the FreeType version.
- The memory debugger has been updated to dump allocation statistics - The memory debugger has been updated to dump allocation
on all allocation sources in the library. This is useful to spot statistics on all allocation sources in the library. This is
greedy allocations when loading and processing fonts. useful to spot greedy allocations when loading and processing
fonts.
- we removed a huge array of constant pointers to constant strings - We removed a huge array of constant pointers to constant strings
in the 'psnames' module. The problem was that when compiled in PIC in the `psnames' module. The problem was that compilations in
mode (i.e. when generating a Unix shared object / dll), the array PIC mode (i.e., when generating a Unix shared object/dll) put
could only be placed in the non-shared writable section of the library* the array into the non-shared writable section of the library
since absolute pointers are not relocatable by nature. since absolute pointers are not relocatable by nature.
This saves about 16Kb per process linked to FreeType. We also store This reduces the memory consumption by approximately 16KByte per
the array in a novel compressed way that saves about 20 Kb of code process linked to FreeType. We now also store the array in a
as well. compressed form (as a trie) which saves about 20KByte of code as
well.
====================================================================== ======================================================================

View File

@ -42,7 +42,7 @@ I. Standard procedure
-- other components (optional) -- other components (optional)
src/autohint/autohint.c -- auto hinting module src/autofit/autofit.c -- auto hinting module
src/cache/ftcache.c -- cache sub-system (in beta) src/cache/ftcache.c -- cache sub-system (in beta)
src/sfnt/sfnt.c -- SFNT files support src/sfnt/sfnt.c -- SFNT files support
(TrueType & OpenType) (TrueType & OpenType)

View File

@ -4,7 +4,7 @@
/* */ /* */
/* FreeType module error offsets (specification). */ /* FreeType module error offsets (specification). */
/* */ /* */
/* Copyright 2001, 2002, 2003, 2004 by */ /* Copyright 2001, 2002, 2003, 2004, 2005 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, */
@ -23,8 +23,8 @@
/* The lower byte gives the error code, the higher byte gives the */ /* The lower byte gives the error code, the higher byte gives the */
/* module. The base module has error offset 0. For example, the error */ /* module. The base module has error offset 0. For example, the error */
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */ /* `FT_Err_Invalid_File_Format' has value 0x003, the error */
/* `TT_Err_Invalid_File_Format' has value 0x1003, the error */ /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1103, etc. */ /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
/* */ /* */
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
/* to make the higher byte always zero (disabling the module error */ /* to make the higher byte always zero (disabling the module error */
@ -103,25 +103,26 @@
FT_MODERRDEF( Base, 0x000, "base module" ) FT_MODERRDEF( Base, 0x000, "base module" )
FT_MODERRDEF( Autohint, 0x100, "autohinter module" ) FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" ) FT_MODERRDEF( BDF, 0x200, "BDF module" )
FT_MODERRDEF( Cache, 0x300, "cache module" ) FT_MODERRDEF( Cache, 0x300, "cache module" )
FT_MODERRDEF( CFF, 0x400, "CFF module" ) FT_MODERRDEF( CFF, 0x400, "CFF module" )
FT_MODERRDEF( CID, 0x500, "CID module" ) FT_MODERRDEF( CID, 0x500, "CID module" )
FT_MODERRDEF( Gzip, 0x600, "Gzip module" ) FT_MODERRDEF( Gzip, 0x600, "Gzip module" )
FT_MODERRDEF( LZW, 0x700, "LZW module" ) FT_MODERRDEF( LZW, 0x700, "LZW module" )
FT_MODERRDEF( PCF, 0x800, "PCF module" ) FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" )
FT_MODERRDEF( PFR, 0x900, "PFR module" ) FT_MODERRDEF( PCF, 0x900, "PCF module" )
FT_MODERRDEF( PSaux, 0xA00, "PS auxiliary module" ) FT_MODERRDEF( PFR, 0xA00, "PFR module" )
FT_MODERRDEF( PShinter, 0xB00, "PS hinter module" ) FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" )
FT_MODERRDEF( PSnames, 0xC00, "PS names module" ) FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" )
FT_MODERRDEF( Raster, 0xD00, "raster module" ) FT_MODERRDEF( PSnames, 0xD00, "PS names module" )
FT_MODERRDEF( SFNT, 0xE00, "SFNT module" ) FT_MODERRDEF( Raster, 0xE00, "raster module" )
FT_MODERRDEF( Smooth, 0xF00, "smooth raster module" ) FT_MODERRDEF( SFNT, 0xF00, "SFNT module" )
FT_MODERRDEF( TrueType, 0x1000, "TrueType module" ) FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" )
FT_MODERRDEF( Type1, 0x1100, "Type 1 module" ) FT_MODERRDEF( TrueType, 0x1100, "TrueType module" )
FT_MODERRDEF( Type42, 0x1200, "Type 42 module" ) FT_MODERRDEF( Type1, 0x1200, "Type 1 module" )
FT_MODERRDEF( Winfonts, 0x1300, "Windows FON/FNT module" ) FT_MODERRDEF( Type42, 0x1300, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" )
#ifdef FT_MODERR_END_LIST #ifdef FT_MODERR_END_LIST

40
src/autofit/aferrors.h Normal file
View File

@ -0,0 +1,40 @@
/***************************************************************************/
/* */
/* aferrors.h */
/* */
/* Autofitter error codes (specification only). */
/* */
/* Copyright 2005 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. */
/* */
/***************************************************************************/
/*************************************************************************/
/* */
/* This file is used to define the Autofitter error enumeration */
/* constants. */
/* */
/*************************************************************************/
#ifndef __AFERRORS_H__
#define __AFERRORS_H__
#include FT_MODULE_ERRORS_H
#undef __FTERRORS_H__
#define FT_ERR_PREFIX AF_Err_
#define FT_ERR_BASE FT_Mod_Err_Autofit
#include FT_ERRORS_H
#endif /* __AFERRORS_H__ */
/* END */

View File

@ -19,6 +19,7 @@
#include "afglobal.h" #include "afglobal.h"
#include "afdummy.h" #include "afdummy.h"
#include "aflatin.h" #include "aflatin.h"
#include "aferrors.h"
/* populate this list when you add new scripts */ /* populate this list when you add new scripts */
@ -57,7 +58,7 @@
static FT_Error static FT_Error
af_face_globals_compute_script_coverage( AF_FaceGlobals globals ) af_face_globals_compute_script_coverage( AF_FaceGlobals globals )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
FT_Face face = globals->face; FT_Face face = globals->face;
FT_CharMap old_charmap = face->charmap; FT_CharMap old_charmap = face->charmap;
FT_Byte* gscripts = globals->glyph_scripts; FT_Byte* gscripts = globals->glyph_scripts;
@ -76,7 +77,7 @@
* Ignore this error; we simply use Latin as the standard * Ignore this error; we simply use Latin as the standard
* script. XXX: Shouldn't we rather disable hinting? * script. XXX: Shouldn't we rather disable hinting?
*/ */
error = FT_Err_Ok; error = AF_Err_Ok;
goto Exit; goto Exit;
} }
@ -219,12 +220,12 @@
AF_ScriptMetrics metrics = NULL; AF_ScriptMetrics metrics = NULL;
FT_UInt index; FT_UInt index;
AF_ScriptClass clazz; AF_ScriptClass clazz;
FT_Error error = 0; FT_Error error = AF_Err_Ok;
if ( gindex >= globals->glyph_count ) if ( gindex >= globals->glyph_count )
{ {
error = FT_Err_Invalid_Argument; error = AF_Err_Invalid_Argument;
goto Exit; goto Exit;
} }

View File

@ -17,6 +17,7 @@
#include "afhints.h" #include "afhints.h"
#include "aferrors.h"
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
@ -24,7 +25,7 @@
FT_Memory memory, FT_Memory memory,
AF_Segment *asegment ) AF_Segment *asegment )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
AF_Segment segment = NULL; AF_Segment segment = NULL;
@ -37,7 +38,7 @@
if ( old_max >= big_max ) if ( old_max >= big_max )
{ {
error = FT_Err_Out_Of_Memory; error = AF_Err_Out_Of_Memory;
goto Exit; goto Exit;
} }
@ -66,7 +67,7 @@
FT_Memory memory, FT_Memory memory,
AF_Edge *aedge ) AF_Edge *aedge )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
AF_Edge edge = NULL; AF_Edge edge = NULL;
AF_Edge edges; AF_Edge edges;
@ -80,7 +81,7 @@
if ( old_max >= big_max ) if ( old_max >= big_max )
{ {
error = FT_Err_Out_Of_Memory; error = AF_Err_Out_Of_Memory;
goto Exit; goto Exit;
} }
@ -462,7 +463,7 @@
af_glyph_hints_reload( AF_GlyphHints hints, af_glyph_hints_reload( AF_GlyphHints hints,
FT_Outline* outline ) FT_Outline* outline )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
AF_Point points; AF_Point points;
FT_UInt old_max, new_max; FT_UInt old_max, new_max;
AF_Scaler scaler = &hints->metrics->scaler; AF_Scaler scaler = &hints->metrics->scaler;

View File

@ -17,6 +17,7 @@
#include "aflatin.h" #include "aflatin.h"
#include "aferrors.h"
/*************************************************************************/ /*************************************************************************/
@ -377,7 +378,7 @@
af_latin_metrics_init( AF_LatinMetrics metrics, af_latin_metrics_init( AF_LatinMetrics metrics,
FT_Face face ) FT_Face face )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
FT_CharMap oldmap = face->charmap; FT_CharMap oldmap = face->charmap;
FT_UInt ee; FT_UInt ee;
@ -408,7 +409,7 @@
} }
FT_Set_Charmap( face, oldmap ); FT_Set_Charmap( face, oldmap );
return FT_Err_Ok; return AF_Err_Ok;
} }
@ -577,7 +578,7 @@
{ {
AF_AxisHints axis = &hints->axis[dim]; AF_AxisHints axis = &hints->axis[dim];
FT_Memory memory = hints->memory; FT_Memory memory = hints->memory;
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
AF_Segment segment = NULL; AF_Segment segment = NULL;
AF_Point* contour = hints->contours; AF_Point* contour = hints->contours;
AF_Point* contour_limit = contour + hints->num_contours; AF_Point* contour_limit = contour + hints->num_contours;
@ -921,7 +922,7 @@
AF_Dimension dim ) AF_Dimension dim )
{ {
AF_AxisHints axis = &hints->axis[dim]; AF_AxisHints axis = &hints->axis[dim];
FT_Error error = 0; FT_Error error = AF_Err_Ok;
FT_Memory memory = hints->memory; FT_Memory memory = hints->memory;
AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim]; AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];

View File

@ -20,6 +20,7 @@
#include "afhints.h" #include "afhints.h"
#include "afglobal.h" #include "afglobal.h"
#include "aflatin.h" #include "aflatin.h"
#include "aferrors.h"
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
@ -51,7 +52,7 @@
af_loader_reset( AF_Loader loader, af_loader_reset( AF_Loader loader,
FT_Face face ) FT_Face face )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = AF_Err_Ok;
loader->face = face; loader->face = face;
@ -331,7 +332,7 @@
if ( start_point + k >= num_base_points || if ( start_point + k >= num_base_points ||
l >= (FT_UInt)num_new_points ) l >= (FT_UInt)num_new_points )
{ {
error = FT_Err_Invalid_Composite; error = AF_Err_Invalid_Composite;
goto Exit; goto Exit;
} }
@ -369,7 +370,7 @@
default: default:
/* we don't support other formats (yet?) */ /* we don't support other formats (yet?) */
error = FT_Err_Unimplemented_Feature; error = AF_Err_Unimplemented_Feature;
} }
Hint_Metrics: Hint_Metrics:
@ -448,7 +449,7 @@
if ( !size ) if ( !size )
return FT_Err_Invalid_Argument; return AF_Err_Invalid_Argument;
FT_ZERO( &scaler ); FT_ZERO( &scaler );

View File

@ -35,8 +35,9 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \
# AUTOF driver headers # AUTOF driver headers
# #
AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \ AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \
$(AUTOF_DIR)/aftypes.h $(AUTOF_DIR)/aftypes.h \
$(AUTOF_DIR)/aferrors.h
# AUTOF driver object(s) # AUTOF driver object(s)

View File

@ -4,7 +4,7 @@
/* */ /* */
/* OpenType validation module error codes (specification only). */ /* OpenType validation module error codes (specification only). */
/* */ /* */
/* Copyright 2004 by */ /* Copyright 2004, 2005 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, */
@ -31,7 +31,7 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX OTV_Err_ #define FT_ERR_PREFIX OTV_Err_
#define FT_ERR_BASE FT_Mod_Err_OTV #define FT_ERR_BASE FT_Mod_Err_OTvalid
#define FT_KEEP_ERR_PREFIX #define FT_KEEP_ERR_PREFIX