Clean-ups, copyright years, formatting.
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 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
diff --git a/ChangeLog b/ChangeLog
index 27f2c3c..749ef14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,32 +7,52 @@
* src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned,
tt_sbit_decoder_load_byte_aligned) [FT_OPTIMIZE_MEMORY]: Fix sbit
- loading. (only tested with bit aligned sbit with x_pos == 0)
+ loading. (Only tested with bit aligned sbit with x_pos == 0.)
* src/truetype/ttpload.c (tt_face_load_hdmx,
- tt_face_get_device_metrics) [FT_OPTIMIZE_MEMORY]: hdmx is not actually
- used.
+ tt_face_get_device_metrics) [FT_OPTIMIZE_MEMORY]: `hdmx' is not
+ actually used.
2006-02-21 David Turner <david@freetype.org>
- * include/freetype/ftmodapi.h, include/internal/ftserv.h,
- include/internal/services/svtteng.h, src/base/ftobjs.c,
- src/truetype/ttdriver.c:
+ Add a new API named FT_Get_TrueType_Engine_Type to determine whether
+ we have a patented, unpatented, or unimplemented TrueType bytecode
+ interpreter.
+
+ The FT_Get_Module_Flags API was removed consequently.
+
+ * include/freetype/ftmodapi.h (FT_Module_Get_Flags): Removed.
+ Replaced with...
+ (FT_Get_TrueType_Engine_Type): This.
+ (FT_TrueTypeEngineType): New enumeration.
+
+ * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_ENGINE_H):
+ New macro.
+
+ * src/base/ftobjs.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
+ (FT_Module_Get_Flags): Removed. Replaced with...
+ (FT_Get_TrueType_Engine_Type): This.
+
+ * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
+ (tt_service_truetype_engine): New service structure.
+ (tt_services): Register it.
+
+ * include/freetype/internal/services/svtteng.h: New file.
+
- adding a new API named FT_Get_TrueType_Engine_Type to determine
- wether we have a patented, unpatented or unimplemented TrueType
- bytecode interpreter.
+ * src/sfnt/sfobjs.c (sfnt_load_face): Fix silly bug that prevented
+ embedded bitmaps from being correctly listed and used.
- the FT_Get_Module_Flags API was removed consequently.
- * src/sfnt/sfobjs.c (sfnt_face_load): fixed silly bug that
- prevented embedded bitmaps from being correctly listed and used
+ * src/sfnt/ttmtx.c (tt_face_load_hmtx): Disable memory optimization
+ if FT_CONFIG_OPTION_OLD_INTERNALS is used. The is necessary because
+ libXfont is directly accessing the HMTX data, unfortunately.
+ Fix some compiler warnings.
+ (tt_face_get_metrics): Ditto.
- * src/sfnt/sfmtx.c: disabling memory optimization when
- FT_CONFIG_OPTION_OLD_INTERNALS is used. This is because libXfont
- is directly accessing the HMTX data. Grrrrr....
- * src/pfr/pfrsbit.c: fixed handling of character advances
+ * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix handling of
+ character advances.
2006-02-20 David Turner <david@freetype.org>
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 28e82e2..bb1bbee 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -448,7 +448,7 @@ FT_BEGIN_HEADER
/* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
/* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */
/* */
-#define xxTT_CONFIG_OPTION_UNPATENTED_HINTING
+#define TT_CONFIG_OPTION_UNPATENTED_HINTING
/*************************************************************************/
diff --git a/include/freetype/ftmodapi.h b/include/freetype/ftmodapi.h
index 6f41779..6de3387 100644
--- a/include/freetype/ftmodapi.h
+++ b/include/freetype/ftmodapi.h
@@ -307,33 +307,36 @@ FT_BEGIN_HEADER
FT_Add_Default_Modules( FT_Library library );
- /**
- * @enum: FT_TrueTypeEngineType
- *
- * @description:
- * a list of values describing which kind of truetype bytecode
- * engine is implemented in a given FT_Library instance. It is used
- * by the @FT_Get_TrueType_Engine_Type function
- *
- * @values:
- * FT_TRUETYPE_ENGINE_TYPE_NONE ::
- * the library doesn't implement any kind of bytecode interpreter
- *
- * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
- * the library implements a bytecode interpreter that doesn't
- * support the patented operations of the TrueType virtual machine.
- *
- * this interpreter can only be used to load certain Asian fonts
- * from Dynalabs. It will produce crap output for any other font.
- * see @
- *
- * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
- * the library implements a bytecode interpreter that covers
- * the full instruction set of the TrueType virtual machine.
- * Better check your legal department for license compliance !!
- *
- * @since: 2.2
- */
+ /*
+ * @enum:
+ * FT_TrueTypeEngineType
+ *
+ * @description:
+ * A list of values describing which kind of truetype bytecode
+ * engine is implemented in a given FT_Library instance. It is used
+ * by the @FT_Get_TrueType_Engine_Type function.
+ *
+ * @values:
+ * FT_TRUETYPE_ENGINE_TYPE_NONE ::
+ * The library doesn't implement any kind of bytecode interpreter.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
+ * The library implements a bytecode interpreter that doesn't
+ * support the patented operations of the TrueType virtual machine.
+ *
+ * Its main use is to load certain Asian fonts which position and
+ * scale glyph components with bytecode instructions. It produces
+ * bad output for most other fonts.
+ *
+ * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
+ * The library implements a bytecode interpreter that covers
+ * the full instruction set of the TrueType virtual machine.
+ * See the file `docs/PATENTS' for legal aspects.
+ *
+ * @since:
+ * 2.2
+ *
+ */
typedef enum
{
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
@@ -343,25 +346,29 @@ FT_BEGIN_HEADER
} FT_TrueTypeEngineType;
- /**
- * @func: FT_Get_TrueType_Engine_Type
- *
- * @description:
- * this function returns a @FT_TrueTypeEngineType value to indicates
- * which level of the TrueType virtual machine a given library instance
- * supports.
- *
- * @input:
- * library :: a library instance
- *
- * @return:
- * a value indicating which level is supported
- *
- * @since: 2.2
- */
+ /*
+ * @func:
+ * FT_Get_TrueType_Engine_Type
+ *
+ * @description:
+ * Return a @FT_TrueTypeEngineType value to indicate which level of
+ * the TrueType virtual machine a given library instance supports.
+ *
+ * @input:
+ * library ::
+ * A library instance.
+ *
+ * @return:
+ * A value indicating which level is supported.
+ *
+ * @since:
+ * 2.2
+ *
+ */
FT_EXPORT( FT_TrueTypeEngineType )
FT_Get_TrueType_Engine_Type( FT_Library library );
+
/* */
diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
index aaadf01..2666a87 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -302,6 +302,8 @@ FT_BEGIN_HEADER
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
+#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
+#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
@@ -309,12 +311,10 @@ FT_BEGIN_HEADER
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
-#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
+#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
-#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
-#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
/* */
diff --git a/include/freetype/internal/services/svsfnt.h b/include/freetype/internal/services/svsfnt.h
index 123008e..b4a85d9 100644
--- a/include/freetype/internal/services/svsfnt.h
+++ b/include/freetype/internal/services/svsfnt.h
@@ -63,9 +63,9 @@ FT_BEGIN_HEADER
FT_DEFINE_SERVICE( SFNT_Table )
{
- FT_SFNT_TableLoadFunc load_table;
- FT_SFNT_TableGetFunc get_table;
- FT_SFNT_TableInfoFunc table_info;
+ FT_SFNT_TableLoadFunc load_table;
+ FT_SFNT_TableGetFunc get_table;
+ FT_SFNT_TableInfoFunc table_info;
};
/* */
diff --git a/modules.cfg b/modules.cfg
index cf357cf..dd7ae1d 100644
--- a/modules.cfg
+++ b/modules.cfg
@@ -1,6 +1,6 @@
# modules.cfg
#
-# Copyright 2005 by
+# Copyright 2005, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index e2102e7..8f53eac 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3666,22 +3666,28 @@
{
FT_TrueTypeEngineType result = FT_TRUETYPE_ENGINE_TYPE_NONE;
+
if ( library )
{
FT_Module module = FT_Get_Module( library, "truetype" );
+
if ( module )
{
FT_Service_TrueTypeEngine service;
- service = ft_module_get_service( module, FT_SERVICE_ID_TRUETYPE_ENGINE );
+
+ service = ft_module_get_service( module,
+ FT_SERVICE_ID_TRUETYPE_ENGINE );
if ( service )
result = service->engine_type;
}
}
+
return result;
}
+
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_BASE_DEF( FT_Error )
diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c
index 9c42fca..45ff666 100644
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (body). */
/* */
-/* Copyright 2002, 2003 by */
+/* Copyright 2002, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -614,8 +614,8 @@
glyph->root.linearHoriAdvance = advance;
- /* compute default advance, i.e. scaled advance. This can be overriden */
- /* in the bitmap header of certain glyphs... */
+ /* compute default advance, i.e., scaled advance. This can be */
+ /* overridden in the bitmap header of certain glyphs. */
advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8,
character->advance,
phys->metrics_resolution );
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index bd6ce44..50825cc 100644
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -35,11 +35,12 @@
#define FT_COMPONENT trace_ttmtx
-/* Unfortunately, we can't enable our memory optimizations when
- * FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because some
- * rogue clients (libXfont in the X.Org XServer) is directly accessing
- * the metrics
- */
+ /*
+ * Unfortunately, we can't enable our memory optimizations if
+ * FT_CONFIG_OPTION_OLD_INTERNALS is defined. This is because at least
+ * one rogue client (libXfont in the X.Org XServer) is directly accessing
+ * the metrics.
+ */
/*************************************************************************/
/* */
diff --git a/src/sfnt/ttsbit0.c b/src/sfnt/ttsbit0.c
index 1a5efc9..56ab236 100644
--- a/src/sfnt/ttsbit0.c
+++ b/src/sfnt/ttsbit0.c
@@ -498,7 +498,7 @@
if ( x_pos + w > 8 )
{
write++;
- wval <<= 8;
+ wval <<= 8;
write[0] = (FT_Byte)( write[0] | ( wval >> x_pos ) );
}
}
@@ -547,7 +547,7 @@
goto Exit;
}
- if ( p + ( ( width * height + 7 ) >> 3 ) > limit )
+ if ( p + ( ( width * height + 7 ) >> 3 ) > limit )
{
error = SFNT_Err_Invalid_File_Format;
goto Exit;
@@ -558,8 +558,8 @@
x_pos &= 7;
/* the higher byte of `rval' is used as a buffer */
- rval = 0;
- nbits = 0;
+ rval = 0;
+ nbits = 0;
for ( h = height; h > 0; h--, line += pitch )
{
@@ -583,7 +583,7 @@
}
*write++ |= ( ( rval >> nbits ) & 0xFF ) & ~( 0xFF << w );
- rval <<= 8;
+ rval <<= 8;
w = width - w;
}
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 4324d6f..a29c38a 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -295,21 +295,25 @@
static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine =
{
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-# ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
+
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED
-# else
- FT_TRUETYPE_ENGINE_TYPE_PATENTED
-# endif
#else
- FT_TRUETYPE_ENGINE_TYPE_NONE
+ FT_TRUETYPE_ENGINE_TYPE_PATENTED
#endif
+
+#else /* !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+
+ FT_TRUETYPE_ENGINE_TYPE_NONE
+
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
};
static const FT_ServiceDescRec tt_services[] =
{
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE },
+ { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TRUETYPE },
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- { FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters },
+ { FT_SERVICE_ID_MULTI_MASTERS, &tt_service_gx_multi_masters },
#endif
{ FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine },
{ NULL, NULL }