formatting, copyright years and messages, doc polishing

This commit is contained in:
Werner Lemberg 2007-01-09 10:37:36 +00:00
parent 4f7496eea2
commit cc7f12a429
9 changed files with 363 additions and 314 deletions

View File

@ -1,21 +1,22 @@
2007-01-08 David Turner <david@freetype.org>
* docs/CHANGES: updating documentation
* docs/CHANGES: Updated.
* include/freetype/ftgasp.h, src/base/ftgasp.c: adding a
new API FT_Get_Gasp to return entries of the GASP table
* include/freetype/ftgasp.h, src/base/ftgasp.c: New files which add
a new API `FT_Get_Gasp' to return entries of the `gasp' table
corresponding to a given character pixel size.
* src/sfnt/ttload.c: add version check for the GASP table,
in order to be better future-proof
* src/sfnt/ttload.c (tt_face_load_gasp): Add version check for the
`gasp' table, in order to avoid potential problems with later
versions.
* include/freetype/config/ftheader.h: add definition of
FT_GASP_H, corresponding to <freetype/ftgasp.h>
* include/freetype/config/ftheader.h (FT_GASP_H): New macro for
<freetype/ftgasp.h>.
* src/base/rules.mk, src/base/Jamfile, modules.cfg,
builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: Adding src/base/ftgasp.c
to the default build
* src/base/rules.mk (BASE_SRC), src/base/Jamfile (_sources),
modules.cfg (BASE_EXTENSIONS), builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype.vcproj: Add src/base/ftgasp.c to the
default build.
2007-01-07 Werner Lemberg <wl@gnu.org>

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -675,7 +675,7 @@
* A macro used in #include statements to name the file containing the
* FreeType 2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/*************************************************************************
@ -685,9 +685,9 @@
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType 2 API which returns entries from the TrueType GASP table
* FreeType 2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
#define FT_GASP_H <freetype/ftgasp.h>
/* */

View File

@ -1,65 +1,90 @@
/***************************************************************************/
/* */
/* ftgasp.h */
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007 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 _FT_GASP_H_
#define _FT_GASP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
/**
* @enum: FT_GASP_XXX
*
* @description:
* a list of values and/or bit-flags returned by the
* @FT_Get_Gasp function.
*
* @values:
* FT_GASP_NO_TABLE ::
* this special value means that there is no GASP table
* in this face. It's up to the client to decide what to
* do
*
* FT_GASP_DO_GRIDFIT ::
* indicates that grid-fitting/hinting should be
* performed at the specified ppem. This *really*
* means TrueType bytecode interpretation
*
* FT_GASP_DO_GRAY ::
* indicates that anti-aliased rendering should be
* performed at the specified ppem
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
* indicates that smoothing along multiple axis
* must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* indicates that grid-fitting must be used with
* ClearType's symmetric smoothing
*/
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/**
* @func: FT_Get_Gasp
*
* @description:
* read the GASP table from a TrueType or OpenType font file
* and return the entry corresponding to a given character
* pixel size
*
* @input:
* face :: source face handle
* ppem :: vertical character pixel size
*
* @return:
* bit flags, or @FT_GASP_NO_TABLE is there is no GASP table
* in the face.
*/
/*************************************************************************
*
* @enum:
* FT_GASP_XXX
*
* @description:
* A list of values and/or bit-flags returned by the @FT_Get_Gasp
* function.
*
* @values:
* FT_GASP_NO_TABLE ::
* This special value means that there is no GASP table in this face.
* It is up to the client to decide what to do.
*
* FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation.
*
* FT_GASP_DO_GRAY ::
* Anti-aliased rendering should be performed at the specified ppem.
*
* FT_GASP_SYMMETRIC_SMOOTHING ::
* Smoothing along multiple axes must be used with ClearType.
*
* FT_GASP_SYMMETRIC_GRIDFIT ::
* Grid-fitting must be used with ClearType's symmetric smoothing.
*
* @note:
* `ClearType' is Microsoft's implementation of LCD rendering, partly
* protected by patents.
*/
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
*
* @func:
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
*
* @input:
* face :: The source face handle.
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no
* `gasp' table in the face.
*/
FT_EXPORT( FT_Int )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
/* */
#endif /* _FT_GASP_H_ */
/* END */

View File

@ -1,6 +1,6 @@
# modules.cfg
#
# Copyright 2005, 2006 by
# Copyright 2005, 2006, 2007 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -1,6 +1,6 @@
# FreeType 2 src/base Jamfile
#
# Copyright 2001, 2002, 2003, 2004, 2005, 2006 by
# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,

View File

@ -1,22 +1,44 @@
/***************************************************************************/
/* */
/* ftgasp.c */
/* */
/* Access of TrueType's `gasp' table (body). */
/* */
/* Copyright 2007 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. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_GASP_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
FT_EXPORT_DEF( FT_Int )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem )
FT_Get_Gasp( FT_Face face,
FT_UInt ppem )
{
FT_Int result = FT_GASP_NO_TABLE;
if ( face && FT_IS_SFNT(face) )
if ( face && FT_IS_SFNT( face ) )
{
TT_Face ttface = (TT_Face)face;
if ( ttface->gasp.numRanges > 0 )
{
TT_GaspRange range = ttface->gasp.gaspRanges;
TT_GaspRange range_end = range + ttface->gasp.numRanges;
while ( ppem > range->maxPPEM )
{
range++;
@ -26,7 +48,7 @@
result = range->gaspFlag;
/* ensure we don't have spurious bits */
/* ensure that we don't have spurious bits */
if ( ttface->gasp.version == 0 )
result &= 3;
}
@ -36,3 +58,4 @@
}
/* END */

View File

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

View File

@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -1142,7 +1142,7 @@
if ( face->gasp.version >= 2 )
{
face->gasp.numRanges = 0;
error = FT_Err_Invalid_Table;
error = SFNT_Err_Invalid_Table;
goto Exit;
}