* include/freetype/config/ftoption.h, devel/ftoption.h, include/freetype/internal/ftobjs.h, include/freetype/internal/tttypes.h, src/truetype/ttinterp.c, src/truetype/ttobjs.c, src/truetype/ttobjs.h: changed the name of TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING to the simpler TT_CONFIG_OPTION_UNPATENTED_HINTING removed the macro TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING. Instead, the same effect can be used by setting a debug-hook with FT_DEBUG_HOOK_UNPATENTED_HINTING globally with FT_Set_Debug_Hook()
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
diff --git a/ChangeLog b/ChangeLog
index 4c0c43f..643d1b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-08-18 David Turner <david@freetype.org>
+
+ * include/freetype/config/ftoption.h, devel/ftoption.h,
+ include/freetype/internal/ftobjs.h, include/freetype/internal/tttypes.h,
+ src/truetype/ttinterp.c, src/truetype/ttobjs.c, src/truetype/ttobjs.h:
+
+ changed the name of TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING to
+ the simpler TT_CONFIG_OPTION_UNPATENTED_HINTING
+
+ removed the macro TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING. Instead,
+ the same effect can be used by setting a debug-hook with
+ FT_DEBUG_HOOK_UNPATENTED_HINTING globally with FT_Set_Debug_Hook()
+
2003-08-06 Werner Lemberg <wl@gnu.org>
* src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
@@ -254,7 +267,7 @@
* src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
- only, then try to find a better hit by comparing pixel_width also.
+ only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.
@@ -548,7 +561,7 @@
* include/freetype/ftstroke.h: This.
* src/base/ftstroker.c: Renamed to...
- * src/base/ftstroke.c: This.
+ * src/base/ftstroke.c: This.
* include/freetype/config/ftheader.h (FT_STROKER_H): Updated.
@@ -635,7 +648,7 @@
* include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
include/freetype/internal/psaux.h (T1_DecoderRec),
- src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
+ src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
Unused.
* src/cff/cffgload.c (cff_builder_init): Updated.
diff --git a/devel/ftoption.h b/devel/ftoption.h
index f92d928..3d806c9 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -404,27 +404,14 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING (in addition to */
+ /* Define TT_CONFIG_OPTION_UNPATENTED_HINTING (in addition to */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */
- /* work-around hinting system. You must define this if you want either */
- /* to force the use of the unpatented hinting system by also defining */
- /* TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to select */
- /* it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */
+ /* work-around hinting system. Note that for the moment, the algorithm */
+ /* is only used when selected at runtime through the parameter tag */
+ /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
+ /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived */
/* */
-#define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to restrict the */
- /* TrueType bytecode interpreter to actions not protected by patents. */
- /* This enables some fonts, for example mingliu.ttc from Dynalab, to */
- /* work properly. They use hinting to make large changes to the glyph */
- /* shape, without which the glyph is unrecognisable. */
- /* For this to work you must also define */
- /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING. */
- /* */
-#undef TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING
+#define TT_CONFIG_OPTION_UNPATENTED_HINTING
/*************************************************************************/
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index dbf532e..182a26c 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -404,27 +404,14 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* Define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING (in addition to */
+ /* Define TT_CONFIG_OPTION_UNPATENTED_HINTING (in addition to */
/* TT_CONFIG_OPTION_BYTECODE_INTERPRETER) to compile the unpatented */
- /* work-around hinting system. You must define this if you want either */
- /* to force the use of the unpatented hinting system by also defining */
- /* TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING, or if you want to select */
- /* it at run time using the FT_PARAM_TAG_UNPATENTED_HINTING tag. */
+ /* work-around hinting system. Note that for the moment, the algorithm */
+ /* is only used when selected at runtime through the parameter tag */
+ /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
+ /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived */
/* */
-#define TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
-
-
- /*************************************************************************/
- /* */
- /* Define TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to restrict the */
- /* TrueType bytecode interpreter to actions not protected by patents. */
- /* This enables some fonts, for example mingliu.ttc from Dynalab, to */
- /* work properly. They use hinting to make large changes to the glyph */
- /* shape, without which the glyph is unrecognisable. */
- /* For this to work you must also define */
- /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING. */
- /* */
-#undef TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING
+#define TT_CONFIG_OPTION_UNPATENTED_HINTING
/*************************************************************************/
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index ac3edfa..79319e8 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -541,14 +541,14 @@ FT_BEGIN_HEADER
FT_Done_GlyphSlot( FT_GlyphSlot slot );
/* */
-
+
/*
* Free the bitmap of a given glyphslot when needed
* (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
*/
FT_BASE( void )
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
-
+
/*
* Allocate a new bitmap buffer in a glyph slot.
@@ -673,8 +673,18 @@ FT_BEGIN_HEADER
/*************************************************************************/
-#define FT_DEBUG_HOOK_TRUETYPE 0
-#define FT_DEBUG_HOOK_TYPE1 1
+/* this hook is used by the TrueType debugger. It must be set to an alternate
+ * truetype bytecode interpreter function
+ */
+#define FT_DEBUG_HOOK_TRUETYPE 0
+
+
+/* set this debug hook to a non-null pointer to force unpatented hinting
+ * for all faces when both TT_CONFIG_OPTION_BYTECODE_INTERPRETER and
+ * TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. this is only used
+ * during debugging
+ */
+#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
/*************************************************************************/
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h
index cdb2972..736d907 100644
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1562,7 +1562,7 @@ FT_BEGIN_HEADER
/* used to hook the debugger for the `ttdebug' utility. */
TT_Interpreter interpreter;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Use unpatented hinting only. */
FT_Bool unpatented_hinting;
#endif
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index eb73657..2dca6a2 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -221,7 +221,7 @@
#undef FAILURE
#define FAILURE 1
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
#define GUESS_VECTOR( V ) \
if ( CUR.face->unpatented_hinting ) \
{ \
@@ -722,7 +722,7 @@
exec->GS.freeVector = exec->GS.projVector;
exec->GS.dualVector = exec->GS.projVector;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
exec->GS.both_x_axis = TRUE;
#endif
@@ -754,7 +754,7 @@
{ 0x4000, 0 },
{ 0x4000, 0 },
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
TRUE,
#endif
@@ -1358,7 +1358,7 @@
{
if ( !CUR.tt_metrics.ratio )
{
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( CUR.face->unpatented_hinting )
{
if ( CUR.GS.both_x_axis )
@@ -1558,7 +1558,7 @@
FT_F26Dot6 v;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
FT_ASSERT( !CUR.face->unpatented_hinting );
#endif
@@ -2122,7 +2122,7 @@
Project( EXEC_OP_ FT_Vector* v1,
FT_Vector* v2 )
{
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
FT_ASSERT( !CUR.face->unpatented_hinting );
#endif
@@ -2223,7 +2223,7 @@
static void
Compute_Funcs( EXEC_OP )
{
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( CUR.face->unpatented_hinting )
{
/* If both vectors point rightwards along the x axis, set */
@@ -2267,7 +2267,7 @@
return;
}
-#endif /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING */
+#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
if ( CUR.GS.freeVector.x == 0x4000 )
CUR.F_dot_P = CUR.GS.projVector.x * 0x10000L;
@@ -2618,7 +2618,7 @@
}
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
#define DO_GPV \
if ( CUR.face->unpatented_hinting ) \
{ \
@@ -2637,7 +2637,7 @@
#endif
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
#define DO_GFV \
if ( CUR.face->unpatented_hinting ) \
{ \
@@ -5189,7 +5189,7 @@
d = CUR_Func_project( zp.cur + p, zp.org + p );
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( CUR.face->unpatented_hinting )
{
if ( CUR.GS.both_x_axis )
@@ -5224,7 +5224,7 @@
FT_F26Dot6 dy,
FT_Bool touch )
{
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( CUR.face->unpatented_hinting )
{
if ( CUR.GS.both_x_axis )
@@ -5428,7 +5428,7 @@
return;
}
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( CUR.face->unpatented_hinting )
{
if ( CUR.GS.both_x_axis )
@@ -6345,7 +6345,7 @@
FT_ULong C;
FT_Long B;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Delta hinting is covered by US Patent 5159668. */
if ( CUR.face->unpatented_hinting )
{
@@ -6437,7 +6437,7 @@
FT_Long B;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Delta hinting is covered by US Patent 5159668. */
if ( CUR.face->unpatented_hinting )
{
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 25e1920..3572c6a 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -34,7 +34,7 @@
#include "ttinterp.h"
#endif
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
#include FT_TRUETYPE_UNPATENTED_H
#endif
@@ -225,14 +225,12 @@
}
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
/* Determine whether unpatented hinting is to be used for this face. */
+ face->unpatented_hinting =
+ ( library->debug_hooks[ FT_DEBUG_HOOK_UNPATENTED_HINTING ] != NULL );
-#ifdef TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING
- face->unpatented_hinting = TRUE;
-#else
- face->unpatented_hinting = FALSE;
{
int i;
@@ -241,9 +239,8 @@
if ( params[i].tag == FT_PARAM_TAG_UNPATENTED_HINTING )
face->unpatented_hinting = TRUE;
}
-#endif /* TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING */
-#endif /* TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING */
+#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */
/* initialize standard glyph loading routines */
TT_Init_Glyph_Loading( face );
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 0e63d71..c7f5562 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -83,7 +83,7 @@ FT_BEGIN_HEADER
FT_UnitVector projVector;
FT_UnitVector freeVector;
-#ifdef TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING
+#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
FT_Bool both_x_axis;
#endif