* include/freetype/config/ftheader.h (FT_BEZIER_H): Removed. (FT_BDF_H): New macro for accessing `ftbdf.h'. * src/type42/t42drivr.c (hexval): Fix typo.
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 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
diff --git a/ChangeLog b/ChangeLog
index 5558a7b..4735fcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-05-22 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/config/ftheader.h (FT_BEZIER_H): Removed.
+ (FT_BDF_H): New macro for accessing `ftbdf.h'.
+
+ * src/type42/t42drivr.c (hexval): Fix typo.
+
2002-05-21 Martin Muskens <mmuskens@aurelon.com>
* src/psaux/psobjs.c (T1Radix): New function.
@@ -8,12 +15,13 @@
2002-05-21 David Turner <david@freetype.org>
- * src/bdf/bdflic.c: Removed compiler warning, and changed all tables
+ * src/bdf/bdflib.c: Removed compiler warning, and changed all tables
to the "static const" storage specifier (instead of simply
`static').
- * src/type42/t32drivr.c, src/bdf/bdfdrivr.c: Removing compiler
- warnings.
+ * src/type42/t42drivr.c (hexval): Use more efficient code.
+ Removing compiler warnings.
+ * src/bdf/bdfdrivr.c: Removing compiler warnings.
* include/freetype/internal/ftbdf.h, src/base/ftbdf.c,
src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index d4936e8..0a6788c 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -352,38 +352,38 @@
/*************************************************************************/
/* */
/* @macro: */
- /* FT_GLYPH_H */
+ /* FT_BDF_H */
/* */
/* @description: */
/* A macro used in #include statements to name the file containing */
- /* the API of the optional glyph management component. */
+ /* the definitions of an API to access BDF-specific strings from a */
+ /* face. */
/* */
-#define FT_GLYPH_H <freetype/ftglyph.h>
+#define FT_BDF_H <freetype/ftbdf.h>
/*************************************************************************/
/* */
/* @macro: */
- /* FT_BBOX_H */
+ /* FT_GLYPH_H */
/* */
/* @description: */
/* A macro used in #include statements to name the file containing */
- /* the API of the optional exact bounding box computation routines. */
+ /* the API of the optional glyph management component. */
/* */
-#define FT_BBOX_H <freetype/ftbbox.h>
+#define FT_GLYPH_H <freetype/ftglyph.h>
/*************************************************************************/
/* */
/* @macro: */
- /* FT_BEZIER_H */
+ /* FT_BBOX_H */
/* */
/* @description: */
/* A macro used in #include statements to name the file containing */
- /* a small useful API to handle bezier arcs. Note that you _must_ */
- /* include FT_FREETYPE_H or FT_IMAGE_H before this header. */
+ /* the API of the optional exact bounding box computation routines. */
/* */
-#define FT_BEZIER_H <freetype/ftbezier.h>
+#define FT_BBOX_H <freetype/ftbbox.h>
/*************************************************************************/
diff --git a/include/freetype/ftbdf.h b/include/freetype/ftbdf.h
index 8dfb9fc..2e25c2d 100644
--- a/include/freetype/ftbdf.h
+++ b/include/freetype/ftbdf.h
@@ -1,11 +1,31 @@
-#ifndef __FT_BDF_H__
-#define __FT_BDF_H__
+/***************************************************************************/
+/* */
+/* ftbdf.h */
+/* */
+/* FreeType API for accessing BDF-specific strings (specification). */
+/* */
+/* Copyright 2002 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 __FTBDF_H__
+#define __FTBDF_H__
#include <ft2build.h>
#include FT_FREETYPE_H
+
FT_BEGIN_HEADER
+
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding,
@@ -13,4 +33,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __FT_BDF_H__ */
+#endif /* __FTBDF_H__ */
+
+
+/* END */
diff --git a/src/base/ftbdf.c b/src/base/ftbdf.c
index 558970c..0457955 100644
--- a/src/base/ftbdf.c
+++ b/src/base/ftbdf.c
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/* */
+/* ftbdf.c */
+/* */
+/* FreeType API for accessing BDF-specific strings (body). */
+/* */
+/* Copyright 2002 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_INTERNAL_BDF_TYPES_H
#include FT_INTERNAL_OBJECTS_H
@@ -19,11 +37,13 @@
{
FT_Module driver = (FT_Module) face->driver;
- if ( driver->clazz && driver->clazz->module_name &&
+
+ if ( driver->clazz && driver->clazz->module_name &&
ft_strcmp( driver->clazz->module_name, "bdf" ) == 0 )
{
- BDF_Public_Face bdf_face = (BDF_Public_Face) face;
+ BDF_Public_Face bdf_face = (BDF_Public_Face)face;
+
encoding = (const char*) bdf_face->charset_encoding;
registry = (const char*) bdf_face->charset_registry;
error = 0;
@@ -38,3 +58,6 @@
return error;
}
+
+
+/* END */
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 3c89850..ae3ba5b 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -194,18 +194,18 @@ THE SOFTWARE.
xres->value.int32,
yres->value.int32 ));
root->available_sizes->width =
- (FT_Short)( prop->value.int32 * 75 / xres->value.int32 );
+ (FT_Short)( prop->value.int32 * 75 / xres->value.int32 );
root->available_sizes->height =
- (FT_Short)( prop->value.int32 * 75 / yres->value.int32 );
+ (FT_Short)( prop->value.int32 * 75 / yres->value.int32 );
}
}
else
{
/* some fonts have broken SIZE declaration (jiskan24.bdf) */
FT_ERROR(( "BDF_Face_Init: reading size\n" ));
- root->available_sizes->width = (FT_Short) font->point_size ;
- root->available_sizes->height = (FT_Short) font->point_size ;
+ root->available_sizes->width = (FT_Short)font->point_size ;
+ root->available_sizes->height = (FT_Short)font->point_size ;
}
/* encoding table */
@@ -221,7 +221,7 @@ THE SOFTWARE.
{
(face->en_table[n]).enc = cur[n].encoding;
FT_TRACE4(( "idx %d, val 0x%lX\n", n, cur[n].encoding ));
- (face->en_table[n]).glyph = (FT_Short) n;
+ (face->en_table[n]).glyph = (FT_Short)n;
}
}
@@ -367,10 +367,10 @@ THE SOFTWARE.
/* get the full bytes */
for ( j = 0; j < ( bitmap->width >> 2 ); j++ )
{
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xC0 ) >> 6);
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x30 ) >> 4);
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x0C ) >> 2);
- bitmap->buffer[count++] = (FT_Byte)( *pp & 0x03 );
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xC0 ) >> 6 );
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x30 ) >> 4 );
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x0C ) >> 2 );
+ bitmap->buffer[count++] = (FT_Byte)( *pp & 0x03 );
pp++;
}
@@ -379,13 +379,13 @@ THE SOFTWARE.
switch ( bitmap->width & 3 )
{
case 3:
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xC0 ) >> 6);
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xC0 ) >> 6 );
/* fall through */
case 2:
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x30 ) >> 4);
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x30 ) >> 4 );
/* fall through */
case 1:
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0x0C ) >> 2);
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0x0C ) >> 2 );
/* fall through */
case 0:
break;
@@ -408,8 +408,8 @@ THE SOFTWARE.
/* get the full bytes */
for ( j = 0; j < ( bitmap->width >> 1 ); j++ )
{
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xF0 ) >> 4);
- bitmap->buffer[count++] = (FT_Byte)( *pp & 0x0F );
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xF0 ) >> 4 );
+ bitmap->buffer[count++] = (FT_Byte)( *pp & 0x0F );
pp++;
}
@@ -418,7 +418,7 @@ THE SOFTWARE.
switch ( bitmap->width & 1 )
{
case 1:
- bitmap->buffer[count++] = (FT_Byte)(( *pp & 0xF0 ) >> 4);
+ bitmap->buffer[count++] = (FT_Byte)( ( *pp & 0xF0 ) >> 4 );
/* fall through */
case 0:
break;
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index 0429f7d..d45a9ee 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -928,12 +928,12 @@
}
for ( v = 0; isdigok( dmap, *s ); s++ )
- v = (short)(v * base + a2i[(int)*s]);
+ v = (short)( v * base + a2i[(int)*s] );
if ( end != 0 )
*end = s;
- return (short)(( !neg ) ? v : -v );
+ return (short)( ( !neg ) ? v : -v );
}
@@ -1030,7 +1030,7 @@
if ( propid >= _num_bdf_properties )
return font->user_props + ( propid - _num_bdf_properties );
- return (bdf_property_t*) _bdf_properties + propid;
+ return (bdf_property_t*)_bdf_properties + propid;
}
@@ -1217,7 +1217,7 @@
/* Restore the character that was saved before any return can happen. */
if ( hold != -1 )
- *ep = (char) hold;
+ *ep = (char)hold;
/* If the property exists and is not an atom, just return here. */
if ( p && p->format != BDF_ATOM )
@@ -1684,7 +1684,7 @@
for ( i = 0, *bp = 0; i < nibbles; i++ )
{
c = line[i];
- *bp = (FT_Byte)(( *bp << 4 ) + a2i[c]);
+ *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );
if ( i + 1 < nibbles && ( i & 1 ) )
*++bp = 0;
}
@@ -1764,8 +1764,8 @@
glyph->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );
/* Generate the ascent and descent of the character. */
- glyph->bbx.ascent = (short)(glyph->bbx.height + glyph->bbx.y_offset);
- glyph->bbx.descent = (short)(-glyph->bbx.y_offset);
+ glyph->bbx.ascent = (short)( glyph->bbx.height + glyph->bbx.y_offset );
+ glyph->bbx.descent = (short)( -glyph->bbx.y_offset );
/* Determine the overall font bounding box as the characters are */
/* loaded so corrections can be done later if indicated. */
@@ -1829,7 +1829,7 @@
/* Allocate enough space for the bitmap. */
glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
- glyph->bytes = (unsigned short)(glyph->bpr * glyph->bbx.height);
+ glyph->bytes = (unsigned short)( glyph->bpr * glyph->bbx.height );
if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) )
goto Exit;
@@ -2032,7 +2032,7 @@
error = hash_init( &(font->proptbl), memory );
if ( error )
goto Exit;
- for ( i = 0, prop = (bdf_property_t*) _bdf_properties;
+ for ( i = 0, prop = (bdf_property_t*)_bdf_properties;
i < _num_bdf_properties; i++, prop++ )
{
error = hash_insert( prop->name, (void *)i,
@@ -2200,7 +2200,7 @@
FT_MEM_SET( &p, 0, sizeof ( _bdf_parse_t ) );
- p.opts = (bdf_options_t*)(( opts != 0 ) ? opts : &_bdf_opts);
+ p.opts = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts );
p.minlb = 32767;
p.memory = extmemory; /* only during font creation */
@@ -2236,7 +2236,7 @@
{
FT_TRACE2(( "bdf_load_font: " ACMSG3,
p.font->bbx.width, p.maxrb - p.minlb ));
- p.font->bbx.width = (unsigned short)(p.maxrb - p.minlb);
+ p.font->bbx.width = (unsigned short)( p.maxrb - p.minlb );
p.font->modified = 1;
}
@@ -2261,7 +2261,7 @@
FT_TRACE2(( "bdf_load_font: " ACMSG6,
p.font->bbx.descent, p.maxds ));
p.font->bbx.descent = p.maxds;
- p.font->bbx.y_offset = (short)(-p.maxds);
+ p.font->bbx.y_offset = (short)( -p.maxds );
p.font->modified = 1;
}
@@ -2269,7 +2269,7 @@
{
FT_TRACE2(( "bdf_load_font: " ACMSG7,
p.font->bbx.height, p.maxas + p.maxds ));
- p.font->bbx.height = (unsigned short)(p.maxas + p.maxds);
+ p.font->bbx.height = (unsigned short)( p.maxas + p.maxds );
}
if ( p.flags & _BDF_SWIDTH_ADJ )
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index 5e64792..e92696d 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -591,7 +591,7 @@
goto Exit;
}
- d = (FT_UInt)( v - 'A' );
+ d = (FT_UInt)( v - 'a' );
if ( d < 6 )
{
d += 10;