* include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,

ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.

* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.

* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.

* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
This commit is contained in:
Werner Lemberg 2003-06-17 10:42:27 +00:00
parent 6ae53a79db
commit 052904e3a0
19 changed files with 152 additions and 91 deletions

View File

@ -1,3 +1,32 @@
2003-06-14 Werner Lemberg <wl@gnu.org>
* include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.
* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-13 Detlef Würkner <TetiSoft@apg.lahn.de>
* src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.

View File

@ -563,21 +563,21 @@ FT_BEGIN_HEADER
/* */
/* ft_encoding_apple_roman :: see @FT_ENCODING_APPLE_ROMAN */
/* */
#define ft_encoding_none FT_ENCODING_NONE
#define ft_encoding_unicode FT_ENCODING_UNICODE
#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
#define ft_encoding_sjis FT_ENCODING_MS_SJIS
#define ft_encoding_gb2312 FT_ENCODING_MS_GB2312
#define ft_encoding_big5 FT_ENCODING_MS_BIG5
#define ft_encoding_wansung FT_ENCODING_MS_WANSUNG
#define ft_encoding_johab FT_ENCODING_MS_JOHAB
#define ft_encoding_none FT_ENCODING_NONE
#define ft_encoding_unicode FT_ENCODING_UNICODE
#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
#define ft_encoding_sjis FT_ENCODING_MS_SJIS
#define ft_encoding_gb2312 FT_ENCODING_MS_GB2312
#define ft_encoding_big5 FT_ENCODING_MS_BIG5
#define ft_encoding_wansung FT_ENCODING_MS_WANSUNG
#define ft_encoding_johab FT_ENCODING_MS_JOHAB
#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
/*************************************************************************/
@ -1312,7 +1312,7 @@ FT_BEGIN_HEADER
/* */
/* outline :: The outline descriptor for the current glyph */
/* image if its format is */
/* ft_glyph_bitmap_outline. */
/* FT_GLYPH_FORMAT_OUTLINE. */
/* */
/* num_subglyphs :: The number of subglyphs in a composite glyph. */
/* This format is only valid for the composite */

View File

@ -316,11 +316,9 @@ FT_BEGIN_HEADER
/* convention. */
/* */
/* If the glyph has been loaded with FT_LOAD_NO_SCALE, `bbox_mode' */
/* must be set to `ft_glyph_bbox_unscaled' to get unscaled font */
/* units. */
/* */
/* If `bbox_mode' is set to `ft_glyph_bbox_subpixels' the bbox */
/* coordinates are returned in 26.6 pixels (i.e. 1/64th of pixels). */
/* must be set to `FT_GLYPH_BBOX_UNSCALED' to get unscaled font */
/* units in 26.6 pixel format. The value `FT_GLYPH_BBOX_SUBPIXELS' */
/* is another name for this constant. */
/* */
/* Note that the maximum coordinates are exclusive, which means that */
/* one can compute the width and height of the glyph image (be it in */
@ -330,7 +328,7 @@ FT_BEGIN_HEADER
/* height = bbox.yMax - bbox.yMin; */
/* */
/* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
/* `ft_glyph_bbox_gridfit', the coordinates will also be grid-fitted, */
/* `FT_GLYPH_BBOX_GRIDFIT', the coordinates will also be grid-fitted, */
/* which corresponds to: */
/* */
/* bbox.xMin = FLOOR(bbox.xMin); */
@ -339,21 +337,43 @@ FT_BEGIN_HEADER
/* bbox.yMax = CEILING(bbox.yMax); */
/* */
/* To get the bbox in pixel coordinates, set `bbox_mode' to */
/* `ft_glyph_bbox_truncate'. */
/* `FT_GLYPH_BBOX_TRUNCATE'. */
/* */
/* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
/* to `ft_glyph_bbox_pixels'. */
/* to `FT_GLYPH_BBOX_PIXELS'. */
/* */
/* The default value for `bbox_mode' is `ft_glyph_bbox_pixels'. */
/* */
enum
typedef enum FT_Glyph_BBox_Mode_
{
ft_glyph_bbox_unscaled = 0, /* return unscaled font units */
ft_glyph_bbox_subpixels = 0, /* return unfitted 26.6 coordinates */
ft_glyph_bbox_gridfit = 1, /* return grid-fitted 26.6 coordinates */
ft_glyph_bbox_truncate = 2, /* return coordinates in integer pixels */
ft_glyph_bbox_pixels = 3 /* return grid-fitted pixel coordinates */
};
FT_GLYPH_BBOX_UNSCALED = 0, /* return unscaled font units */
FT_GLYPH_BBOX_SUBPIXELS = 0, /* return unfitted 26.6 coordinates */
FT_GLYPH_BBOX_GRIDFIT = 1, /* return grid-fitted 26.6 coordinates */
FT_GLYPH_BBOX_TRUNCATE = 2, /* return coordinates in integer pixels */
FT_GLYPH_BBOX_PIXELS = 3 /* return grid-fitted pixel coordinates */
} FT_Glyph_BBox_Mode;
/*************************************************************************/
/* */
/* <Enum> */
/* ft_glyph_bbox_xxx */
/* */
/* <Description> */
/* These constats are deprecated. Use the corresponding */
/* @FT_Glyph_BBox_Mode values instead. */
/* */
/* <Values> */
/* ft_glyph_bbox_unscaled :: see @FT_GLYPH_BBOX_UNSCALED */
/* ft_glyph_bbox_subpixels :: see @FT_GLYPH_BBOX_SUBPIXELS */
/* ft_glyph_bbox_gridfit :: see @FT_GLYPH_BBOX_GRIDFIT */
/* ft_glyph_bbox_truncate :: see @FT_GLYPH_BBOX_TRUNCATE */
/* ft_glyph_bbox_pixels :: see @FT_GLYPH_BBOX_PIXELS */
/* */
#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
FT_EXPORT( void )
@ -412,7 +432,7 @@ FT_BEGIN_HEADER
/* // convert to a bitmap (default render mode + destroy old) */
/* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
/* { */
/* error = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_default, */
/* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */
/* 0, 1 ); */
/* if ( error ) // glyph unchanged */
/* ... */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
/* 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, */
@ -46,21 +46,28 @@ FT_BEGIN_HEADER
/* module bit flags */
typedef enum FT_Module_Flags_
{
ft_module_font_driver = 1, /* this module is a font driver */
ft_module_renderer = 2, /* this module is a renderer */
ft_module_hinter = 4, /* this module is a glyph hinter */
ft_module_styler = 8, /* this module is a styler */
#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
#define FT_MODULE_RENDERER 2 /* this module is a renderer */
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
ft_module_driver_scalable = 0x100, /* the driver supports scalable */
/* fonts */
ft_module_driver_no_outlines = 0x200, /* the driver does not support */
/* vector outlines */
ft_module_driver_has_hinter = 0x400 /* the driver provides its own */
/* hinter */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */
} FT_Module_Flags;
/* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
typedef void

View File

@ -411,25 +411,25 @@ FT_BEGIN_HEADER
#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_font_driver )
FT_MODULE_FONT_DRIVER )
#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_renderer )
FT_MODULE_RENDERER )
#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_hinter )
FT_MODULE_HINTER )
#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_styler )
FT_MODULE_STYLER )
#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_driver_scalable )
FT_MODULE_DRIVER_SCALABLE )
#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
ft_module_driver_no_outlines )
FT_MODULE_DRIVER_NO_OUTLINES )
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
ft_module_driver_has_hinter )
FT_MODULE_DRIVER_HAS_HINTER )
/*************************************************************************/

View File

@ -4,7 +4,7 @@
/* */
/* Auto-hinting module implementation (declaration). */
/* */
/* 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 */
@ -119,7 +119,7 @@
FT_CALLBACK_TABLE_DEF
const FT_Module_Class autohint_module_class =
{
ft_module_hinter,
FT_MODULE_HINTER,
sizeof ( FT_AutoHinterRec ),
"autohinter",

View File

@ -541,7 +541,8 @@
clazz->glyph_bbox( glyph, acbox );
/* perform grid fitting if needed */
if ( bbox_mode & ft_glyph_bbox_gridfit )
if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
bbox_mode == FT_GLYPH_BBOX_PIXELS )
{
acbox->xMin &= -64;
acbox->yMin &= -64;
@ -550,7 +551,8 @@
}
/* convert to integer pixels if needed */
if ( bbox_mode & ft_glyph_bbox_truncate )
if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
bbox_mode == FT_GLYPH_BBOX_PIXELS )
{
acbox->xMin >>= 6;
acbox->yMin >>= 6;

View File

@ -703,7 +703,8 @@ THE SOFTWARE.
const FT_Driver_ClassRec bdf_driver_class =
{
{
ft_module_font_driver,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_NO_OUTLINES,
sizeof ( FT_DriverRec ),
"bdf",

View File

@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
/* 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, */
@ -378,9 +378,9 @@
{
/* begin with the FT_Module_Class fields */
{
ft_module_font_driver |
ft_module_driver_scalable |
ft_module_driver_has_hinter,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
FT_MODULE_DRIVER_HAS_HINTER,
sizeof( CFF_DriverRec ),
"cff",

View File

@ -4,7 +4,7 @@
/* */
/* CID driver interface (body). */
/* */
/* 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, */
@ -69,9 +69,9 @@
{
/* first of all, the FT_Module_Class fields */
{
ft_module_font_driver |
ft_module_driver_scalable |
ft_module_driver_has_hinter ,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
FT_MODULE_DRIVER_HAS_HINTER,
sizeof( FT_DriverRec ),
"t1cid", /* module name */

View File

@ -520,7 +520,8 @@ THE SOFTWARE.
const FT_Driver_ClassRec pcf_driver_class =
{
{
ft_module_font_driver,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_NO_OUTLINES,
sizeof ( FT_DriverRec ),
"pcf",

View File

@ -129,8 +129,8 @@
const FT_Driver_ClassRec pfr_driver_class =
{
{
ft_module_font_driver |
ft_module_driver_scalable,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE,
sizeof( FT_DriverRec ),

View File

@ -276,8 +276,8 @@
FT_LOCAL_DEF( void )
ps_parser_skip_spaces( PS_Parser parser )
{
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
while ( cur < limit )
@ -296,8 +296,8 @@
FT_LOCAL_DEF( void )
ps_parser_skip_alpha( PS_Parser parser )
{
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
FT_Byte* cur = parser->cursor;
FT_Byte* limit = parser->limit;
while ( cur < limit )

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
/* 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, */
@ -212,7 +212,7 @@
const FT_Renderer_Class ft_raster1_renderer_class =
{
{
ft_module_renderer,
FT_MODULE_RENDERER,
sizeof( FT_RendererRec ),
"raster1",
@ -245,7 +245,7 @@
const FT_Renderer_Class ft_raster5_renderer_class =
{
{
ft_module_renderer,
FT_MODULE_RENDERER,
sizeof( FT_RendererRec ),
"raster5",

View File

@ -284,7 +284,7 @@
const FT_Renderer_Class ft_smooth_renderer_class =
{
{
ft_module_renderer,
FT_MODULE_RENDERER,
sizeof( FT_RendererRec ),
"smooth",
@ -313,7 +313,7 @@
const FT_Renderer_Class ft_smooth_lcd_renderer_class =
{
{
ft_module_renderer,
FT_MODULE_RENDERER,
sizeof( FT_RendererRec ),
"smooth-lcd",
@ -343,7 +343,7 @@
const FT_Renderer_Class ft_smooth_lcdv_renderer_class =
{
{
ft_module_renderer,
FT_MODULE_RENDERER,
sizeof( FT_RendererRec ),
"smooth-lcdv",

View File

@ -382,10 +382,10 @@
const FT_Driver_ClassRec tt_driver_class =
{
{
ft_module_font_driver |
ft_module_driver_scalable |
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
ft_module_driver_has_hinter,
FT_MODULE_DRIVER_HAS_HINTER,
#else
0,
#endif

View File

@ -231,9 +231,9 @@
const FT_Driver_ClassRec t1_driver_class =
{
{
ft_module_font_driver |
ft_module_driver_scalable |
ft_module_driver_has_hinter,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
FT_MODULE_DRIVER_HAS_HINTER,
sizeof( FT_DriverRec ),

View File

@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (body). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* Copyright 2002, 2003 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@ -123,10 +123,10 @@
const FT_Driver_ClassRec t42_driver_class =
{
{
ft_module_font_driver |
ft_module_driver_scalable |
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
ft_module_driver_has_hinter,
FT_MODULE_DRIVER_HAS_HINTER,
#else
0,
#endif

View File

@ -667,7 +667,8 @@
const FT_Driver_ClassRec winfnt_driver_class =
{
{
ft_module_font_driver,
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_NO_OUTLINES,
sizeof ( FT_DriverRec ),
"winfonts",