* README: Formatting.

* Jamfile: Fix typo.

* src/cff/cffparse.c: Move error code #defines to...
* include/freetype/internal/cfferrs.h: This file.
* src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffload.c: Replaced
`FT_Err_*' with `CFF_Err_*'.
* src/cid/cidparse.c: Replaced `FT_Err_*' with `T1_Err_*'.
* src/psaux/psobjs.c, src/psaux/t1decode.c: Ditto.
* src/sfnt/sfobcs.c, src/sfnt/ttload.c: Replaced `FT_Err_*' with
`TT_Err_*'.
* src/truetype/ttgload.c, src/truetype/ttobjs.c: Ditto.
* src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1objs.c,
src/type1/t1parse.c: Replaced `FT_Err_*' with `T1_Err_*'.

* include/freetype/internal/cfferrs.h: Add
`CFF_Err_Unknown_File_Format'.
* include/freetype/internal/t1errors.h: Add
`T1_Err_Unknown_File_Format'.
* include/freetype/internal/tterrors.h: Add
`TT_Err_Unknown_File_Format'.

* src/cff/cffload.h: Add `cff_*_encoding' and `cff_*_charset'
references.
* src/psaux/psobjs.c: Include `FT_INTERNAL_TYPE1_ERRORS_H'.

* src/cff/cffobjs.c (CFF_Init_Face, CFF_Done_Face): Use
FT_LOCAL_DEF.
* src/cid/cidobjs.c (CID_Done_Driver): Ditto.
* src/trutype/ttobjs.c (TT_Init_Face, TT_Done_Face, TT_Init_Size):
Ditto.
* src/type1/t1objs.c (T1_Done_Driver): Ditto.
* src/pcf/pcfdriver.c (PCF_Done_Face): Ditto.
* src/pcf/pcf.h: Use FT_LOCAL for `PCF_Done_Face'.
This commit is contained in:
Werner Lemberg 2001-04-02 23:54:01 +00:00
parent ab6d10759a
commit 1429db6c4f
26 changed files with 128 additions and 87 deletions

View File

@ -2,8 +2,43 @@
* CHANGES: Reformatted, minor fixes.
* TODO: Updated.
* README: Formatting.
* include/freetype/freetype.h: Formatting.
* Jamfile: Fix typo.
* src/cff/cffparse.c: Move error code #defines to...
* include/freetype/internal/cfferrs.h: This file.
* src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffload.c: Replaced
`FT_Err_*' with `CFF_Err_*'.
* src/cid/cidparse.c: Replaced `FT_Err_*' with `T1_Err_*'.
* src/psaux/psobjs.c, src/psaux/t1decode.c: Ditto.
* src/sfnt/sfobcs.c, src/sfnt/ttload.c: Replaced `FT_Err_*' with
`TT_Err_*'.
* src/truetype/ttgload.c, src/truetype/ttobjs.c: Ditto.
* src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1objs.c,
src/type1/t1parse.c: Replaced `FT_Err_*' with `T1_Err_*'.
* include/freetype/internal/cfferrs.h: Add
`CFF_Err_Unknown_File_Format'.
* include/freetype/internal/t1errors.h: Add
`T1_Err_Unknown_File_Format'.
* include/freetype/internal/tterrors.h: Add
`TT_Err_Unknown_File_Format'.
* src/cff/cffload.h: Add `cff_*_encoding' and `cff_*_charset'
references.
* src/psaux/psobjs.c: Include `FT_INTERNAL_TYPE1_ERRORS_H'.
* src/cff/cffobjs.c (CFF_Init_Face, CFF_Done_Face): Use
FT_LOCAL_DEF.
* src/cid/cidobjs.c (CID_Done_Driver): Ditto.
* src/trutype/ttobjs.c (TT_Init_Face, TT_Done_Face, TT_Init_Size):
Ditto.
* src/type1/t1objs.c (T1_Done_Driver): Ditto.
* src/pcf/pcfdriver.c (PCF_Done_Face): Ditto.
* src/pcf/pcf.h: Use FT_LOCAL for `PCF_Done_Face'.
2001-04-02 Tom Kacvinsky <tjk@ams.org>
* src/sfnt/ttload.c (TT_Load_Metrics): Fix an improper pointer

View File

@ -23,7 +23,7 @@ SubDirHdr += $(FT2_INCLUDE) ;
# uncomment the following line if you want to build individual source files
# for each FreeType 2 module.
#
# FT2_MULTI = true;
# FT2_MULTI = true ;
# the file <freetype/config/ft2build.h> is used to define macros that are
# later used in #include statements.. it needs to be parsed in order to

21
README
View File

@ -1,20 +1,19 @@
FreeType 2.0.2
==============
Please read the CHANGES file, it contains IMPORTANT INFORMATION
Read the files "INSTALL" or "docs/BUILD" for installation instructions
Please read the CHANGES file, it contains IMPORTANT INFORMATION.
Read the files "INSTALL" or "docs/BUILD" for installation instructions.
Note that the FreeType 2 documentation is now available as a separate
package from our sites. See:
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.bz2
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.gz
ftp://ftp.freetype.org/pub/freetype2/ftdoc202.zip
package from our sites. See:
Enjoy.. :-)
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.bz2
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.gz
ftp://ftp.freetype.org/pub/freetype2/ftdoc202.zip
Enjoy!
The FreeType Team
The FreeType Team

View File

@ -21,36 +21,37 @@
/* This is a Unix-specific version of <ft2build.h> that should be used */
/* exclusively *after* installation of the library. */
/* */
/* it assumes that "/usr/local/include/freetype2", or wathever is */
/* returned by the "freetype-config --cflags" command is in your */
/* compilation include path.. */
/* It assumes that "/usr/local/include/freetype2" (or wathever is */
/* returned by the "freetype-config --cflags" command) is in your */
/* compilation include path. */
/* */
/* We don't need to do anything special in this release. However, for */
/* We don't need to do anything special in this release. However, for */
/* FreeType 2.1, the following installation changes will be performed: */
/* */
/* - the content of "freetype-2.1/include/freetype" will be */
/* installed to "/usr/local/include/freetype2" instead of */
/* "/usr/local/include/freetype2/freetype" */
/* - The contents of "freetype-2.1/include/freetype" will be installed */
/* to "/usr/local/include/freetype2" instead of */
/* "/usr/local/include/freetype2/freetype". */
/* */
/* - this file will #include <freetype2/config/ftheader.h>, instead */
/* of <freetype/config/ftheader.h> */
/* - This file will #include <freetype2/config/ftheader.h>, instead */
/* of <freetype/config/ftheader.h>. */
/* */
/* - the content of "ftheader.h" will be processed through sed to */
/* replace all "<freetype/xxx>" with "<freetype2/xxxx>" */
/* - The contents of "ftheader.h" will be processed with `sed' to */
/* replace all "<freetype/xxx>" with "<freetype2/xxx>". */
/* */
/* - adding "/usr/local/include/freetype2" to your compilation */
/* include path will not be necessary anymore. The command */
/* "freetype-config --cflags" will return an empty string */
/* - Adding "/usr/local/include/freetype2" to your compilation include */
/* path will not be necessary anymore. The command */
/* "freetype-config --cflags" will return an empty string. */
/* */
/* - client applications who adhere to the new inclusion scheme */
/* WILL NOT NEED TO BE MODIFIED to compile with FT 2.1 !! */
/* - Client applications which adhere to the new inclusion scheme */
/* WILL NOT NEED TO BE MODIFIED to compile with FT 2.1! */
/* */
/*************************************************************************/
#ifndef __FT2_BUILD_UNIX_H__
#define __FT2_BUILD_UNIX_H__
/* "/usr/local/include/freetype2" must be in your current inclusion path */
/* "/usr/local/include/freetype2" must be in your current inclusion path */
#include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_UNIX_H__ */

View File

@ -43,6 +43,7 @@ FT_BEGIN_HEADER
/* High level API errors. */
#define CFF_Err_Unknown_File_Format FT_Err_Unknown_File_Format
#define CFF_Err_Invalid_File_Format FT_Err_Invalid_File_Format
#define CFF_Err_Invalid_Argument FT_Err_Invalid_Argument
#define CFF_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle
@ -65,6 +66,11 @@ FT_BEGIN_HEADER
#define CFF_Err_Invalid_Composite FT_Err_Invalid_Composite
/* CFF parser errors. */
#define CFF_Err_Stack_Underflow FT_Err_Invalid_Argument
#define CFF_Err_Syntax_Error FT_Err_Invalid_Argument
/* Bytecode interpreter error codes. */
/* These error codes are produced by the TrueType */

View File

@ -40,6 +40,7 @@ FT_BEGIN_HEADER
/* ----------- high level API errors -------- */
#define T1_Err_Unknown_File_Format FT_Err_Unknown_File_Format
#define T1_Err_Invalid_File_Format FT_Err_Invalid_File_Format
#define T1_Err_Invalid_Argument FT_Err_Invalid_Argument
#define T1_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle

View File

@ -43,6 +43,7 @@ FT_BEGIN_HEADER
/* High level API errors. */
#define TT_Err_Unknown_File_Format FT_Err_Unknown_File_Format
#define TT_Err_Invalid_File_Format FT_Err_Invalid_File_Format
#define TT_Err_Invalid_Argument FT_Err_Invalid_Argument
#define TT_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle

View File

@ -241,7 +241,7 @@
FT_ERROR(( " cannot open CFF & CEF fonts\n" ));
FT_ERROR(( " " ));
FT_ERROR(( " without the `PSNames' module\n" ));
error = FT_Err_Unknown_File_Format;
error = CFF_Err_Unknown_File_Format;
goto Exit;
}

View File

@ -38,7 +38,6 @@
#define FT_COMPONENT trace_cffload
static
const FT_UShort cff_isoadobe_charset[229] =
{
0,
@ -272,7 +271,6 @@
228
};
static
const FT_UShort cff_expert_charset[166] =
{
0,
@ -443,7 +441,6 @@
378
};
static
const FT_UShort cff_expertsubset_charset[87] =
{
0,
@ -535,7 +532,6 @@
346
};
static
const FT_UShort cff_standard_encoding[256] =
{
0,
@ -796,7 +792,6 @@
0
};
static
const FT_UShort cff_expert_encoding[256] =
{
0,
@ -1588,7 +1583,7 @@
default:
FT_ERROR(( "CFF_Load_Charset: invalid table format!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
}
@ -1610,7 +1605,7 @@
{
FT_ERROR(("CFF_Load_Charset: implicit charset not equal to\n"
"predefined charset (Adobe ISO-Latin)!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
@ -1629,7 +1624,7 @@
{
FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n"
"predefined charset (Adobe Expert)!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
@ -1648,7 +1643,7 @@
{
FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n"
"predefined charset (Adobe Expert Subset)!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
@ -1663,7 +1658,7 @@
break;
default:
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
}
@ -1704,7 +1699,7 @@
/* Check for charset->sids. If we do not have this, we fail. */
if ( !charset->sids )
{
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
@ -1805,7 +1800,7 @@
default:
FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
}
@ -1921,7 +1916,7 @@
default:
FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" ));
error = FT_Err_Invalid_File_Format;
error = CFF_Err_Invalid_File_Format;
goto Exit;
break;
}
@ -2091,7 +2086,7 @@
font->absolute_offsize > 4 )
{
FT_TRACE2(( "[not a CFF font header!]\n" ));
error = FT_Err_Unknown_File_Format;
error = CFF_Err_Unknown_File_Format;
goto Exit;
}
@ -2189,7 +2184,7 @@
if ( dict->charstrings_offset == 0 )
{
FT_ERROR(( "CFF_Load_Font: no charstrings offset!\n" ));
error = FT_Err_Unknown_File_Format;
error = CFF_Err_Unknown_File_Format;
goto Exit;
}

View File

@ -27,6 +27,12 @@
FT_BEGIN_HEADER
extern const FT_UShort cff_isoadobe_charset[];
extern const FT_UShort cff_expert_charset[];
extern const FT_UShort cff_expertsubset_charset[];
extern const FT_UShort cff_standard_encoding[];
extern const FT_UShort cff_expert_encoding[];
FT_LOCAL
FT_String* CFF_Get_Name( CFF_Index* index,
FT_UInt element );

View File

@ -259,7 +259,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL
FT_LOCAL_DEF
FT_Error CFF_Init_Face( FT_Stream stream,
CFF_Face face,
FT_Int face_index,
@ -336,7 +336,7 @@
/* rewind to start of file; we are going to load a pure-CFF font */
if ( FILE_Seek( 0 ) )
goto Exit;
error = FT_Err_Ok;
error = CFF_Err_Ok;
}
/* now load and parse the CFF table in the file */
@ -496,7 +496,7 @@
return error;
Bad_Format:
error = FT_Err_Unknown_File_Format;
error = CFF_Err_Unknown_File_Format;
goto Exit;
}
@ -512,7 +512,7 @@
/* <Input> */
/* face :: A pointer to the face object to destroy. */
/* */
FT_LOCAL
FT_LOCAL_DEF
void CFF_Done_Face( CFF_Face face )
{
FT_Memory memory = face->root.memory;

View File

@ -32,10 +32,6 @@
#define FT_COMPONENT trace_cffparse
#define CFF_Err_Stack_Underflow FT_Err_Invalid_Argument
#define CFF_Err_Syntax_Error FT_Err_Invalid_Argument
enum
{
cff_kind_none = 0,

View File

@ -371,7 +371,7 @@
/* <Input> */
/* driver :: A handle to the target CID driver. */
/* */
FT_LOCAL
FT_LOCAL_DEF
void CID_Done_Driver( CID_Driver driver )
{
FT_UNUSED( driver );

View File

@ -75,7 +75,7 @@
"%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
{
FT_TRACE2(( "[not a valid CID-keyed font]\n" ));
error = FT_Err_Unknown_File_Format;
error = T1_Err_Unknown_File_Format;
}
FORGET_Frame();

View File

@ -160,7 +160,7 @@ FT_BEGIN_HEADER
/* XXX hack */
static
FT_LOCAL
FT_Error PCF_Done_Face( PCF_Face face );

View File

@ -47,7 +47,7 @@ THE SOFTWARE.
#define FT_COMPONENT trace_pcfdriver
static
FT_LOCAL_DEF
FT_Error PCF_Done_Face( PCF_Face face )
{
FT_Memory memory = FT_FACE_MEMORY( face );

View File

@ -18,6 +18,7 @@
#include <ft2build.h>
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_TYPE1_ERRORS_H
#include FT_INTERNAL_DEBUG_H
#include FT_ERRORS_H
#include "psobjs.h"
@ -120,7 +121,7 @@
table->capacity = new_size;
return FT_Err_Ok;
return T1_Err_Ok;
}
@ -155,7 +156,7 @@
if ( index < 0 || index > table->max_elems )
{
FT_ERROR(( "PS_Table_Add: invalid index\n" ));
return FT_Err_Invalid_Argument;
return T1_Err_Invalid_Argument;
}
/* grow the base block if needed */
@ -179,7 +180,7 @@
MEM_Copy( table->block + table->cursor, object, length );
table->cursor += length;
return FT_Err_Ok;
return T1_Err_Ok;
}
@ -877,13 +878,13 @@
FT_UNUSED( pflags );
#endif
error = FT_Err_Ok;
error = T1_Err_Ok;
Exit:
return error;
Fail:
error = FT_Err_Invalid_File_Format;
error = T1_Err_Invalid_File_Format;
goto Exit;
}
@ -949,7 +950,7 @@
return error;
Fail:
error = FT_Err_Invalid_File_Format;
error = T1_Err_Invalid_File_Format;
goto Exit;
}
@ -1190,7 +1191,7 @@
if ( !builder->load_points )
{
outline->n_contours++;
return FT_Err_Ok;
return T1_Err_Ok;
}
error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 );

View File

@ -344,7 +344,7 @@
limit = zone->limit = charstring_base + charstring_len;
ip = zone->cursor = zone->base;
error = FT_Err_Ok;
error = T1_Err_Ok;
outline = builder->current;
x = builder->pos_x;
@ -713,7 +713,7 @@
/* return now! */
FT_TRACE4(( "\n\n" ));
return FT_Err_Ok;
return T1_Err_Ok;
case op_hsbw:
FT_TRACE4(( " hsbw" ));
@ -729,7 +729,7 @@
/* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
return FT_Err_Ok;
return T1_Err_Ok;
break;
@ -753,7 +753,7 @@
/* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
return FT_Err_Ok;
return T1_Err_Ok;
break;
@ -1054,7 +1054,7 @@
{
FT_ERROR(( "T1_Decoder_Init: " ));
FT_ERROR(( "the `psnames' module is not available\n" ));
return FT_Err_Unimplemented_Feature;
return T1_Err_Unimplemented_Feature;
}
decoder->psnames = psnames;

View File

@ -199,7 +199,7 @@
sfnt = (SFNT_Interface*)FT_Get_Module_Interface( library, "sfnt" );
if ( !sfnt )
{
error = FT_Err_Invalid_File_Format;
error = TT_Err_Invalid_File_Format;
goto Exit;
}
@ -328,7 +328,7 @@
{
/* return an error if this font file has no outlines */
if ( error == TT_Err_Table_Missing && has_outline )
error = FT_Err_Ok;
error = TT_Err_Ok;
else
goto Exit;
}

View File

@ -262,7 +262,7 @@
entry_selector * 2 <= num_tables )
{
FT_TRACE2(( "TT_Load_SFNT_Header: file is not SFNT!\n" ));
error = FT_Err_Unknown_File_Format;
error = TT_Err_Unknown_File_Format;
}
}

View File

@ -251,7 +251,7 @@
FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin,
loader->bbox.yMax ));
return FT_Err_Ok;
return TT_Err_Ok;
}
@ -534,7 +534,7 @@
FT_UInt n_points = outline->n_points;
FT_UInt n_ins;
TT_GlyphZone* zone = &load->zone;
FT_Error error = FT_Err_Ok;
FT_Error error = TT_Err_Ok;
FT_UNUSED( debug ); /* used by truetype interpreter only */
@ -625,7 +625,7 @@
if ( error && load->exec->pedantic_hinting )
goto Exit;
error = FT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */
error = TT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */
}
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
@ -740,7 +740,7 @@
#endif
error = FT_Err_Ok;
error = TT_Err_Ok;
goto Exit;
}

View File

@ -152,7 +152,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL
FT_LOCAL_DEF
FT_Error TT_Init_Face( FT_Stream stream,
TT_Face face,
FT_Int face_index,
@ -207,7 +207,7 @@
return error;
Bad_Format:
error = FT_Err_Unknown_File_Format;
error = TT_Err_Unknown_File_Format;
goto Exit;
}
@ -223,7 +223,7 @@
/* <Input> */
/* face :: A pointer to the face object to destroy. */
/* */
FT_LOCAL
FT_LOCAL_DEF
void TT_Done_Face( TT_Face face )
{
FT_Memory memory = face->root.memory;
@ -276,7 +276,7 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL
FT_LOCAL_DEF
FT_Error TT_Init_Size( TT_Size size )
{
FT_Error error = TT_Err_Ok;

View File

@ -112,7 +112,7 @@
}
*max_advance = decoder.builder.advance.x;
return FT_Err_Ok;
return T1_Err_Ok;
}

View File

@ -226,7 +226,7 @@
if ( blend && blend->num_axis == num_coords )
{
/* recompute the weight vector from the blend coordinates */
error = FT_Err_Ok;
error = T1_Err_Ok;
for ( n = 0; n < blend->num_designs; n++ )
{
@ -251,7 +251,7 @@
blend->weight_vector[n] = result;
}
error = FT_Err_Ok;
error = T1_Err_Ok;
}
return error;
}

View File

@ -332,7 +332,7 @@
/* simply clear the error in case of failure (which really) */
/* means that out of memory or no unicode glyph names */
error = FT_Err_Ok;
error = T1_Err_Ok;
}
}
@ -403,7 +403,7 @@
/* <Input> */
/* driver :: A handle to the target Type 1 driver. */
/* */
FT_LOCAL
FT_LOCAL_DEF
void T1_Done_Driver( T1_Driver driver )
{
FT_UNUSED( driver );

View File

@ -207,7 +207,7 @@
"%!FontType", 10 ) ) )
{
FT_TRACE2(( "[not a Type1 font]\n" ));
error = FT_Err_Unknown_File_Format;
error = T1_Err_Unknown_File_Format;
}
else
{
@ -321,7 +321,7 @@
error = read_pfb_tag( stream, &tag, &size );
if ( error || tag != 0x8002 )
{
error = FT_Err_Ok;
error = T1_Err_Ok;
break;
}