diff --git a/ChangeLog b/ChangeLog index 2d763525c..78beb6ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -77,9 +77,11 @@ * src/cache/ftlru.c: Fixed an invalid assertion check. - * src/autohint/ahglyph.h, src/autohint/ahglyph.c, - src/autohint/ahglobal.c, src/autohint/ahhint.c: Fixed blue-scale - problem. + * src/autohint/ahglyph.c (ah_outline_load): Add two scaling + arguments. + * src/autohint/ahglyph.h: Updated. + * src/autohint/ahhint.c (ah_hinter_load): Updated. + * src/autohint/ahglobal.c (ah_hinter_compute_widths): Updated. * src/cache/ftccache.c: Fixed small bug that could crash the cache in rare circumstances (mostly with broken fonts). @@ -169,8 +171,8 @@ Fixing the slight distortion problem that ocurred due to the latest auto-hinter changes. - * src/autohint/ahhint.c: Disabled the advance width "correction" - which seemed to provide more trouble than benefits. + * src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width + "correction" which seemed to provide more trouble than benefits. 2003-02-13 Graham Asher @@ -203,10 +205,16 @@ display a waterfall with a font without a Unicode charmap (e.g. SYMBOL.TTF). - * src/autohint/ahtypes.h, src/autohint/ahhint.c, src/base/ftobjs.c, - src/truetype/ttobjs.c: Implemented FT_CONFIG_CHESTER_BLUE_SCALE, - corresponding to the last patch from David Chester, but with a much - simpler (and saner) implementation. + Implemented FT_CONFIG_CHESTER_BLUE_SCALE, corresponding to the last + patch from David Chester, but with a much simpler (and saner) + implementation. + + * src/autohint/ahhint.c (ah_hinter_load_glyph) + [FT_CONFIG_CHESTER_BLUE_SCALE]: Try to optimize the y_scale so that + the top of non-capital letters is aligned on a pixel boundary + whenever possible. + + * src/base/ftobjs.c, src/truetype/ttobjs.c: * src/pshinter/pshalgo3.c: Improved the Postscript hinter. Getting rid of stem snapping seems to work well here (though the stems are @@ -217,7 +225,8 @@ 2003-01-22 David Chester - * src/autohint/ahhint.c: Small fix to the stem width optimization. + * src/autohint/ahhint.c (ah_compute_stem_width): Small fix to the + stem width optimization. 2003-01-22 David Turner @@ -308,8 +317,27 @@ [FT_CONFIG_OPTION_CHESTER_HINTS]: New macros to control individual features. - * src/autohint/ahglobal.h, src/autohint/ahglobal.c, - src/autohint/ahglyph.c, src/autohint/ahtypes.h: + * src/autohint/ahglobal.c (blue_chars) [FT_CONFIG_CHESTER_SMALL_F]: + Add blue zone for `fijkdbh'. + * src/autohint/ahglobal.h (AH_IS_TOP_BLUE) + [FT_CONFIG_CHESTER_SMALL_F]: Use `AH_BLUE_SMALL_F_TOP'. + * src/autohint/ahglyph.c (ah_outline_compute_edges) + [FT_CONFIG_CHESTER_SERIF]: Use `AH_EDGE_SERIF'. + (ah_outline_compute_blue_edges) [FT_CONFIG_CHESTER_SMALL_F]: + Increase threshold for `best_dist'. + * src/autohint/ahhint.c (ah_compute_stem_width) + [FT_CONFIG_CHESTER_SERIF]: Provide new version for improved serif + handling. + (ah_align_linked_edge) [FT_CONFIG_CHESTER_SERIF]: Use special + version of `ah_compute_stem_width'. + (ah_hint_edges_3) [FT_CONFIG_CHESTER_STEM]: A new algorithm for stem + alignment when stem widths are less than 1.5 pixels wide centers the + stem slightly off-center of the center of a pixel (this increases + sharpness and consistency). + [FT_CONFIG_CHESTER_SERIF]: Use special version of + `ah_compute_stem_width'. + * src/autohint/ahtypes.h [FT_CONFIG_CHESTER_SMALL_F]: Add + `AH_BLUE_SMALL_F_TOP'. 2003-01-11 David Turner @@ -328,10 +356,15 @@ 2003-01-08 Owen Taylor - * src/autohint/ahtypes.h, src/autohint/ahhint.c, - src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: Implemented the - FT_RENDER_MODE_LIGHT hinting mode in the auto and postscript - hinters. + Implemented the FT_RENDER_MODE_LIGHT hinting mode in the auto and + postscript hinters. + + * src/autohint/ahhint.c (ah_compute_stem_width): Handle + hinter->do_stem_adjust. + (ah_hinter_load_glyph): Set hinter->do_stem_adjust. + + * src/autohint/ahtypes.h (AH_HinterRec): Add `do_stem_adjust'. + * src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: * include/freetype/freetype.h (FT_Render_Mode): Add FT_RENDER_MODE_LIGHT. @@ -457,9 +490,13 @@ support fot the first GSUB lookups. Nothing that really compiles for now though. - * src/autohint/ahhint.c: Disabled serif stem width quantization. It - produces slightly better shapes though this is not distinguishable - with many fonts. + * src/autohint/ahhint.c (ah_align_serif_edge): Disabled serif stem + width quantization. It produces slightly better shapes though this + is not distinguishable with many fonts. + Remove other dead code. + + * src/Jamfile, src/*/Jamfile: Simplified. + Use $(FT2_SRC_DIR). 2002-11-06 David Turner diff --git a/include/freetype/ftbdf.h b/include/freetype/ftbdf.h index 71735e3c6..b3bfcb50e 100644 --- a/include/freetype/ftbdf.h +++ b/include/freetype/ftbdf.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing BDF-specific strings (specification). */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,20 +49,20 @@ FT_BEGIN_HEADER * FT_PropertyType * * @description: - * list of BDF property types + * A list of BDF property types. * * @values: * BDF_PROPERTY_TYPE_NONE :: - * value 0 is used to indicate a missing property + * Value 0 is used to indicate a missing property. * * BDF_PROPERTY_TYPE_ATOM :: - * property is a string atom + * Property is a string atom. * * BDF_PROPERTY_TYPE_INTEGER :: - * property is a 32-bit signed integer + * Property is a 32-bit signed integer. * * BDF_PROPERTY_TYPE_CARDINAL :: - * property is a 32-bit unsigned integer + * Property is a 32-bit unsigned integer. */ typedef enum { @@ -76,34 +76,39 @@ FT_BEGIN_HEADER /********************************************************************** * - * @type: BDF_Property + * @type: + * BDF_Property * * @description: - * handle to a @BDF_PropertyRec structure used to model a given - * BDF/PCF property + * A handle to a @BDF_PropertyRec structure to model a given + * BDF/PCF property. */ - typedef struct BDF_PropertyRec_* BDF_Property; + typedef struct BDF_PropertyRec_* BDF_Property; + /********************************************************************** * - * @struct: BDF_PropertyRec + * @struct: + * BDF_PropertyRec * * @description: - * models a given BDF/PCF property + * This structure models a given BDF/PCF property. * - * @note: - * type :: property type - * u.atom :: atom string, when type is @BDF_PROPERTY_TYPE_ATOM - * u.integer :: signed integer, when type is @BDF_PROPERTY_TYPE_INTEGER - * u.cardinal :: unsigned integer, when type is @BDF_PROPERTY_TYPE_CARDINAL + * @fields: + * type :: The property type. + * + * u.atom :: The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. + * u.integer :: A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. + * u.cardinal :: An unsigned integer, if type is + * @BDF_PROPERTY_TYPE_CARDINAL. */ - typedef struct BDF_PropertyRec_ + typedef struct BDF_PropertyRec_ { - BDF_PropertyType type; + BDF_PropertyType type; union { - const char* atom; - FT_Int32 integer; - FT_UInt32 cardinal; + const char* atom; + FT_Int32 integer; + FT_UInt32 cardinal; } u; @@ -121,7 +126,7 @@ FT_BEGIN_HEADER * * @input: * face :: - * handle to input face + * A handle to the input face. * * @output: * acharset_encoding :: @@ -131,7 +136,7 @@ FT_BEGIN_HEADER * Charset registry, as a C string, owned by the face. * * @return: - * FreeType rror code. 0 means success. + * FreeType error code. 0 means success. * * @note: * This function only works with BDF faces, returning an error otherwise. @@ -141,31 +146,33 @@ FT_BEGIN_HEADER const char* *acharset_encoding, const char* *acharset_registry ); + /********************************************************************** * * @function: * FT_Get_BDF_Property * * @description: - * Retrieves a BDF property from a BDF or PCF font file + * Retrieves a BDF property from a BDF or PCF font file. * * @input: - * face :: handle to input face - * name :: property name + * face :: A handle to the input face. + * + * name :: The property name. * * @output: - * aproperty :: the property + * aproperty :: The property. * * @return: * FreeType error code. 0 means success. * * @note: - * This function works with BDF _and_ PCF fonts. It returns an error - * otherwise. it also returns an error when the property is not in the + * This function works with BDF _and_ PCF fonts. It returns an error + * otherwise. It also returns an error if the property is not in the * font. * - * in case of error, "aproperty->type" is always set to - * @BDF_PROPERTY_TYPE_NONE + * In case of error, "aproperty->type" is always set to + * @BDF_PROPERTY_TYPE_NONE. */ FT_EXPORT( FT_Error ) FT_Get_BDF_Property( FT_Face face, diff --git a/include/freetype/ftgzip.h b/include/freetype/ftgzip.h index c254622fd..64e43aaeb 100644 --- a/include/freetype/ftgzip.h +++ b/include/freetype/ftgzip.h @@ -4,7 +4,7 @@ /* */ /* Gzip-compressed stream support. */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -40,47 +40,54 @@ FT_BEGIN_HEADER /* */ /*************************************************************************/ + /************************************************************************ * - * @type: FT_Stream_OpenGzip + * @function: + * FT_Stream_OpenGzip * * @description: - * open a new stream to parse gzip-compressed font files. This is + * Open a new stream to parse gzip-compressed font files. This is * mainly used to support the compressed *.pcf.gz fonts that come - * with XFree86 + * with XFree86. * * @input: - * stream :: target embedding stream - * source :: source stream, used to + * stream :: The target embedding stream. + * + * source :: The source stream. * * @return: - * error code. 0 means success + * FreeType error code. 0 means success. * * @note: - * the source stream must be opened _before_ calling this function. + * The source stream must be opened _before_ calling this function. * - * calling @FT_Stream_Close on the new stream will *not* call - * @FT_Stream_Close on the source stream. None of the stream objects + * Calling @FT_Stream_Close on the new stream will *not* call + * @FT_Stream_Close on the source stream. None of the stream objects * will be released to the heap. * - * the stream implementation is very basic, and resets the decompression - * process each time seeking backwards is needed within the stream + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream. * - * in certain builds of the library, gzip compression recognition is - * automatic when calling @FT_New_Face or @FT_Open_Face. This means that - * if no font driver is capable of handling the raw compressed file, - * the library will try to open a gzip stream from it and re-open - * the face with it. + * In certain builds of the library, gzip compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a gzipped stream from + * it and re-open the face with it. * - * this function may return "FT_Err_Unimplemented" if your build of + * This function may return "FT_Err_Unimplemented" if your build of * FreeType was not compiled with zlib support. */ FT_EXPORT( FT_Error ) - FT_Stream_OpenGzip( FT_Stream stream, - FT_Stream source ); + FT_Stream_OpenGzip( FT_Stream stream, + FT_Stream source ); /* */ + FT_END_HEADER #endif /* __FTGZIP_H__ */ + + +/* END */ diff --git a/include/freetype/ftincrem.h b/include/freetype/ftincrem.h index c9e8b56d6..53909871a 100644 --- a/include/freetype/ftincrem.h +++ b/include/freetype/ftincrem.h @@ -4,7 +4,7 @@ /* */ /* FreeType incremental loading (specification). */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -186,10 +186,10 @@ FT_BEGIN_HEADER */ typedef FT_Error (*FT_Incremental_GetGlyphMetricsFunc) - ( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Bool vertical, - FT_Incremental_MetricsRec *ametrics ); + ( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Bool vertical, + FT_Incremental_MetricsRec *ametrics ); /************************************************************************** diff --git a/include/freetype/ftpfr.h b/include/freetype/ftpfr.h index 212539101..7b687dacc 100644 --- a/include/freetype/ftpfr.h +++ b/include/freetype/ftpfr.h @@ -2,9 +2,9 @@ /* */ /* ftpfr.h */ /* */ -/* FreeType API for accessing PFR-specific data */ +/* FreeType API for accessing PFR-specific data (specification only). */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,42 +49,44 @@ FT_BEGIN_HEADER * FT_Get_PFR_Metrics * * @description: - * returns the outline and metrics resolutions of a given PFR - * face. + * Return the outline and metrics resolutions of a given PFR face. * * @input: - * face :: handle to input face. It can be a non-PFR face. + * face :: Handle to the input face. It can be a non-PFR face. * * @output: * aoutline_resolution :: - * outline resolution. This is equivalent to "face->units_per_EM". - * optional (parameter can be NULL) + * Outline resolution. This is equivalent to `face->units_per_EM'. + * Optional (parameter can be NULL). * * ametrics_resolution :: - * metrics_resolution. This is equivalent to "outline_resolution" - * for non-PFR fonts. can be NULL - * optional (parameter can be NULL) + * Metrics resolution. This is equivalent to `outline_resolution' + * for non-PFR fonts. Optional (parameter can be NULL). * * ametrics_x_scale :: - * a 16.16 fixed-point number used to scale distance expressed - * in metrics units to device sub-pixels. This is equivalent to - * 'face->size->x_scale', but for metrics only. - * optional (parameter can be NULL) + * A 16.16 fixed-point number used to scale distance expressed + * in metrics units to device sub-pixels. This is equivalent to + * `face->size->x_scale', but for metrics only. Optional (parameter + * can be NULL) * * ametrics_y_scale :: - * same as 'ametrics_x_scale', but for the vertical direction. + * Same as `ametrics_x_scale' but for the vertical direction. * optional (parameter can be NULL) * + * @return: + * FreeType error code. 0 means success. + * * @note: - * if the input face is not a PFR, this function will return an error. + * If the input face is not a PFR, this function will return an error. * However, in all cases, it will return valid values. */ FT_EXPORT( FT_Error ) - FT_Get_PFR_Metrics( FT_Face face, - FT_UInt *aoutline_resolution, - FT_UInt *ametrics_resolution, - FT_Fixed *ametrics_x_scale, - FT_Fixed *ametrics_y_scale ); + FT_Get_PFR_Metrics( FT_Face face, + FT_UInt *aoutline_resolution, + FT_UInt *ametrics_resolution, + FT_Fixed *ametrics_x_scale, + FT_Fixed *ametrics_y_scale ); + /********************************************************************** * @@ -92,25 +94,30 @@ FT_BEGIN_HEADER * FT_Get_PFR_Kerning * * @description: - * returns the kerning pair corresponding to two glyphs in - * a PFR face. The distance is expressed in metrics units, unlike - * the result of @FT_Get_Kerning. + * Return the kerning pair corresponding to two glyphs in a PFR face. + * The distance is expressed in metrics units, unlike the result of + * @FT_Get_Kerning. * * @input: - * face :: handle to input face. - * left :: left glyph index - * right :: right glyph index + * face :: A handle to the input face. + * + * left :: Index of the left glyph. + * + * right :: Index of the right glyph. * * @output: - * avector :: kerning vector + * avector :: A kerning vector. + * + * @return: + * FreeType error code. 0 means success. * * @note: - * this function always return distances in original PFR metrics - * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED - * mode, which always return distances converted to outline units. + * This function always return distances in original PFR metrics + * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED + * mode, which always returns distances converted to outline units. * - * you can use the value of the 'x_scale' and 'y_scale' parameters - * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels + * You can use the value of the `x_scale' and `y_scale' parameters + * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. */ FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning( FT_Face face, @@ -118,36 +125,39 @@ FT_BEGIN_HEADER FT_UInt right, FT_Vector *avector ); + /********************************************************************** * * @function: * FT_Get_PFR_Advance * * @description: - * returns a given glyph advance, expressed in original metrics units, + * Return a given glyph advance, expressed in original metrics units, * from a PFR font. * * @input: - * face :: handle to input face. - * gindex :: glyph index + * face :: A handle to the input face. + * + * gindex :: The glyph index. * * @output: - * aadvance :: glyph advance in metrics units + * aadvance :: The glyph advance in metrics units. * * @return: - * error code. 0 means success + * FreeType error code. 0 means success. * * @note: - * you can use the 'x_scale' or 'y_scale' results of @FT_Get_PFR_Metrics - * to convert the advance to device sub-pixels (i.e. 1/64th of pixels) + * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics + * to convert the advance to device sub-pixels (i.e. 1/64th of pixels). */ FT_EXPORT( FT_Error ) - FT_Get_PFR_Advance( FT_Face face, - FT_UInt gindex, - FT_Pos *aadvance ); + FT_Get_PFR_Advance( FT_Face face, + FT_UInt gindex, + FT_Pos *aadvance ); /* */ + FT_END_HEADER #endif /* __FTBDF_H__ */ diff --git a/include/freetype/ftwinfnt.h b/include/freetype/ftwinfnt.h index 6d29fe16a..9b308af27 100644 --- a/include/freetype/ftwinfnt.h +++ b/include/freetype/ftwinfnt.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing Windows fnt-specific data. */ /* */ -/* Copyright 2002 by */ +/* Copyright 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -93,31 +93,31 @@ FT_BEGIN_HEADER } FT_WinFNT_HeaderRec, *FT_WinFNT_Header; - /********************************************************************** * * @function: * FT_Get_WinFNT_Header * * @description: - * Retrieves a Windows FNT font info header. + * Retrieve a Windows FNT font info header. * * @input: - * face :: handle to input face + * face :: A handle to the input face. * * @output: - * header :: WinFNT header. + * aheader :: The WinFNT header. * * @return: * FreeType error code. 0 means success. * * @note: - * This function only works with Windows FNT faces, returning an erro + * This function only works with Windows FNT faces, returning an error * otherwise. */ FT_EXPORT( FT_Error ) - FT_Get_WinFNT_Header( FT_Face face, - FT_WinFNT_HeaderRec *header ); + FT_Get_WinFNT_Header( FT_Face face, + FT_WinFNT_HeaderRec *aheader ); + /* */ diff --git a/include/freetype/internal/fnttypes.h b/include/freetype/internal/fnttypes.h index a85d6abae..65881888f 100644 --- a/include/freetype/internal/fnttypes.h +++ b/include/freetype/internal/fnttypes.h @@ -5,7 +5,7 @@ /* Basic Windows FNT/FON type definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 927615086..483e6ecdc 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (specification). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -539,26 +539,28 @@ FT_BEGIN_HEADER /* */ /* - * free the bitmap of a given glyphslot when needed - * (i.e. only when it was allocated with ft_glyphslot_alloc_bitmap) + * Free the bitmap of a given glyphslot when needed + * (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap). */ FT_BASE( void ) ft_glyphslot_free_bitmap( FT_GlyphSlot slot ); + /* - * allocate a new bitmap buffer in a glyph slot + * Allocate a new bitmap buffer in a glyph slot. */ FT_BASE( FT_Error ) ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot, FT_ULong size ); + /* - * set the bitmap buffer in a glyph slot to a given pointer. - * the buffer will not be freed by a later call to ft_glyphslot_free_bitmap + * Set the bitmap buffer in a glyph slot to a given pointer. + * The buffer will not be freed by a later call to ft_glyphslot_free_bitmap. */ FT_BASE( void ) - ft_glyphslot_set_bitmap( FT_GlyphSlot slot, - FT_Pointer buffer ); + ft_glyphslot_set_bitmap( FT_GlyphSlot slot, + FT_Pointer buffer ); /*************************************************************************/ diff --git a/include/freetype/internal/pcftypes.h b/include/freetype/internal/pcftypes.h index 2c924d7d1..382796ffb 100644 --- a/include/freetype/internal/pcftypes.h +++ b/include/freetype/internal/pcftypes.h @@ -2,7 +2,7 @@ FreeType font driver for pcf fonts - Copyright (C) 2000-2001 by + Copyright (C) 2000, 2001, 2002 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/include/freetype/internal/pfr.h b/include/freetype/internal/pfr.h index cead07818..51be6202c 100644 --- a/include/freetype/internal/pfr.h +++ b/include/freetype/internal/pfr.h @@ -1,9 +1,28 @@ -#ifndef __FT_INTERNAL_PFR_H__ -#define __FT_INTERNAL_PFR_H__ +/***************************************************************************/ +/* */ +/* pfr.h */ +/* */ +/* Internal PFR service functions (specification only). */ +/* */ +/* Copyright 2002, 2003 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 __PFR_H__ +#define __PFR_H__ #include #include FT_FREETYPE_H + FT_BEGIN_HEADER typedef FT_Error (*FT_PFR_GetMetricsFunc)( FT_Face face, @@ -21,16 +40,21 @@ FT_BEGIN_HEADER FT_UInt gindex, FT_Pos *aadvance ); - typedef struct FT_PFR_ServiceRec_ + + typedef struct FT_PFR_ServiceRec_ { - FT_PFR_GetMetricsFunc get_metrics; - FT_PFR_GetKerningFunc get_kerning; - FT_PFR_GetAdvanceFunc get_advance; + FT_PFR_GetMetricsFunc get_metrics; + FT_PFR_GetKerningFunc get_kerning; + FT_PFR_GetAdvanceFunc get_advance; } FT_PFR_ServiceRec, *FT_PFR_Service; -#define FT_PFR_SERVICE_NAME "pfr" +#define FT_PFR_SERVICE_NAME "pfr" + FT_END_HEADER -#endif /* __FT_INTERNAL_PFR_H__ */ +#endif /* __PFR_H__ */ + + +/* END */ diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h index c5f3bd3c9..10b227553 100644 --- a/include/freetype/internal/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -4,7 +4,7 @@ /* */ /* High-level `sfnt' driver interface (specification). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -463,14 +463,15 @@ FT_BEGIN_HEADER /* SFNT_Load_Table_Func */ /* */ /* */ - /* Loads a given SFNT table in memory */ + /* Loads a given SFNT table into memory. */ /* */ typedef FT_Error - (*SFNT_Load_Table_Func)( FT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); + (*SFNT_Load_Table_Func)( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); + /*************************************************************************/ /* */ diff --git a/include/freetype/ttnameid.h b/include/freetype/ttnameid.h index 9428ac643..54d107ca1 100644 --- a/include/freetype/ttnameid.h +++ b/include/freetype/ttnameid.h @@ -4,7 +4,7 @@ /* */ /* TrueType name ID definitions (specification only). */ /* */ -/* Copyright 1996-2002 by */ +/* Copyright 1996-2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -257,8 +257,8 @@ FT_BEGIN_HEADER * Corresponds to Microsoft Johab encoding. See @FT_ENCODING_MS_JOHAB. * * TT_MS_ID_UCS_4 :: - * Corresponds to UCS-4 or UTF-32 charmaps. This has been added into - * OpenType specification as of version 1.4 (mid-2001.) + * Corresponds to UCS-4 or UTF-32 charmaps. This has been added to + * the OpenType specification version 1.4 (mid-2001.) */ #define TT_MS_ID_SYMBOL_CS 0 diff --git a/include/freetype/tttables.h b/include/freetype/tttables.h index 45996322c..0a78ef968 100644 --- a/include/freetype/tttables.h +++ b/include/freetype/tttables.h @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002, 2003 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -593,6 +593,7 @@ FT_BEGIN_HEADER FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ); + /************************************************************************** * * @@ -602,54 +603,56 @@ FT_BEGIN_HEADER * Loads any font table into client memory. * * - * face :: handle to source face. - * tag :: the 4-byte tag of the table to load. Use the value 0 if - * you want to access the whole font file. Else, you can use - * one of the definitions found in the @FT_TRUETYPE_TAGS_H - * file, or forge a new one with @FT_MAKE_TAG + * face :: A handle to the source face. + * + * tag :: The 4-byte tag of the table to load. Use the value 0 if + * you want to access the whole font file. Otherwise, you can + * use one of the definitions found in the @FT_TRUETYPE_TAGS_H + * file, or forge a new one with @FT_MAKE_TAG. * - * offset :: the starting offset in the table (or file if tag == 0) + * offset :: The starting offset in the table (or file if tag == 0). * * - * buffer :: target buffer address. client must ensure that there are - * enough bytes in it. + * buffer :: The target buffer address. The client must ensure that + * the memory array is big enough to hold the data. * * - * length :: if the 'length' parameter is NULL, then try to load the whole - * table, and return an error code if it fails. + * length :: If the `length' parameter is NULL, then try to load the whole + * table. Return an error code if it fails. * - * else, if '*length' is 0, then exit immediately while returning + * Else, if `*length' is 0, exit immediately while returning * the table's (or file) full size in it. * - * else, the number of bytes to read from the table or file, + * Else the number of bytes to read from the table or file, * from the starting offset. * * - * error code. 0 means success + * FreeType error code. 0 means success. * * - * if you need to determine the table's length you should first call this - * function with "*length" set to 0, as in the following example: + * If you need to determine the table's length you should first call this + * function with `*length' set to 0, as in the following example: * * { * FT_ULong length = 0; * + * * error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); * if ( error ) { ... table does not exist ... } * * buffer = malloc( length ); - * if ( buffer == NULL ) { ... not enough memory ... } + * if ( buffer == NULL ) { ... not enough memory ... } * * error = FT_Load_Sfnt_Table( face,tag, 0, buffer, &length ); * if ( error ) { ... could not load table ... } * } */ FT_EXPORT( FT_Error ) - FT_Load_Sfnt_Table( FT_Face face, - FT_ULong tag, - FT_Long offset, - FT_Byte* buffer, - FT_ULong* length ); + FT_Load_Sfnt_Table( FT_Face face, + FT_ULong tag, + FT_Long offset, + FT_Byte* buffer, + FT_ULong* length ); /* */ diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c index efce3444d..f6fdd90bb 100644 --- a/src/autohint/ahglobal.c +++ b/src/autohint/ahglobal.c @@ -4,7 +4,7 @@ /* */ /* Routines used to compute global metrics automatically (body). */ /* */ -/* Copyright 2000-2001, 2002 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -323,7 +323,8 @@ if ( error ) goto Exit; - error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, hinter->face ); + error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, + hinter->face ); if ( error ) goto Exit; diff --git a/src/autohint/ahglobal.h b/src/autohint/ahglobal.h index ef99a01fd..5a9bcf835 100644 --- a/src/autohint/ahglobal.h +++ b/src/autohint/ahglobal.h @@ -5,7 +5,7 @@ /* Routines used to compute global metrics automatically */ /* (specification). */ /* */ -/* Copyright 2000-2001, 2002 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -34,16 +34,16 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_CHESTER_SMALL_F -# define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ - (b) == AH_BLUE_SMALL_F_TOP || \ - (b) == AH_BLUE_SMALL_TOP ) +#define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ + (b) == AH_BLUE_SMALL_F_TOP || \ + (b) == AH_BLUE_SMALL_TOP ) -#else /* !CHESTER_SMALL_F */ +#else /* !FT_CONFIG_CHESTER_SMALL_F */ -# define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ - (b) == AH_BLUE_SMALL_TOP ) +#define AH_IS_TOP_BLUE( b ) ( (b) == AH_BLUE_CAPITAL_TOP || \ + (b) == AH_BLUE_SMALL_TOP ) -#endif /* !CHESTER_SMALL_F */ +#endif /* !FT_CONFIG_CHESTER_SMALL_F */ /* compute global metrics automatically */ diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c index 4f375045f..b371c55eb 100644 --- a/src/autohint/ahglyph.c +++ b/src/autohint/ahglyph.c @@ -5,7 +5,7 @@ /* Routines used to load and analyze a given glyph before hinting */ /* (body). */ /* */ -/* Copyright 2000-2001, 2002 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -1358,12 +1358,12 @@ } else edge->link = edge2; -#else /* !CHESTER_SERIF */ +#else /* !FT_CONFIG_CHESTER_SERIF */ if ( is_serif ) edge->serif = edge2; else edge->link = edge2; -#endif +#endif /* !FT_CONFIG_CHESTER_SERIF */ } seg = seg->edge_next; @@ -1493,7 +1493,7 @@ best_dist = 64 / 2; #else if ( best_dist > 64 / 4 ) - best_dist = 64 / 4; + best_dist = 64 / 4; #endif for ( blue = AH_BLUE_CAPITAL_TOP; blue < AH_BLUE_MAX; blue++ ) diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c index 5814e37ab..9585d4ca0 100644 --- a/src/autohint/ahhint.c +++ b/src/autohint/ahhint.c @@ -4,7 +4,7 @@ /* */ /* Glyph hinter (body). */ /* */ -/* Copyright 2000-2001, 2002 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -88,7 +88,9 @@ /* compute the snapped width of a given stem */ + #ifdef FT_CONFIG_CHESTER_SERIF + static FT_Pos ah_compute_stem_width( AH_Hinter hinter, int vertical, @@ -218,7 +220,9 @@ return dist; } -#else /* !CHESTER_SERIF */ + +#else /* !FT_CONFIG_CHESTER_SERIF */ + static FT_Pos ah_compute_stem_width( AH_Hinter hinter, int vertical, @@ -332,7 +336,8 @@ return dist; } -#endif /* !CHESTER_SERIF */ + +#endif /* !FT_CONFIG_CHESTER_SERIF */ /* align one stem edge relative to the previous stem edge */ @@ -345,6 +350,7 @@ FT_Pos dist = stem_edge->opos - base_edge->opos; #ifdef FT_CONFIG_CHESTER_SERIF + FT_Pos fitted_width = ah_compute_stem_width( hinter, vertical, dist, @@ -352,10 +358,14 @@ stem_edge->flags ); stem_edge->pos = base_edge->pos + fitted_width; + #else + stem_edge->pos = base_edge->pos + ah_compute_stem_width( hinter, vertical, dist ); + #endif + } @@ -509,7 +519,9 @@ if ( !anchor ) { + #ifdef FT_CONFIG_CHESTER_STEM + FT_Pos org_len, org_center, cur_len; FT_Pos cur_pos1, error1, error2, u_off, d_off; @@ -556,14 +568,18 @@ edge->flags |= AH_EDGE_DONE; ah_align_linked_edge( hinter, edge, edge2, dimension ); -#else /* !CHESTER_STEM */ + +#else /* !FT_CONFIG_CHESTER_STEM */ + edge->pos = ( edge->opos + 32 ) & -64; anchor = edge; edge->flags |= AH_EDGE_DONE; ah_align_linked_edge( hinter, edge, edge2, dimension ); -#endif /* !CHESTER_STEM */ + +#endif /* !FT_CONFIG_CHESTER_STEM */ + } else { @@ -576,13 +592,19 @@ org_center = org_pos + ( org_len >> 1 ); #ifdef FT_CONFIG_CHESTER_SERIF + cur_len = ah_compute_stem_width( hinter, dimension, org_len, edge->flags, edge2->flags ); -#else /* !CHESTER_SERIF */ + + +#else /* !FT_CONFIG_CHESTER_SERIF */ + cur_len = ah_compute_stem_width( hinter, dimension, org_len ); -#endif /* !CHESTER_SERIF */ + +#endif /* !FT_CONFIG_CHESTER_SERIF */ #ifdef FT_CONFIG_CHESTER_STEM + if ( cur_len < 96 ) { FT_Pos u_off, d_off; @@ -638,7 +660,7 @@ edge2->pos = edge->pos + cur_len; } -#else /* !CHESTER_STEM */ +#else /* !FT_CONFIG_CHESTER_STEM */ cur_pos1 = ( org_pos + 32 ) & -64; delta1 = ( cur_pos1 + ( cur_len >> 1 ) - org_center ); @@ -653,7 +675,7 @@ edge->pos = ( delta1 <= delta2 ) ? cur_pos1 : cur_pos2; edge2->pos = edge->pos + cur_len; -#endif /* !CHESTER_STEM */ +#endif /* !FT_CONFIG_CHESTER_STEM */ edge->flags |= AH_EDGE_DONE; edge2->flags |= AH_EDGE_DONE; @@ -1662,6 +1684,7 @@ } #ifdef FT_CONFIG_CHESTER_BLUE_SCALE + /* try to optimize the y_scale so that the top of non-capital letters * is aligned on a pixel boundary whenever possible */ @@ -1689,6 +1712,7 @@ } } } + #endif /* FT_CONFIG_CHESTER_BLUE_SCALE */ /* now, we must check the current character pixel size to see if we */ diff --git a/src/autohint/ahtypes.h b/src/autohint/ahtypes.h index fb1458617..c5cf27a8f 100644 --- a/src/autohint/ahtypes.h +++ b/src/autohint/ahtypes.h @@ -5,7 +5,7 @@ /* General types and definitions for the auto-hint module */ /* (specification only). */ /* */ -/* Copyright 2000-2001, 2002 Catharon Productions Inc. */ +/* Copyright 2000-2001, 2002, 2003 Catharon Productions Inc. */ /* Author: David Turner */ /* */ /* This file is part of the Catharon Typography Project and shall only */ @@ -387,24 +387,24 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_CHESTER_SMALL_F -# define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ -# define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ -# define AH_BLUE_SMALL_F_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* fijkdbh */ -# define AH_BLUE_SMALL_TOP ( AH_BLUE_SMALL_F_TOP + 1 ) /* xzroesc */ -# define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ -# define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ -# define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) +#define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ +#define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ +#define AH_BLUE_SMALL_F_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1 ) /* fijkdbh */ +#define AH_BLUE_SMALL_TOP ( AH_BLUE_SMALL_F_TOP + 1 ) /* xzroesc */ +#define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ +#define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ +#define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) -#else /* !CHESTER_SMALL_F */ +#else /* !FT_CONFIG_CHESTER_SMALL_F */ -# define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ -# define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ -# define AH_BLUE_SMALL_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1) /* xzroesc */ -# define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ -# define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ -# define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) +#define AH_BLUE_CAPITAL_TOP 0 /* THEZOCQS */ +#define AH_BLUE_CAPITAL_BOTTOM ( AH_BLUE_CAPITAL_TOP + 1 ) /* HEZLOCUS */ +#define AH_BLUE_SMALL_TOP ( AH_BLUE_CAPITAL_BOTTOM + 1) /* xzroesc */ +#define AH_BLUE_SMALL_BOTTOM ( AH_BLUE_SMALL_TOP + 1 ) /* xzroesc */ +#define AH_BLUE_SMALL_MINOR ( AH_BLUE_SMALL_BOTTOM + 1 ) /* pqgjy */ +#define AH_BLUE_MAX ( AH_BLUE_SMALL_MINOR + 1 ) -#endif /* !CHESTER_SMALL_F */ +#endif /* !FT_CONFIG_CHESTER_SMALL_F */ typedef FT_Int AH_Blue;