* 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
diff --git a/ChangeLog b/ChangeLog
index 779b516..72f977b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index d757cba..2e8f93c 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -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 );
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index 503daae..5cf83e9 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -37,7 +37,6 @@ THE SOFTWARE.
#include "pcf.h"
#include "pcfdrivr.h"
-#include "pcfutil.h"
#include "pcfread.h"
#include "pcferror.h"
diff --git a/src/pcf/pcfutil.c b/src/pcf/pcfutil.c
index eb911bb..ddaca35 100644
--- a/src/pcf/pcfutil.c
+++ b/src/pcf/pcfutil.c
@@ -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 */
diff --git a/src/pcf/pcfutil.h b/src/pcf/pcfutil.h
index 32dd1ea..017c515 100644
--- a/src/pcf/pcfutil.h
+++ b/src/pcf/pcfutil.h
@@ -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__ */
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 00d2b79..d1b0b20 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -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:
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index e23fc35..a5b800d 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -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;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ffe0d73..00da0c2 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -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,
diff --git a/src/truetype/ttgload.h b/src/truetype/ttgload.h
index 36c93da..dfa2a60 100644
--- a/src/truetype/ttgload.h
+++ b/src/truetype/ttgload.h
@@ -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 );