* src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph),

src/ttdriver.c (Load_Glyph): Change type of `glyph_index' to
FT_UInt.  From Lex Warners.


* src/sfnt/ttload.c (tt_face_load_sfnt_header): Really fix change
from 2004-03-19.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.

* src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
`static.'.
Remove unused function `RepadBitmap'.
* src/pcf/pcfdrivr.c: Don't include pcfutil.h.
This commit is contained in:
Werner Lemberg 2004-04-19 06:13:50 +00:00
parent 2a37b3055d
commit c3dc56b85c
9 changed files with 43 additions and 114 deletions

View File

@ -1,3 +1,21 @@
2004-04-18 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph),
src/ttdriver.c (Load_Glyph): Change type of `glyph_index' to
FT_UInt. From Lex Warners.
2004-04-17 Chisato Yamauchi <cyamauch@a.phys.nagoya-u.ac.jp>
* src/sfnt/ttload.c (tt_face_load_sfnt_header): Really fix change
from 2004-03-19.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.
* src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
`static.'.
Remove unused function `RepadBitmap'.
* src/pcf/pcfdrivr.c: Don't include pcfutil.h.
2004-04-16 Werner Lemberg <wl@gnu.org>
* builds/unix/freetype-config.in (usage): Fix and improve usage

View File

@ -478,10 +478,10 @@ THE SOFTWARE.
if ( FT_NEW_ARRAY( face->charset_encoding,
strlen( charset_encoding->value.atom ) + 1 ) )
ft_strlen( charset_encoding->value.atom ) + 1 ) )
goto Exit;
if ( FT_NEW_ARRAY( face->charset_registry,
strlen( charset_registry->value.atom ) + 1 ) )
ft_strlen( charset_registry->value.atom ) + 1 ) )
goto Exit;
ft_strcpy( face->charset_registry, charset_registry->value.atom );

View File

@ -37,7 +37,6 @@ THE SOFTWARE.
#include "pcf.h"
#include "pcfdrivr.h"
#include "pcfutil.h"
#include "pcfread.h"
#include "pcferror.h"

View File

@ -25,6 +25,8 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
/* Modified for use with FreeType */
#include <ft2build.h>
#include "pcfutil.h"
@ -72,7 +74,7 @@ in this Software without prior written authorization from The Open Group.
* Invert bit order within each BYTE of an array.
*/
void
static void
BitOrderInvert( unsigned char* buf,
int nbytes )
{
@ -88,7 +90,7 @@ in this Software without prior written authorization from The Open Group.
* Invert byte order within each 16-bits of an array.
*/
void
static void
TwoByteSwap( unsigned char* buf,
int nbytes )
{
@ -107,7 +109,7 @@ in this Software without prior written authorization from The Open Group.
* Invert byte order within each 32-bits of an array.
*/
void
static void
FourByteSwap( unsigned char* buf,
int nbytes )
{
@ -127,89 +129,4 @@ in this Software without prior written authorization from The Open Group.
}
/*
* Repad a bitmap.
*/
int
RepadBitmap( char* pSrc,
char* pDst,
unsigned int srcPad,
unsigned int dstPad,
int width,
int height )
{
int srcWidthBytes, dstWidthBytes;
int row, col;
char *pTmpSrc, *pTmpDst;
switch ( srcPad )
{
case 1:
srcWidthBytes = ( width + 7 ) >> 3;
break;
case 2:
srcWidthBytes = ( ( width + 15 ) >> 4 ) << 1;
break;
case 4:
srcWidthBytes = ( ( width + 31 ) >> 5 ) << 2;
break;
case 8:
srcWidthBytes = ( ( width + 63 ) >> 6 ) << 3;
break;
default:
return 0;
}
switch ( dstPad )
{
case 1:
dstWidthBytes = ( width + 7 ) >> 3;
break;
case 2:
dstWidthBytes = ( ( width + 15 ) >> 4 ) << 1;
break;
case 4:
dstWidthBytes = ( ( width + 31 ) >> 5 ) << 2;
break;
case 8:
dstWidthBytes = ( ( width + 63 ) >> 6 ) << 3;
break;
default:
return 0;
}
width = srcWidthBytes;
if ( width > dstWidthBytes )
width = dstWidthBytes;
pTmpSrc= pSrc;
pTmpDst= pDst;
for ( row = 0; row < height; row++ )
{
for ( col = 0; col < width; col++ )
*pTmpDst++ = *pTmpSrc++;
while ( col < dstWidthBytes )
{
*pTmpDst++ = '\0';
col++;
}
pTmpSrc += srcWidthBytes - width;
}
return dstWidthBytes * height;
}
/* END */

View File

@ -2,7 +2,7 @@
FreeType font driver for pcf fonts
Copyright 2000-2001 by
Copyright 2000, 2001, 2004 by
Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy
@ -32,25 +32,18 @@ THE SOFTWARE.
#include <ft2build.h>
void
static void
BitOrderInvert( unsigned char* buf,
int nbytes);
void
static void
TwoByteSwap( unsigned char* buf,
int nbytes);
void
static void
FourByteSwap( unsigned char* buf,
int nbytes);
int
RepadBitmap( char* pSrc,
char* pDst,
unsigned int srcPad,
unsigned int dstPad,
int width,
int height);
#endif /* __PCFUTIL_H__ */

View File

@ -276,7 +276,7 @@
SFNT_Header sfnt )
{
FT_Error error;
FT_ULong format_tag, offset;
FT_ULong font_format_tag, format_tag, offset;
FT_Memory memory = stream->memory;
static const FT_Frame_Field sfnt_header_fields[] =
@ -318,10 +318,12 @@
/* */
offset = FT_STREAM_POS();
if ( FT_READ_ULONG( format_tag ) )
if ( FT_READ_ULONG( font_format_tag ) )
goto Exit;
if ( format_tag == TTAG_ttcf )
format_tag = font_format_tag;
if ( font_format_tag == TTAG_ttcf )
{
FT_Int n;
@ -353,8 +355,8 @@
/* seek to the appropriate TrueType file, then read tag */
offset = face->ttc_header.offsets[face_index];
if ( FT_STREAM_SEEK( offset ) ||
FT_READ_LONG( format_tag ) )
if ( FT_STREAM_SEEK( offset ) ||
FT_READ_LONG( format_tag ) )
goto Exit;
}
@ -375,7 +377,7 @@
}
/* disallow face index values > 0 for non-TTC files */
if ( format_tag != TTAG_ttcf && face_index > 0 )
if ( font_format_tag != TTAG_ttcf && face_index > 0 )
error = SFNT_Err_Bad_Argument;
Exit:

View File

@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
/* Copyright 1996-2001, 2002, 2003 by */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -293,7 +293,7 @@
static FT_Error
Load_Glyph( TT_GlyphSlot slot,
TT_Size size,
FT_UShort glyph_index,
FT_UInt glyph_index,
FT_Int32 load_flags )
{
FT_Error error;

View File

@ -1729,7 +1729,7 @@
FT_LOCAL_DEF( FT_Error )
TT_Load_Glyph( TT_Size size,
TT_GlyphSlot glyph,
FT_UShort glyph_index,
FT_UInt glyph_index,
FT_Int32 load_flags )
{
SFNT_Service sfnt;
@ -1772,7 +1772,7 @@
error = sfnt->load_sbit_image( face,
(FT_ULong)size->strike_index,
(FT_UInt)glyph_index,
glyph_index,
(FT_Int)load_flags,
stream,
&glyph->bitmap,

View File

@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (specification). */
/* */
/* Copyright 1996-2001, 2002, 2003 by */
/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -43,7 +43,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
TT_Load_Glyph( TT_Size size,
TT_GlyphSlot glyph,
FT_UShort glyph_index,
FT_UInt glyph_index,
FT_Int32 load_flags );