* include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func):

Use FT_UInt for ppem values.
* src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for
ppem values.
* src/sfnt/ttsbit.h: Updated.

* src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values
larger than -0FFFF.
This commit is contained in:
Werner Lemberg 2003-12-27 21:44:18 +00:00
parent 80cfbd7073
commit cb8ede4dca
5 changed files with 39 additions and 16 deletions

View File

@ -1,3 +1,14 @@
2003-12-26 Werner Lemberg <wl@gnu.org>
* include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func):
Use FT_UInt for ppem values.
* src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for
ppem values.
* src/sfnt/ttsbit.h: Updated.
* src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values
larger than -0FFFF.
2003-12-25 Werner Lemberg <wl@gnu.org>
* src/base/fttrigon.c, src/base/ftgloadr.c: Inlude

View File

@ -250,20 +250,27 @@ FT_BEGIN_HEADER
/* returns its metrics. */
/* */
/* <Input> */
/* face :: The target face object. */
/* face :: */
/* The target face object. */
/* */
/* x_ppem :: The horizontal resolution in points per EM. */
/* strike_index :: */
/* The strike index. */
/* */
/* y_ppem :: The vertical resolution in points per EM. */
/* glyph_index :: */
/* The current glyph index. */
/* */
/* glyph_index :: The current glyph index. */
/* load_flags :: */
/* The current load flags. */
/* */
/* stream :: The input stream. */
/* stream :: */
/* The input stream. */
/* */
/* <Output> */
/* amap :: The target pixmap. */
/* amap :: */
/* The target pixmap. */
/* */
/* ametrics :: A big sbit metrics structure for the glyph image. */
/* ametrics :: */
/* A big sbit metrics structure for the glyph image. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. Returns an error if no */
@ -307,8 +314,8 @@ FT_BEGIN_HEADER
/* */
typedef FT_Error
(*TT_Set_SBit_Strike_Func)( TT_Face face,
FT_Int x_ppem,
FT_Int y_ppem,
FT_UInt x_ppem,
FT_UInt y_ppem,
FT_ULong *astrike_index );

View File

@ -2080,7 +2080,6 @@
metrics = &face->size->metrics;
clazz = driver->clazz;
/* default processing -- this can be overridden by the driver */
if ( pixel_width == 0 )
pixel_width = pixel_height;
@ -2092,6 +2091,12 @@
if ( pixel_height < 1 )
pixel_height = 1;
/* use `>=' to avoid potention compiler warning on 16bit platforms */
if ( pixel_width >= 0xFFFFU )
pixel_width = 0xFFFFU;
if ( pixel_height >= 0xFFFFU )
pixel_height = 0xFFFFU;
metrics->x_ppem = (FT_UShort)pixel_width;
metrics->y_ppem = (FT_UShort)pixel_height;

View File

@ -622,14 +622,14 @@
FT_LOCAL_DEF( FT_Error )
tt_face_set_sbit_strike( TT_Face face,
FT_Int x_ppem,
FT_Int y_ppem,
FT_UInt x_ppem,
FT_UInt y_ppem,
FT_ULong *astrike_index )
{
FT_ULong i;
if ( x_ppem < 0 || x_ppem > 255 ||
if ( x_ppem > 255 ||
y_ppem < 1 || y_ppem > 255 )
return SFNT_Err_Invalid_PPem;

View File

@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (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, */
@ -37,8 +37,8 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
tt_face_set_sbit_strike( TT_Face face,
FT_Int x_ppem,
FT_Int y_ppem,
FT_UInt x_ppem,
FT_UInt y_ppem,
FT_ULong *astrike_index );
FT_LOCAL( FT_Error )