Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
5b7e45ac
by Alexei Podtelezhnikov at 2023-07-27T15:06:38+00:00
[truetype] Remove Infinality for good.
Remove everything `#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY`,
which was undefined for a while now.
* include/freetype/internal/tttypes.h: Ditto.
* src/truetype/truetype.c: Ditto.
* src/truetype/ttdriver.c: Ditto.
* src/truetype/ttgload.c: Ditto.
* src/truetype/ttinterp.c: Ditto.
* src/truetype/ttinterp.h: Ditto.
* src/truetype/ttobjs.c: Ditto.
* src/truetype/ttsubpix.[ch]: Remove files.
* src/truetype/rules.mk: Don't mention "ttsubpix.c".
10 changed files:
Changes:
include/freetype/internal/tttypes.h
... |
... |
@@ -1597,13 +1597,6 @@ FT_BEGIN_HEADER |
1597
|
1597
|
FT_ULong horz_metrics_offset;
|
1598
|
1598
|
FT_ULong vert_metrics_offset;
|
1599
|
1599
|
|
1600
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
1601
|
|
- /* since 2.4.12 */
|
1602
|
|
- FT_ULong sph_found_func_flags; /* special functions found */
|
1603
|
|
- /* for this face */
|
1604
|
|
- FT_Bool sph_compatibility_mode;
|
1605
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
1606
|
|
-
|
1607
|
1600
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
1608
|
1601
|
/* since 2.7 */
|
1609
|
1602
|
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
|
src/truetype/rules.mk
... |
... |
@@ -33,8 +33,7 @@ TT_DRV_SRC := $(TT_DIR)/ttdriver.c \ |
33
|
33
|
$(TT_DIR)/ttgxvar.c \
|
34
|
34
|
$(TT_DIR)/ttinterp.c \
|
35
|
35
|
$(TT_DIR)/ttobjs.c \
|
36
|
|
- $(TT_DIR)/ttpload.c \
|
37
|
|
- $(TT_DIR)/ttsubpix.c
|
|
36
|
+ $(TT_DIR)/ttpload.c
|
38
|
37
|
|
39
|
38
|
# TrueType driver headers
|
40
|
39
|
#
|
src/truetype/truetype.c
... |
... |
@@ -24,7 +24,6 @@ |
24
|
24
|
#include "ttinterp.c"
|
25
|
25
|
#include "ttobjs.c" /* object manager */
|
26
|
26
|
#include "ttpload.c" /* tables loader */
|
27
|
|
-#include "ttsubpix.c"
|
28
|
27
|
|
29
|
28
|
|
30
|
29
|
/* END */ |
src/truetype/ttdriver.c
... |
... |
@@ -100,11 +100,6 @@ |
100
|
100
|
break;
|
101
|
101
|
|
102
|
102
|
case TT_INTERPRETER_VERSION_38:
|
103
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
104
|
|
- driver->interpreter_version = TT_INTERPRETER_VERSION_38;
|
105
|
|
- break;
|
106
|
|
-#endif
|
107
|
|
-
|
108
|
103
|
case TT_INTERPRETER_VERSION_40:
|
109
|
104
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
110
|
105
|
driver->interpreter_version = TT_INTERPRETER_VERSION_40;
|
src/truetype/ttgload.c
... |
... |
@@ -35,7 +35,6 @@ |
35
|
35
|
#endif
|
36
|
36
|
|
37
|
37
|
#include "tterrors.h"
|
38
|
|
-#include "ttsubpix.h"
|
39
|
38
|
|
40
|
39
|
|
41
|
40
|
/**************************************************************************
|
... |
... |
@@ -152,9 +151,6 @@ |
152
|
151
|
FT_UInt glyph_index )
|
153
|
152
|
{
|
154
|
153
|
TT_Face face = loader->face;
|
155
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
156
|
|
- TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
|
157
|
|
-#endif
|
158
|
154
|
|
159
|
155
|
FT_Error error;
|
160
|
156
|
FT_Stream stream = loader->stream;
|
... |
... |
@@ -183,20 +179,6 @@ |
183
|
179
|
loader->top_bearing = top_bearing;
|
184
|
180
|
loader->vadvance = advance_height;
|
185
|
181
|
|
186
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
187
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
|
188
|
|
- loader->exec )
|
189
|
|
- {
|
190
|
|
- loader->exec->sph_tweak_flags = 0;
|
191
|
|
-
|
192
|
|
- /* This may not be the right place for this, but it works... */
|
193
|
|
- /* Note that we have to unconditionally load the tweaks since */
|
194
|
|
- /* it is possible that glyphs individually switch ClearType's */
|
195
|
|
- /* backward compatibility mode on and off. */
|
196
|
|
- sph_set_tweaks( loader, glyph_index );
|
197
|
|
- }
|
198
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
199
|
|
-
|
200
|
182
|
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
201
|
183
|
/* With the incremental interface, these values are set by */
|
202
|
184
|
/* a call to `tt_get_metrics_incremental'. */
|
... |
... |
@@ -798,8 +780,7 @@ |
798
|
780
|
TT_Hint_Glyph( TT_Loader loader,
|
799
|
781
|
FT_Bool is_composite )
|
800
|
782
|
{
|
801
|
|
-#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
|
802
|
|
- defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
783
|
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
803
|
784
|
TT_Face face = loader->face;
|
804
|
785
|
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
|
805
|
786
|
#endif
|
... |
... |
@@ -887,17 +868,6 @@ |
887
|
868
|
}
|
888
|
869
|
#endif
|
889
|
870
|
|
890
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
891
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
|
892
|
|
- {
|
893
|
|
- if ( exec->sph_tweak_flags & SPH_TWEAK_DEEMBOLDEN )
|
894
|
|
- FT_Outline_EmboldenXY( &loader->gloader->current.outline, -24, 0 );
|
895
|
|
-
|
896
|
|
- else if ( exec->sph_tweak_flags & SPH_TWEAK_EMBOLDEN )
|
897
|
|
- FT_Outline_EmboldenXY( &loader->gloader->current.outline, 24, 0 );
|
898
|
|
- }
|
899
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
900
|
|
-
|
901
|
871
|
return FT_Err_Ok;
|
902
|
872
|
}
|
903
|
873
|
|
... |
... |
@@ -960,16 +930,6 @@ |
960
|
930
|
}
|
961
|
931
|
|
962
|
932
|
{
|
963
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
964
|
|
- TT_Face face = loader->face;
|
965
|
|
- TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
|
966
|
|
-
|
967
|
|
- FT_String* family = face->root.family_name;
|
968
|
|
- FT_UInt ppem = loader->size->metrics->x_ppem;
|
969
|
|
- FT_String* style = face->root.style_name;
|
970
|
|
- FT_UInt x_scale_factor = 1000;
|
971
|
|
-#endif
|
972
|
|
-
|
973
|
933
|
FT_Vector* vec = outline->points;
|
974
|
934
|
FT_Vector* limit = outline->points + n_points;
|
975
|
935
|
|
... |
... |
@@ -979,52 +939,6 @@ |
979
|
939
|
FT_Bool do_scale = FALSE;
|
980
|
940
|
|
981
|
941
|
|
982
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
983
|
|
-
|
984
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
|
985
|
|
- {
|
986
|
|
- /* scale, but only if enabled and only if TT hinting is being used */
|
987
|
|
- if ( IS_HINTED( loader->load_flags ) )
|
988
|
|
- x_scale_factor = sph_test_tweak_x_scaling( face,
|
989
|
|
- family,
|
990
|
|
- ppem,
|
991
|
|
- style,
|
992
|
|
- loader->glyph_index );
|
993
|
|
- /* scale the glyph */
|
994
|
|
- if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ||
|
995
|
|
- x_scale_factor != 1000 )
|
996
|
|
- {
|
997
|
|
- x_scale = FT_MulDiv( loader->size->metrics->x_scale,
|
998
|
|
- (FT_Long)x_scale_factor, 1000 );
|
999
|
|
- y_scale = loader->size->metrics->y_scale;
|
1000
|
|
-
|
1001
|
|
- /* compensate for any scaling by de/emboldening; */
|
1002
|
|
- /* the amount was determined via experimentation */
|
1003
|
|
- if ( x_scale_factor != 1000 && ppem > 11 )
|
1004
|
|
- {
|
1005
|
|
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
1006
|
|
- FT_Vector* orig_points = outline->points;
|
1007
|
|
-
|
1008
|
|
-
|
1009
|
|
- if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) )
|
1010
|
|
- outline->points = unrounded;
|
1011
|
|
-#endif
|
1012
|
|
- FT_Outline_EmboldenXY( outline,
|
1013
|
|
- FT_MulFix( 1280 * ppem,
|
1014
|
|
- 1000 - x_scale_factor ),
|
1015
|
|
- 0 );
|
1016
|
|
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
1017
|
|
- if ( !IS_DEFAULT_INSTANCE( FT_FACE( loader->face ) ) )
|
1018
|
|
- outline->points = orig_points;
|
1019
|
|
-#endif
|
1020
|
|
- }
|
1021
|
|
- do_scale = TRUE;
|
1022
|
|
- }
|
1023
|
|
- }
|
1024
|
|
- else
|
1025
|
|
-
|
1026
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
1027
|
|
-
|
1028
|
942
|
{
|
1029
|
943
|
/* scale the glyph */
|
1030
|
944
|
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
|
... |
... |
@@ -1460,15 +1374,6 @@ |
1460
|
1374
|
#endif
|
1461
|
1375
|
|
1462
|
1376
|
|
1463
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
1464
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
|
1465
|
|
- {
|
1466
|
|
- subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting
|
1467
|
|
- : 0;
|
1468
|
|
- grayscale = loader->exec ? loader->exec->grayscale
|
1469
|
|
- : 0;
|
1470
|
|
- }
|
1471
|
|
-#endif
|
1472
|
1377
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
1473
|
1378
|
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
1474
|
1379
|
{
|
... |
... |
@@ -2277,8 +2182,7 @@ |
2277
|
2182
|
#ifdef TT_USE_BYTECODE_INTERPRETER
|
2278
|
2183
|
FT_Error error;
|
2279
|
2184
|
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
|
2280
|
|
-#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
|
2281
|
|
- defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
2185
|
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2282
|
2186
|
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face );
|
2283
|
2187
|
#endif
|
2284
|
2188
|
#endif
|
... |
... |
@@ -2298,20 +2202,6 @@ |
2298
|
2202
|
FT_Bool grayscale_cleartype;
|
2299
|
2203
|
#endif
|
2300
|
2204
|
|
2301
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
2302
|
|
- FT_Bool subpixel_hinting = FALSE;
|
2303
|
|
-
|
2304
|
|
-#if 0
|
2305
|
|
- /* not used yet */
|
2306
|
|
- FT_Bool compatible_widths;
|
2307
|
|
- FT_Bool symmetrical_smoothing;
|
2308
|
|
- FT_Bool bgr;
|
2309
|
|
- FT_Bool vertical_lcd;
|
2310
|
|
- FT_Bool subpixel_positioned;
|
2311
|
|
- FT_Bool gray_cleartype;
|
2312
|
|
-#endif
|
2313
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
2314
|
|
-
|
2315
|
2205
|
FT_Bool reexecute = FALSE;
|
2316
|
2206
|
|
2317
|
2207
|
|
... |
... |
@@ -2356,65 +2246,6 @@ |
2356
|
2246
|
}
|
2357
|
2247
|
#endif
|
2358
|
2248
|
|
2359
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
2360
|
|
-
|
2361
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
|
2362
|
|
- {
|
2363
|
|
- subpixel_hinting = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2364
|
|
- FT_RENDER_MODE_MONO ) &&
|
2365
|
|
- SPH_OPTION_SET_SUBPIXEL );
|
2366
|
|
-
|
2367
|
|
- if ( subpixel_hinting )
|
2368
|
|
- grayscale = FALSE;
|
2369
|
|
- else if ( SPH_OPTION_SET_GRAYSCALE )
|
2370
|
|
- {
|
2371
|
|
- grayscale = TRUE;
|
2372
|
|
- subpixel_hinting = FALSE;
|
2373
|
|
- }
|
2374
|
|
- else
|
2375
|
|
- grayscale = FALSE;
|
2376
|
|
-
|
2377
|
|
- if ( FT_IS_TRICKY( glyph->face ) )
|
2378
|
|
- subpixel_hinting = FALSE;
|
2379
|
|
-
|
2380
|
|
- exec->ignore_x_mode = subpixel_hinting || grayscale;
|
2381
|
|
- exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
|
2382
|
|
- if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
|
2383
|
|
- exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
|
2384
|
|
-
|
2385
|
|
-#if 1
|
2386
|
|
- exec->compatible_widths = SPH_OPTION_SET_COMPATIBLE_WIDTHS;
|
2387
|
|
- exec->symmetrical_smoothing = TRUE;
|
2388
|
|
- exec->bgr = FALSE;
|
2389
|
|
- exec->vertical_lcd = FALSE;
|
2390
|
|
- exec->subpixel_positioned = TRUE;
|
2391
|
|
- exec->gray_cleartype = FALSE;
|
2392
|
|
-#else /* 0 */
|
2393
|
|
- exec->compatible_widths =
|
2394
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2395
|
|
- TT_LOAD_COMPATIBLE_WIDTHS );
|
2396
|
|
- exec->symmetrical_smoothing =
|
2397
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2398
|
|
- TT_LOAD_SYMMETRICAL_SMOOTHING );
|
2399
|
|
- exec->bgr =
|
2400
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2401
|
|
- TT_LOAD_BGR );
|
2402
|
|
- exec->vertical_lcd =
|
2403
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2404
|
|
- TT_LOAD_VERTICAL_LCD );
|
2405
|
|
- exec->subpixel_positioned =
|
2406
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2407
|
|
- TT_LOAD_SUBPIXEL_POSITIONED );
|
2408
|
|
- exec->gray_cleartype =
|
2409
|
|
- FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2410
|
|
- TT_LOAD_GRAY_CLEARTYPE );
|
2411
|
|
-#endif /* 0 */
|
2412
|
|
-
|
2413
|
|
- }
|
2414
|
|
- else
|
2415
|
|
-
|
2416
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
2417
|
|
-
|
2418
|
2249
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2419
|
2250
|
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
2420
|
2251
|
grayscale = FT_BOOL( !subpixel_hinting_lean &&
|
... |
... |
@@ -2429,36 +2260,6 @@ |
2429
|
2260
|
if ( error )
|
2430
|
2261
|
return error;
|
2431
|
2262
|
|
2432
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
2433
|
|
-
|
2434
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
|
2435
|
|
- {
|
2436
|
|
- /* a change from mono to subpixel rendering (and vice versa) */
|
2437
|
|
- /* requires a re-execution of the CVT program */
|
2438
|
|
- if ( subpixel_hinting != exec->subpixel_hinting )
|
2439
|
|
- {
|
2440
|
|
- FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
|
2441
|
|
- " re-executing `prep' table\n" ));
|
2442
|
|
-
|
2443
|
|
- exec->subpixel_hinting = subpixel_hinting;
|
2444
|
|
- reexecute = TRUE;
|
2445
|
|
- }
|
2446
|
|
-
|
2447
|
|
- /* a change from mono to grayscale rendering (and vice versa) */
|
2448
|
|
- /* requires a re-execution of the CVT program */
|
2449
|
|
- if ( grayscale != exec->grayscale )
|
2450
|
|
- {
|
2451
|
|
- FT_TRACE4(( "tt_loader_init: grayscale hinting change,"
|
2452
|
|
- " re-executing `prep' table\n" ));
|
2453
|
|
-
|
2454
|
|
- exec->grayscale = grayscale;
|
2455
|
|
- reexecute = TRUE;
|
2456
|
|
- }
|
2457
|
|
- }
|
2458
|
|
- else
|
2459
|
|
-
|
2460
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
2461
|
|
-
|
2462
|
2263
|
{
|
2463
|
2264
|
|
2464
|
2265
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
... |
... |
@@ -2518,14 +2319,6 @@ |
2518
|
2319
|
if ( exec->GS.instruct_control & 2 )
|
2519
|
2320
|
exec->GS = tt_default_graphics_state;
|
2520
|
2321
|
|
2521
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
2522
|
|
- /* check whether we have a font hinted for ClearType -- */
|
2523
|
|
- /* note that this flag can also be modified in a glyph's bytecode */
|
2524
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
|
2525
|
|
- exec->GS.instruct_control & 4 )
|
2526
|
|
- exec->ignore_x_mode = FALSE;
|
2527
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
2528
|
|
-
|
2529
|
2322
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2530
|
2323
|
/*
|
2531
|
2324
|
* Toggle backward compatibility according to what font wants, except
|
... |
... |
@@ -2561,13 +2354,6 @@ |
2561
|
2354
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2562
|
2355
|
!( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
|
2563
|
2356
|
exec->backward_compatibility ) &&
|
2564
|
|
-#endif
|
2565
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
2566
|
|
- !( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
|
2567
|
|
- !SPH_OPTION_BITMAP_WIDTHS &&
|
2568
|
|
- FT_LOAD_TARGET_MODE( loader->load_flags ) !=
|
2569
|
|
- FT_RENDER_MODE_MONO &&
|
2570
|
|
- exec->compatible_widths ) &&
|
2571
|
2357
|
#endif
|
2572
|
2358
|
!face->postscript.isFixedPitch )
|
2573
|
2359
|
{
|
src/truetype/ttinterp.c
... |
... |
@@ -29,7 +29,6 @@ |
29
|
29
|
|
30
|
30
|
#include "ttinterp.h"
|
31
|
31
|
#include "tterrors.h"
|
32
|
|
-#include "ttsubpix.h"
|
33
|
32
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
34
|
33
|
#include "ttgxvar.h"
|
35
|
34
|
#endif
|
... |
... |
@@ -52,12 +51,6 @@ |
52
|
51
|
( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \
|
53
|
52
|
TT_INTERPRETER_VERSION_35 )
|
54
|
53
|
|
55
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
56
|
|
-#define SUBPIXEL_HINTING_INFINALITY \
|
57
|
|
- ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \
|
58
|
|
- TT_INTERPRETER_VERSION_38 )
|
59
|
|
-#endif
|
60
|
|
-
|
61
|
54
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
62
|
55
|
#define SUBPIXEL_HINTING_MINIMAL \
|
63
|
56
|
( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \
|
... |
... |
@@ -1685,17 +1678,6 @@ |
1685
|
1678
|
|
1686
|
1679
|
if ( v != 0 )
|
1687
|
1680
|
{
|
1688
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
1689
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
1690
|
|
- ( !exc->ignore_x_mode ||
|
1691
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )
|
1692
|
|
- zone->cur[point].x = ADD_LONG( zone->cur[point].x,
|
1693
|
|
- FT_MulDiv( distance,
|
1694
|
|
- v,
|
1695
|
|
- exc->F_dot_P ) );
|
1696
|
|
- else
|
1697
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
1698
|
|
-
|
1699
|
1681
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
1700
|
1682
|
/* Exception to the post-IUP curfew: Allow the x component of */
|
1701
|
1683
|
/* diagonal moves, but only post-IUP. DejaVu tries to adjust */
|
... |
... |
@@ -1801,12 +1783,6 @@ |
1801
|
1783
|
FT_UShort point,
|
1802
|
1784
|
FT_F26Dot6 distance )
|
1803
|
1785
|
{
|
1804
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
1805
|
|
- if ( SUBPIXEL_HINTING_INFINALITY && !exc->ignore_x_mode )
|
1806
|
|
- zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
|
1807
|
|
- else
|
1808
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
1809
|
|
-
|
1810
|
1786
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
1811
|
1787
|
if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
|
1812
|
1788
|
zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
|
... |
... |
@@ -3010,28 +2986,7 @@ |
3010
|
2986
|
args[0] = 0;
|
3011
|
2987
|
}
|
3012
|
2988
|
else
|
3013
|
|
- {
|
3014
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3015
|
|
- /* subpixel hinting - avoid Typeman Dstroke and */
|
3016
|
|
- /* IStroke and Vacuform rounds */
|
3017
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
3018
|
|
- exc->ignore_x_mode &&
|
3019
|
|
- ( ( I == 24 &&
|
3020
|
|
- ( exc->face->sph_found_func_flags &
|
3021
|
|
- ( SPH_FDEF_SPACING_1 |
|
3022
|
|
- SPH_FDEF_SPACING_2 ) ) ) ||
|
3023
|
|
- ( I == 22 &&
|
3024
|
|
- ( exc->sph_in_func_flags &
|
3025
|
|
- SPH_FDEF_TYPEMAN_STROKES ) ) ||
|
3026
|
|
- ( I == 8 &&
|
3027
|
|
- ( exc->face->sph_found_func_flags &
|
3028
|
|
- SPH_FDEF_VACUFORM_ROUND_1 ) &&
|
3029
|
|
- exc->iup_called ) ) )
|
3030
|
|
- args[0] = 0;
|
3031
|
|
- else
|
3032
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
3033
|
|
- args[0] = exc->storage[I];
|
3034
|
|
- }
|
|
2989
|
+ args[0] = exc->storage[I];
|
3035
|
2990
|
}
|
3036
|
2991
|
|
3037
|
2992
|
|
... |
... |
@@ -3545,107 +3500,6 @@ |
3545
|
3500
|
TT_DefRecord* rec;
|
3546
|
3501
|
TT_DefRecord* limit;
|
3547
|
3502
|
|
3548
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3549
|
|
- /* arguments to opcodes are skipped by `SKIP_Code' */
|
3550
|
|
- FT_Byte opcode_pattern[9][12] =
|
3551
|
|
- {
|
3552
|
|
- /* #0 inline delta function 1 */
|
3553
|
|
- {
|
3554
|
|
- 0x4B, /* PPEM */
|
3555
|
|
- 0x53, /* GTEQ */
|
3556
|
|
- 0x23, /* SWAP */
|
3557
|
|
- 0x4B, /* PPEM */
|
3558
|
|
- 0x51, /* LTEQ */
|
3559
|
|
- 0x5A, /* AND */
|
3560
|
|
- 0x58, /* IF */
|
3561
|
|
- 0x38, /* SHPIX */
|
3562
|
|
- 0x1B, /* ELSE */
|
3563
|
|
- 0x21, /* POP */
|
3564
|
|
- 0x21, /* POP */
|
3565
|
|
- 0x59 /* EIF */
|
3566
|
|
- },
|
3567
|
|
- /* #1 inline delta function 2 */
|
3568
|
|
- {
|
3569
|
|
- 0x4B, /* PPEM */
|
3570
|
|
- 0x54, /* EQ */
|
3571
|
|
- 0x58, /* IF */
|
3572
|
|
- 0x38, /* SHPIX */
|
3573
|
|
- 0x1B, /* ELSE */
|
3574
|
|
- 0x21, /* POP */
|
3575
|
|
- 0x21, /* POP */
|
3576
|
|
- 0x59 /* EIF */
|
3577
|
|
- },
|
3578
|
|
- /* #2 diagonal stroke function */
|
3579
|
|
- {
|
3580
|
|
- 0x20, /* DUP */
|
3581
|
|
- 0x20, /* DUP */
|
3582
|
|
- 0xB0, /* PUSHB_1 */
|
3583
|
|
- /* 1 */
|
3584
|
|
- 0x60, /* ADD */
|
3585
|
|
- 0x46, /* GC_cur */
|
3586
|
|
- 0xB0, /* PUSHB_1 */
|
3587
|
|
- /* 64 */
|
3588
|
|
- 0x23, /* SWAP */
|
3589
|
|
- 0x42 /* WS */
|
3590
|
|
- },
|
3591
|
|
- /* #3 VacuFormRound function */
|
3592
|
|
- {
|
3593
|
|
- 0x45, /* RCVT */
|
3594
|
|
- 0x23, /* SWAP */
|
3595
|
|
- 0x46, /* GC_cur */
|
3596
|
|
- 0x60, /* ADD */
|
3597
|
|
- 0x20, /* DUP */
|
3598
|
|
- 0xB0 /* PUSHB_1 */
|
3599
|
|
- /* 38 */
|
3600
|
|
- },
|
3601
|
|
- /* #4 TTFautohint bytecode (old) */
|
3602
|
|
- {
|
3603
|
|
- 0x20, /* DUP */
|
3604
|
|
- 0x64, /* ABS */
|
3605
|
|
- 0xB0, /* PUSHB_1 */
|
3606
|
|
- /* 32 */
|
3607
|
|
- 0x60, /* ADD */
|
3608
|
|
- 0x66, /* FLOOR */
|
3609
|
|
- 0x23, /* SWAP */
|
3610
|
|
- 0xB0 /* PUSHB_1 */
|
3611
|
|
- },
|
3612
|
|
- /* #5 spacing function 1 */
|
3613
|
|
- {
|
3614
|
|
- 0x01, /* SVTCA_x */
|
3615
|
|
- 0xB0, /* PUSHB_1 */
|
3616
|
|
- /* 24 */
|
3617
|
|
- 0x43, /* RS */
|
3618
|
|
- 0x58 /* IF */
|
3619
|
|
- },
|
3620
|
|
- /* #6 spacing function 2 */
|
3621
|
|
- {
|
3622
|
|
- 0x01, /* SVTCA_x */
|
3623
|
|
- 0x18, /* RTG */
|
3624
|
|
- 0xB0, /* PUSHB_1 */
|
3625
|
|
- /* 24 */
|
3626
|
|
- 0x43, /* RS */
|
3627
|
|
- 0x58 /* IF */
|
3628
|
|
- },
|
3629
|
|
- /* #7 TypeMan Talk DiagEndCtrl function */
|
3630
|
|
- {
|
3631
|
|
- 0x01, /* SVTCA_x */
|
3632
|
|
- 0x20, /* DUP */
|
3633
|
|
- 0xB0, /* PUSHB_1 */
|
3634
|
|
- /* 3 */
|
3635
|
|
- 0x25, /* CINDEX */
|
3636
|
|
- },
|
3637
|
|
- /* #8 TypeMan Talk Align */
|
3638
|
|
- {
|
3639
|
|
- 0x06, /* SPVTL */
|
3640
|
|
- 0x7D, /* RDTG */
|
3641
|
|
- },
|
3642
|
|
- };
|
3643
|
|
- FT_UShort opcode_patterns = 9;
|
3644
|
|
- FT_UShort opcode_pointer[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
3645
|
|
- FT_UShort opcode_size[9] = { 12, 8, 8, 6, 7, 4, 5, 4, 2 };
|
3646
|
|
- FT_UShort i;
|
3647
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
3648
|
|
-
|
3649
|
3503
|
|
3650
|
3504
|
/* FDEF is only allowed in `prep' or `fpgm' */
|
3651
|
3505
|
if ( exc->iniRange == tt_coderange_glyph )
|
... |
... |
@@ -3696,130 +3550,11 @@ |
3696
|
3550
|
if ( n > exc->maxFunc )
|
3697
|
3551
|
exc->maxFunc = (FT_UInt16)n;
|
3698
|
3552
|
|
3699
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3700
|
|
- /* We don't know for sure these are typeman functions, */
|
3701
|
|
- /* however they are only active when RS 22 is called */
|
3702
|
|
- if ( n >= 64 && n <= 66 )
|
3703
|
|
- rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_STROKES;
|
3704
|
|
-#endif
|
3705
|
|
-
|
3706
|
3553
|
/* Now skip the whole function definition. */
|
3707
|
3554
|
/* We don't allow nested IDEFS & FDEFs. */
|
3708
|
3555
|
|
3709
|
3556
|
while ( SkipCode( exc ) == SUCCESS )
|
3710
|
3557
|
{
|
3711
|
|
-
|
3712
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3713
|
|
-
|
3714
|
|
- if ( SUBPIXEL_HINTING_INFINALITY )
|
3715
|
|
- {
|
3716
|
|
- for ( i = 0; i < opcode_patterns; i++ )
|
3717
|
|
- {
|
3718
|
|
- if ( opcode_pointer[i] < opcode_size[i] &&
|
3719
|
|
- exc->opcode == opcode_pattern[i][opcode_pointer[i]] )
|
3720
|
|
- {
|
3721
|
|
- opcode_pointer[i] += 1;
|
3722
|
|
-
|
3723
|
|
- if ( opcode_pointer[i] == opcode_size[i] )
|
3724
|
|
- {
|
3725
|
|
- FT_TRACE6(( "sph: Function %d, opcode ptrn: %ld, %s %s\n",
|
3726
|
|
- i, n,
|
3727
|
|
- exc->face->root.family_name,
|
3728
|
|
- exc->face->root.style_name ));
|
3729
|
|
-
|
3730
|
|
- switch ( i )
|
3731
|
|
- {
|
3732
|
|
- case 0:
|
3733
|
|
- rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_1;
|
3734
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;
|
3735
|
|
- break;
|
3736
|
|
-
|
3737
|
|
- case 1:
|
3738
|
|
- rec->sph_fdef_flags |= SPH_FDEF_INLINE_DELTA_2;
|
3739
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;
|
3740
|
|
- break;
|
3741
|
|
-
|
3742
|
|
- case 2:
|
3743
|
|
- switch ( n )
|
3744
|
|
- {
|
3745
|
|
- /* needs to be implemented still */
|
3746
|
|
- case 58:
|
3747
|
|
- rec->sph_fdef_flags |= SPH_FDEF_DIAGONAL_STROKE;
|
3748
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;
|
3749
|
|
- }
|
3750
|
|
- break;
|
3751
|
|
-
|
3752
|
|
- case 3:
|
3753
|
|
- switch ( n )
|
3754
|
|
- {
|
3755
|
|
- case 0:
|
3756
|
|
- rec->sph_fdef_flags |= SPH_FDEF_VACUFORM_ROUND_1;
|
3757
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;
|
3758
|
|
- }
|
3759
|
|
- break;
|
3760
|
|
-
|
3761
|
|
- case 4:
|
3762
|
|
- /* probably not necessary to detect anymore */
|
3763
|
|
- rec->sph_fdef_flags |= SPH_FDEF_TTFAUTOHINT_1;
|
3764
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;
|
3765
|
|
- break;
|
3766
|
|
-
|
3767
|
|
- case 5:
|
3768
|
|
- switch ( n )
|
3769
|
|
- {
|
3770
|
|
- case 0:
|
3771
|
|
- case 1:
|
3772
|
|
- case 2:
|
3773
|
|
- case 4:
|
3774
|
|
- case 7:
|
3775
|
|
- case 8:
|
3776
|
|
- rec->sph_fdef_flags |= SPH_FDEF_SPACING_1;
|
3777
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_1;
|
3778
|
|
- }
|
3779
|
|
- break;
|
3780
|
|
-
|
3781
|
|
- case 6:
|
3782
|
|
- switch ( n )
|
3783
|
|
- {
|
3784
|
|
- case 0:
|
3785
|
|
- case 1:
|
3786
|
|
- case 2:
|
3787
|
|
- case 4:
|
3788
|
|
- case 7:
|
3789
|
|
- case 8:
|
3790
|
|
- rec->sph_fdef_flags |= SPH_FDEF_SPACING_2;
|
3791
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_SPACING_2;
|
3792
|
|
- }
|
3793
|
|
- break;
|
3794
|
|
-
|
3795
|
|
- case 7:
|
3796
|
|
- rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
|
3797
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
|
3798
|
|
- break;
|
3799
|
|
-
|
3800
|
|
- case 8:
|
3801
|
|
-#if 0
|
3802
|
|
- rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
|
3803
|
|
- exc->face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;
|
3804
|
|
-#endif
|
3805
|
|
- break;
|
3806
|
|
- }
|
3807
|
|
- opcode_pointer[i] = 0;
|
3808
|
|
- }
|
3809
|
|
- }
|
3810
|
|
-
|
3811
|
|
- else
|
3812
|
|
- opcode_pointer[i] = 0;
|
3813
|
|
- }
|
3814
|
|
-
|
3815
|
|
- /* Set sph_compatibility_mode only when deltas are detected */
|
3816
|
|
- exc->face->sph_compatibility_mode =
|
3817
|
|
- ( ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |
|
3818
|
|
- ( exc->face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );
|
3819
|
|
- }
|
3820
|
|
-
|
3821
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
3822
|
|
-
|
3823
|
3558
|
switch ( exc->opcode )
|
3824
|
3559
|
{
|
3825
|
3560
|
case 0x89: /* IDEF */
|
... |
... |
@@ -3847,10 +3582,6 @@ |
3847
|
3582
|
TT_CallRec* pRec;
|
3848
|
3583
|
|
3849
|
3584
|
|
3850
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3851
|
|
- exc->sph_in_func_flags = 0x0000;
|
3852
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
3853
|
|
-
|
3854
|
3585
|
if ( exc->callTop <= 0 ) /* We encountered an ENDF without a call */
|
3855
|
3586
|
{
|
3856
|
3587
|
exc->error = FT_THROW( ENDF_In_Exec_Stream );
|
... |
... |
@@ -3938,17 +3669,6 @@ |
3938
|
3669
|
if ( !def->active )
|
3939
|
3670
|
goto Fail;
|
3940
|
3671
|
|
3941
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
3942
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
3943
|
|
- exc->ignore_x_mode &&
|
3944
|
|
- ( ( exc->iup_called &&
|
3945
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||
|
3946
|
|
- ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) ) )
|
3947
|
|
- goto Fail;
|
3948
|
|
- else
|
3949
|
|
- exc->sph_in_func_flags = def->sph_fdef_flags;
|
3950
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
3951
|
|
-
|
3952
|
3672
|
/* check the call stack */
|
3953
|
3673
|
if ( exc->callTop >= exc->callSize )
|
3954
|
3674
|
{
|
... |
... |
@@ -4026,15 +3746,6 @@ |
4026
|
3746
|
if ( !def->active )
|
4027
|
3747
|
goto Fail;
|
4028
|
3748
|
|
4029
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
4030
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
4031
|
|
- exc->ignore_x_mode &&
|
4032
|
|
- ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) )
|
4033
|
|
- goto Fail;
|
4034
|
|
- else
|
4035
|
|
- exc->sph_in_func_flags = def->sph_fdef_flags;
|
4036
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
4037
|
|
-
|
4038
|
3749
|
/* check stack */
|
4039
|
3750
|
if ( exc->callTop >= exc->callSize )
|
4040
|
3751
|
{
|
... |
... |
@@ -4940,14 +4651,6 @@ |
4940
|
4651
|
}
|
4941
|
4652
|
}
|
4942
|
4653
|
|
4943
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
4944
|
|
- /* Disable Type 2 Vacuform Rounds - e.g. Arial Narrow */
|
4945
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
4946
|
|
- exc->ignore_x_mode &&
|
4947
|
|
- ( D < 0 ? NEG_LONG( D ) : D ) == 64 )
|
4948
|
|
- D += 1;
|
4949
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
4950
|
|
-
|
4951
|
4654
|
args[0] = D;
|
4952
|
4655
|
}
|
4953
|
4656
|
|
... |
... |
@@ -5209,13 +4912,6 @@ |
5209
|
4912
|
/* except to change the subpixel flags temporarily */
|
5210
|
4913
|
else if ( exc->iniRange == tt_coderange_glyph && K == 3 )
|
5211
|
4914
|
{
|
5212
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5213
|
|
- /* INSTCTRL modifying flag 3 also has an effect */
|
5214
|
|
- /* outside of the CVT program */
|
5215
|
|
- if ( SUBPIXEL_HINTING_INFINALITY )
|
5216
|
|
- exc->ignore_x_mode = !FT_BOOL( L == 4 );
|
5217
|
|
-#endif
|
5218
|
|
-
|
5219
|
4915
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
5220
|
4916
|
/* Native ClearType fonts sign a waiver that turns off all backward */
|
5221
|
4917
|
/* compatibility hacks and lets them program points to the grid like */
|
... |
... |
@@ -5547,12 +5243,6 @@ |
5547
|
5243
|
}
|
5548
|
5244
|
}
|
5549
|
5245
|
else
|
5550
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5551
|
|
- /* doesn't follow Cleartype spec but produces better result */
|
5552
|
|
- if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode )
|
5553
|
|
- Move_Zp2_Point( exc, point, 0, dy, TRUE );
|
5554
|
|
- else
|
5555
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
5556
|
5246
|
Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5557
|
5247
|
|
5558
|
5248
|
exc->GS.loop--;
|
... |
... |
@@ -5713,76 +5403,6 @@ |
5713
|
5403
|
}
|
5714
|
5404
|
}
|
5715
|
5405
|
else
|
5716
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5717
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
5718
|
|
- exc->ignore_x_mode )
|
5719
|
|
- {
|
5720
|
|
- FT_Int B1, B2;
|
5721
|
|
-
|
5722
|
|
-
|
5723
|
|
- /* If not using ignore_x_mode rendering, allow ZP2 move. */
|
5724
|
|
- /* If inline deltas aren't allowed, skip ZP2 move. */
|
5725
|
|
- /* If using ignore_x_mode rendering, allow ZP2 point move if: */
|
5726
|
|
- /* - freedom vector is y and sph_compatibility_mode is off */
|
5727
|
|
- /* - the glyph is composite and the move is in the Y direction */
|
5728
|
|
- /* - the glyph is specifically set to allow SHPIX moves */
|
5729
|
|
- /* - the move is on a previously Y-touched point */
|
5730
|
|
-
|
5731
|
|
- /* save point for later comparison */
|
5732
|
|
- B1 = exc->zp2.cur[point].y;
|
5733
|
|
-
|
5734
|
|
- if ( exc->face->sph_compatibility_mode )
|
5735
|
|
- {
|
5736
|
|
- if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
|
5737
|
|
- dy = FT_PIX_ROUND( B1 + dy ) - B1;
|
5738
|
|
-
|
5739
|
|
- /* skip post-iup deltas */
|
5740
|
|
- if ( exc->iup_called &&
|
5741
|
|
- ( ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||
|
5742
|
|
- ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )
|
5743
|
|
- goto Skip;
|
5744
|
|
-
|
5745
|
|
- if ( !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&
|
5746
|
|
- ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
|
5747
|
|
- ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ||
|
5748
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) )
|
5749
|
|
- Move_Zp2_Point( exc, point, 0, dy, TRUE );
|
5750
|
|
-
|
5751
|
|
- /* save new point */
|
5752
|
|
- if ( exc->GS.freeVector.y != 0 )
|
5753
|
|
- {
|
5754
|
|
- B2 = exc->zp2.cur[point].y;
|
5755
|
|
-
|
5756
|
|
- /* reverse any disallowed moves */
|
5757
|
|
- if ( ( B1 & 63 ) == 0 &&
|
5758
|
|
- ( B2 & 63 ) != 0 &&
|
5759
|
|
- B1 != B2 )
|
5760
|
|
- Move_Zp2_Point( exc, point, 0, NEG_LONG( dy ), TRUE );
|
5761
|
|
- }
|
5762
|
|
- }
|
5763
|
|
- else if ( exc->GS.freeVector.y != 0 )
|
5764
|
|
- {
|
5765
|
|
- Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5766
|
|
-
|
5767
|
|
- /* save new point */
|
5768
|
|
- B2 = exc->zp2.cur[point].y;
|
5769
|
|
-
|
5770
|
|
- /* reverse any disallowed moves */
|
5771
|
|
- if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
|
5772
|
|
- ( B1 & 63 ) != 0 &&
|
5773
|
|
- ( B2 & 63 ) != 0 &&
|
5774
|
|
- B1 != B2 )
|
5775
|
|
- Move_Zp2_Point( exc,
|
5776
|
|
- point,
|
5777
|
|
- NEG_LONG( dx ),
|
5778
|
|
- NEG_LONG( dy ),
|
5779
|
|
- TRUE );
|
5780
|
|
- }
|
5781
|
|
- else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
|
5782
|
|
- Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5783
|
|
- }
|
5784
|
|
- else
|
5785
|
|
-#endif
|
5786
|
5406
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
5787
|
5407
|
if ( SUBPIXEL_HINTING_MINIMAL &&
|
5788
|
5408
|
exc->backward_compatibility )
|
... |
... |
@@ -5802,9 +5422,6 @@ |
5802
|
5422
|
#endif
|
5803
|
5423
|
Move_Zp2_Point( exc, point, dx, dy, TRUE );
|
5804
|
5424
|
|
5805
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5806
|
|
- Skip:
|
5807
|
|
-#endif
|
5808
|
5425
|
exc->GS.loop--;
|
5809
|
5426
|
}
|
5810
|
5427
|
|
... |
... |
@@ -5849,28 +5466,6 @@ |
5849
|
5466
|
|
5850
|
5467
|
distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
|
5851
|
5468
|
|
5852
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5853
|
|
- /* subpixel hinting - make MSIRP respect CVT cut-in; */
|
5854
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
5855
|
|
- exc->ignore_x_mode &&
|
5856
|
|
- exc->GS.freeVector.x != 0 )
|
5857
|
|
- {
|
5858
|
|
- FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin;
|
5859
|
|
- FT_F26Dot6 delta;
|
5860
|
|
-
|
5861
|
|
-
|
5862
|
|
- if ( !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
|
5863
|
|
- control_value_cutin = 0;
|
5864
|
|
-
|
5865
|
|
- delta = SUB_LONG( distance, args[1] );
|
5866
|
|
- if ( delta < 0 )
|
5867
|
|
- delta = NEG_LONG( delta );
|
5868
|
|
-
|
5869
|
|
- if ( delta >= control_value_cutin )
|
5870
|
|
- distance = args[1];
|
5871
|
|
- }
|
5872
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
5873
|
|
-
|
5874
|
5469
|
exc->func_move( exc,
|
5875
|
5470
|
&exc->zp1,
|
5876
|
5471
|
point,
|
... |
... |
@@ -5911,14 +5506,7 @@ |
5911
|
5506
|
if ( ( exc->opcode & 1 ) != 0 )
|
5912
|
5507
|
{
|
5913
|
5508
|
cur_dist = FAST_PROJECT( &exc->zp0.cur[point] );
|
5914
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5915
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
5916
|
|
- exc->ignore_x_mode &&
|
5917
|
|
- exc->GS.freeVector.x != 0 )
|
5918
|
|
- distance = SUB_LONG( Round_None( exc, cur_dist, 3 ), cur_dist );
|
5919
|
|
- else
|
5920
|
|
-#endif
|
5921
|
|
- distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist );
|
|
5509
|
+ distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist );
|
5922
|
5510
|
}
|
5923
|
5511
|
else
|
5924
|
5512
|
distance = 0;
|
... |
... |
@@ -5981,27 +5569,12 @@ |
5981
|
5569
|
|
5982
|
5570
|
if ( exc->GS.gep0 == 0 ) /* If in twilight zone */
|
5983
|
5571
|
{
|
5984
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5985
|
|
- /* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */
|
5986
|
|
- /* Determined via experimentation and may be incorrect... */
|
5987
|
|
- if ( !( SUBPIXEL_HINTING_INFINALITY &&
|
5988
|
|
- ( exc->ignore_x_mode &&
|
5989
|
|
- exc->face->sph_compatibility_mode ) ) )
|
5990
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
5991
|
|
- exc->zp0.org[point].x = TT_MulFix14( distance,
|
|
5572
|
+ exc->zp0.org[point].x = TT_MulFix14( distance,
|
5992
|
5573
|
exc->GS.freeVector.x );
|
5993
|
5574
|
exc->zp0.org[point].y = TT_MulFix14( distance,
|
5994
|
5575
|
exc->GS.freeVector.y );
|
5995
|
5576
|
exc->zp0.cur[point] = exc->zp0.org[point];
|
5996
|
5577
|
}
|
5997
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
5998
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
5999
|
|
- exc->ignore_x_mode &&
|
6000
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&
|
6001
|
|
- distance > 0 &&
|
6002
|
|
- exc->GS.freeVector.y != 0 )
|
6003
|
|
- distance = 0;
|
6004
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6005
|
5578
|
|
6006
|
5579
|
org_dist = FAST_PROJECT( &exc->zp0.cur[point] );
|
6007
|
5580
|
|
... |
... |
@@ -6011,15 +5584,6 @@ |
6011
|
5584
|
FT_F26Dot6 delta;
|
6012
|
5585
|
|
6013
|
5586
|
|
6014
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6015
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6016
|
|
- exc->ignore_x_mode &&
|
6017
|
|
- exc->GS.freeVector.x != 0 &&
|
6018
|
|
- exc->GS.freeVector.y == 0 &&
|
6019
|
|
- !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
|
6020
|
|
- control_value_cutin = 0;
|
6021
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6022
|
|
-
|
6023
|
5587
|
delta = SUB_LONG( distance, org_dist );
|
6024
|
5588
|
if ( delta < 0 )
|
6025
|
5589
|
delta = NEG_LONG( delta );
|
... |
... |
@@ -6027,14 +5591,7 @@ |
6027
|
5591
|
if ( delta > control_value_cutin )
|
6028
|
5592
|
distance = org_dist;
|
6029
|
5593
|
|
6030
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6031
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6032
|
|
- exc->ignore_x_mode &&
|
6033
|
|
- exc->GS.freeVector.x != 0 )
|
6034
|
|
- distance = Round_None( exc, distance, 3 );
|
6035
|
|
- else
|
6036
|
|
-#endif
|
6037
|
|
- distance = exc->func_round( exc, distance, 3 );
|
|
5594
|
+ distance = exc->func_round( exc, distance, 3 );
|
6038
|
5595
|
}
|
6039
|
5596
|
|
6040
|
5597
|
exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) );
|
... |
... |
@@ -6127,14 +5684,7 @@ |
6127
|
5684
|
|
6128
|
5685
|
if ( ( exc->opcode & 4 ) != 0 )
|
6129
|
5686
|
{
|
6130
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6131
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6132
|
|
- exc->ignore_x_mode &&
|
6133
|
|
- exc->GS.freeVector.x != 0 )
|
6134
|
|
- distance = Round_None( exc, org_dist, exc->opcode & 3 );
|
6135
|
|
- else
|
6136
|
|
-#endif
|
6137
|
|
- distance = exc->func_round( exc, org_dist, exc->opcode & 3 );
|
|
5687
|
+ distance = exc->func_round( exc, org_dist, exc->opcode & 3 );
|
6138
|
5688
|
}
|
6139
|
5689
|
else
|
6140
|
5690
|
distance = Round_None( exc, org_dist, exc->opcode & 3 );
|
... |
... |
@@ -6146,14 +5696,6 @@ |
6146
|
5696
|
FT_F26Dot6 minimum_distance = exc->GS.minimum_distance;
|
6147
|
5697
|
|
6148
|
5698
|
|
6149
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6150
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6151
|
|
- exc->ignore_x_mode &&
|
6152
|
|
- exc->GS.freeVector.x != 0 &&
|
6153
|
|
- !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
|
6154
|
|
- minimum_distance = 0;
|
6155
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6156
|
|
-
|
6157
|
5699
|
if ( org_dist >= 0 )
|
6158
|
5700
|
{
|
6159
|
5701
|
if ( distance < minimum_distance )
|
... |
... |
@@ -6296,41 +5838,7 @@ |
6296
|
5838
|
distance = exc->func_round( exc, cvt_dist, exc->opcode & 3 );
|
6297
|
5839
|
}
|
6298
|
5840
|
else
|
6299
|
|
- {
|
6300
|
|
-
|
6301
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6302
|
|
- /* do cvt cut-in always in MIRP for sph */
|
6303
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6304
|
|
- exc->ignore_x_mode &&
|
6305
|
|
- exc->GS.gep0 == exc->GS.gep1 )
|
6306
|
|
- {
|
6307
|
|
- FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin;
|
6308
|
|
-
|
6309
|
|
-
|
6310
|
|
- if ( exc->GS.freeVector.x != 0 &&
|
6311
|
|
- !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
|
6312
|
|
- control_value_cutin = 0;
|
6313
|
|
-
|
6314
|
|
- if ( exc->GS.freeVector.y != 0 &&
|
6315
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )
|
6316
|
|
- {
|
6317
|
|
- if ( cur_dist < -64 )
|
6318
|
|
- cvt_dist -= 16;
|
6319
|
|
- else if ( cur_dist > 64 && cur_dist < 84 )
|
6320
|
|
- cvt_dist += 32;
|
6321
|
|
- }
|
6322
|
|
-
|
6323
|
|
- delta = SUB_LONG( cvt_dist, org_dist );
|
6324
|
|
- if ( delta < 0 )
|
6325
|
|
- delta = NEG_LONG( delta );
|
6326
|
|
-
|
6327
|
|
- if ( delta > control_value_cutin )
|
6328
|
|
- cvt_dist = org_dist;
|
6329
|
|
- }
|
6330
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6331
|
|
-
|
6332
|
5841
|
distance = Round_None( exc, cvt_dist, exc->opcode & 3 );
|
6333
|
|
- }
|
6334
|
5842
|
|
6335
|
5843
|
/* minimum distance test */
|
6336
|
5844
|
|
... |
... |
@@ -6339,14 +5847,6 @@ |
6339
|
5847
|
FT_F26Dot6 minimum_distance = exc->GS.minimum_distance;
|
6340
|
5848
|
|
6341
|
5849
|
|
6342
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6343
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6344
|
|
- exc->ignore_x_mode &&
|
6345
|
|
- exc->GS.freeVector.x != 0 &&
|
6346
|
|
- !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
|
6347
|
|
- minimum_distance = 0;
|
6348
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6349
|
|
-
|
6350
|
5850
|
if ( org_dist >= 0 )
|
6351
|
5851
|
{
|
6352
|
5852
|
if ( distance < minimum_distance )
|
... |
... |
@@ -6359,51 +5859,10 @@ |
6359
|
5859
|
}
|
6360
|
5860
|
}
|
6361
|
5861
|
|
6362
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6363
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6364
|
|
- exc->ignore_x_mode &&
|
6365
|
|
- exc->GS.freeVector.y != 0 )
|
6366
|
|
- {
|
6367
|
|
- FT_Int B1, B2;
|
6368
|
|
-
|
6369
|
|
-
|
6370
|
|
- B1 = exc->zp1.cur[point].y;
|
6371
|
|
-
|
6372
|
|
- /* Round moves if necessary */
|
6373
|
|
- if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
|
6374
|
|
- distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist;
|
6375
|
|
-
|
6376
|
|
- if ( ( exc->opcode & 16 ) == 0 &&
|
6377
|
|
- ( exc->opcode & 8 ) == 0 &&
|
6378
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )
|
6379
|
|
- distance += 64;
|
6380
|
|
-
|
6381
|
|
- exc->func_move( exc,
|
6382
|
|
- &exc->zp1,
|
6383
|
|
- point,
|
6384
|
|
- SUB_LONG( distance, cur_dist ) );
|
6385
|
|
-
|
6386
|
|
- B2 = exc->zp1.cur[point].y;
|
6387
|
|
-
|
6388
|
|
- /* Reverse move if necessary */
|
6389
|
|
- if ( ( exc->face->sph_compatibility_mode &&
|
6390
|
|
- ( B1 & 63 ) == 0 &&
|
6391
|
|
- ( B2 & 63 ) != 0 ) ||
|
6392
|
|
- ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&
|
6393
|
|
- ( B1 & 63 ) != 0 &&
|
6394
|
|
- ( B2 & 63 ) != 0 ) )
|
6395
|
|
- exc->func_move( exc,
|
6396
|
|
- &exc->zp1,
|
6397
|
|
- point,
|
6398
|
|
- SUB_LONG( cur_dist, distance ) );
|
6399
|
|
- }
|
6400
|
|
- else
|
6401
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6402
|
|
-
|
6403
|
|
- exc->func_move( exc,
|
6404
|
|
- &exc->zp1,
|
6405
|
|
- point,
|
6406
|
|
- SUB_LONG( distance, cur_dist ) );
|
|
5862
|
+ exc->func_move( exc,
|
|
5863
|
+ &exc->zp1,
|
|
5864
|
+ point,
|
|
5865
|
+ SUB_LONG( distance, cur_dist ) );
|
6407
|
5866
|
|
6408
|
5867
|
Fail:
|
6409
|
5868
|
exc->GS.rp1 = exc->GS.rp0;
|
... |
... |
@@ -6428,17 +5887,6 @@ |
6428
|
5887
|
FT_F26Dot6 distance;
|
6429
|
5888
|
|
6430
|
5889
|
|
6431
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
6432
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
6433
|
|
- exc->ignore_x_mode &&
|
6434
|
|
- exc->iup_called &&
|
6435
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )
|
6436
|
|
- {
|
6437
|
|
- exc->error = FT_THROW( Invalid_Reference );
|
6438
|
|
- goto Fail;
|
6439
|
|
- }
|
6440
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
6441
|
|
-
|
6442
|
5890
|
if ( exc->top < exc->GS.loop ||
|
6443
|
5891
|
BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
|
6444
|
5892
|
{
|
... |
... |
@@ -6997,16 +6445,6 @@ |
6997
|
6445
|
contour = 0;
|
6998
|
6446
|
point = 0;
|
6999
|
6447
|
|
7000
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7001
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
7002
|
|
- exc->ignore_x_mode )
|
7003
|
|
- {
|
7004
|
|
- exc->iup_called = TRUE;
|
7005
|
|
- if ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_IUP )
|
7006
|
|
- return;
|
7007
|
|
- }
|
7008
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7009
|
|
-
|
7010
|
6448
|
do
|
7011
|
6449
|
{
|
7012
|
6450
|
end_point = exc->pts.contours[contour] - exc->pts.first_point;
|
... |
... |
@@ -7079,14 +6517,6 @@ |
7079
|
6517
|
FT_Long B;
|
7080
|
6518
|
|
7081
|
6519
|
|
7082
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7083
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
7084
|
|
- exc->ignore_x_mode &&
|
7085
|
|
- exc->iup_called &&
|
7086
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )
|
7087
|
|
- goto Fail;
|
7088
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7089
|
|
-
|
7090
|
6520
|
P = (FT_ULong)exc->func_cur_ppem( exc );
|
7091
|
6521
|
nump = (FT_ULong)args[0]; /* some points theoretically may occur more
|
7092
|
6522
|
than once, thus UShort isn't enough */
|
... |
... |
@@ -7139,87 +6569,21 @@ |
7139
|
6569
|
B++;
|
7140
|
6570
|
B *= 1L << ( 6 - exc->GS.delta_shift );
|
7141
|
6571
|
|
7142
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7143
|
6572
|
|
7144
|
|
- if ( SUBPIXEL_HINTING_INFINALITY )
|
|
6573
|
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
6574
|
+ /* See `ttinterp.h' for details on backward compatibility */
|
|
6575
|
+ /* mode. */
|
|
6576
|
+ if ( SUBPIXEL_HINTING_MINIMAL &&
|
|
6577
|
+ exc->backward_compatibility )
|
7145
|
6578
|
{
|
7146
|
|
- /*
|
7147
|
|
- * Allow delta move if
|
7148
|
|
- *
|
7149
|
|
- * - not using ignore_x_mode rendering,
|
7150
|
|
- * - glyph is specifically set to allow it, or
|
7151
|
|
- * - glyph is composite and freedom vector is not in subpixel
|
7152
|
|
- * direction.
|
7153
|
|
- */
|
7154
|
|
- if ( !exc->ignore_x_mode ||
|
7155
|
|
- ( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
|
7156
|
|
- ( exc->is_composite && exc->GS.freeVector.y != 0 ) )
|
|
6579
|
+ if ( !( exc->iupx_called && exc->iupy_called ) &&
|
|
6580
|
+ ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
|
|
6581
|
+ ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) )
|
7157
|
6582
|
exc->func_move( exc, &exc->zp0, A, B );
|
7158
|
|
-
|
7159
|
|
- /* Otherwise, apply subpixel hinting and compatibility mode */
|
7160
|
|
- /* rules, always skipping deltas in subpixel direction. */
|
7161
|
|
- else if ( exc->ignore_x_mode && exc->GS.freeVector.y != 0 )
|
7162
|
|
- {
|
7163
|
|
- FT_UShort B1, B2;
|
7164
|
|
-
|
7165
|
|
-
|
7166
|
|
- /* save the y value of the point now; compare after move */
|
7167
|
|
- B1 = (FT_UShort)exc->zp0.cur[A].y;
|
7168
|
|
-
|
7169
|
|
- /* Standard subpixel hinting: Allow y move for y-touched */
|
7170
|
|
- /* points. This messes up DejaVu ... */
|
7171
|
|
- if ( !exc->face->sph_compatibility_mode &&
|
7172
|
|
- ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
|
7173
|
|
- exc->func_move( exc, &exc->zp0, A, B );
|
7174
|
|
-
|
7175
|
|
- /* compatibility mode */
|
7176
|
|
- else if ( exc->face->sph_compatibility_mode &&
|
7177
|
|
- !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )
|
7178
|
|
- {
|
7179
|
|
- if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )
|
7180
|
|
- B = FT_PIX_ROUND( B1 + B ) - B1;
|
7181
|
|
-
|
7182
|
|
- /* Allow delta move if using sph_compatibility_mode, */
|
7183
|
|
- /* IUP has not been called, and point is touched on Y. */
|
7184
|
|
- if ( !exc->iup_called &&
|
7185
|
|
- ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
|
7186
|
|
- exc->func_move( exc, &exc->zp0, A, B );
|
7187
|
|
- }
|
7188
|
|
-
|
7189
|
|
- B2 = (FT_UShort)exc->zp0.cur[A].y;
|
7190
|
|
-
|
7191
|
|
- /* Reverse this move if it results in a disallowed move */
|
7192
|
|
- if ( exc->GS.freeVector.y != 0 &&
|
7193
|
|
- ( ( exc->face->sph_compatibility_mode &&
|
7194
|
|
- ( B1 & 63 ) == 0 &&
|
7195
|
|
- ( B2 & 63 ) != 0 ) ||
|
7196
|
|
- ( ( exc->sph_tweak_flags &
|
7197
|
|
- SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&
|
7198
|
|
- ( B1 & 63 ) != 0 &&
|
7199
|
|
- ( B2 & 63 ) != 0 ) ) )
|
7200
|
|
- exc->func_move( exc, &exc->zp0, A, NEG_LONG( B ) );
|
7201
|
|
- }
|
7202
|
6583
|
}
|
7203
|
6584
|
else
|
7204
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7205
|
|
-
|
7206
|
|
- {
|
7207
|
|
-
|
7208
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
7209
|
|
- /* See `ttinterp.h' for details on backward compatibility */
|
7210
|
|
- /* mode. */
|
7211
|
|
- if ( SUBPIXEL_HINTING_MINIMAL &&
|
7212
|
|
- exc->backward_compatibility )
|
7213
|
|
- {
|
7214
|
|
- if ( !( exc->iupx_called && exc->iupy_called ) &&
|
7215
|
|
- ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
|
7216
|
|
- ( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) )
|
7217
|
|
- exc->func_move( exc, &exc->zp0, A, B );
|
7218
|
|
- }
|
7219
|
|
- else
|
7220
|
6585
|
#endif
|
7221
|
|
- exc->func_move( exc, &exc->zp0, A, B );
|
7222
|
|
- }
|
|
6586
|
+ exc->func_move( exc, &exc->zp0, A, B );
|
7223
|
6587
|
}
|
7224
|
6588
|
}
|
7225
|
6589
|
else
|
... |
... |
@@ -7333,31 +6697,8 @@ |
7333
|
6697
|
|
7334
|
6698
|
K = 0;
|
7335
|
6699
|
|
7336
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7337
|
|
- /*********************************
|
7338
|
|
- * RASTERIZER VERSION
|
7339
|
|
- * Selector Bit: 0
|
7340
|
|
- * Return Bit(s): 0-7
|
7341
|
|
- */
|
7342
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
7343
|
|
- ( args[0] & 1 ) != 0 &&
|
7344
|
|
- exc->subpixel_hinting )
|
7345
|
|
- {
|
7346
|
|
- if ( exc->ignore_x_mode )
|
7347
|
|
- {
|
7348
|
|
- /* if in ClearType backward compatibility mode, */
|
7349
|
|
- /* we sometimes change the TrueType version dynamically */
|
7350
|
|
- K = exc->rasterizer_version;
|
7351
|
|
- FT_TRACE6(( "Setting rasterizer version %d\n",
|
7352
|
|
- exc->rasterizer_version ));
|
7353
|
|
- }
|
7354
|
|
- else
|
7355
|
|
- K = TT_INTERPRETER_VERSION_38;
|
7356
|
|
- }
|
7357
|
|
- else
|
7358
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7359
|
|
- if ( ( args[0] & 1 ) != 0 )
|
7360
|
|
- K = driver->interpreter_version;
|
|
6700
|
+ if ( ( args[0] & 1 ) != 0 )
|
|
6701
|
+ K = driver->interpreter_version;
|
7361
|
6702
|
|
7362
|
6703
|
/*********************************
|
7363
|
6704
|
* GLYPH ROTATED
|
... |
... |
@@ -7454,89 +6795,6 @@ |
7454
|
6795
|
}
|
7455
|
6796
|
#endif
|
7456
|
6797
|
|
7457
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7458
|
|
-
|
7459
|
|
- if ( SUBPIXEL_HINTING_INFINALITY &&
|
7460
|
|
- exc->rasterizer_version >= TT_INTERPRETER_VERSION_35 )
|
7461
|
|
- {
|
7462
|
|
-
|
7463
|
|
- if ( exc->rasterizer_version >= 37 )
|
7464
|
|
- {
|
7465
|
|
- /*********************************
|
7466
|
|
- * HINTING FOR SUBPIXEL
|
7467
|
|
- * Selector Bit: 6
|
7468
|
|
- * Return Bit(s): 13
|
7469
|
|
- */
|
7470
|
|
- if ( ( args[0] & 64 ) != 0 && exc->subpixel_hinting )
|
7471
|
|
- K |= 1 << 13;
|
7472
|
|
-
|
7473
|
|
- /*********************************
|
7474
|
|
- * COMPATIBLE WIDTHS ENABLED
|
7475
|
|
- * Selector Bit: 7
|
7476
|
|
- * Return Bit(s): 14
|
7477
|
|
- *
|
7478
|
|
- * Functionality still needs to be added
|
7479
|
|
- */
|
7480
|
|
- if ( ( args[0] & 128 ) != 0 && exc->compatible_widths )
|
7481
|
|
- K |= 1 << 14;
|
7482
|
|
-
|
7483
|
|
- /*********************************
|
7484
|
|
- * VERTICAL LCD SUBPIXELS?
|
7485
|
|
- * Selector Bit: 8
|
7486
|
|
- * Return Bit(s): 15
|
7487
|
|
- *
|
7488
|
|
- * Functionality still needs to be added
|
7489
|
|
- */
|
7490
|
|
- if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd )
|
7491
|
|
- K |= 1 << 15;
|
7492
|
|
-
|
7493
|
|
- /*********************************
|
7494
|
|
- * HINTING FOR BGR?
|
7495
|
|
- * Selector Bit: 9
|
7496
|
|
- * Return Bit(s): 16
|
7497
|
|
- *
|
7498
|
|
- * Functionality still needs to be added
|
7499
|
|
- */
|
7500
|
|
- if ( ( args[0] & 512 ) != 0 && exc->bgr )
|
7501
|
|
- K |= 1 << 16;
|
7502
|
|
-
|
7503
|
|
- if ( exc->rasterizer_version >= 38 )
|
7504
|
|
- {
|
7505
|
|
- /*********************************
|
7506
|
|
- * SUBPIXEL POSITIONED?
|
7507
|
|
- * Selector Bit: 10
|
7508
|
|
- * Return Bit(s): 17
|
7509
|
|
- *
|
7510
|
|
- * Functionality still needs to be added
|
7511
|
|
- */
|
7512
|
|
- if ( ( args[0] & 1024 ) != 0 && exc->subpixel_positioned )
|
7513
|
|
- K |= 1 << 17;
|
7514
|
|
-
|
7515
|
|
- /*********************************
|
7516
|
|
- * SYMMETRICAL SMOOTHING
|
7517
|
|
- * Selector Bit: 11
|
7518
|
|
- * Return Bit(s): 18
|
7519
|
|
- *
|
7520
|
|
- * Functionality still needs to be added
|
7521
|
|
- */
|
7522
|
|
- if ( ( args[0] & 2048 ) != 0 && exc->symmetrical_smoothing )
|
7523
|
|
- K |= 1 << 18;
|
7524
|
|
-
|
7525
|
|
- /*********************************
|
7526
|
|
- * GRAY CLEARTYPE
|
7527
|
|
- * Selector Bit: 12
|
7528
|
|
- * Return Bit(s): 19
|
7529
|
|
- *
|
7530
|
|
- * Functionality still needs to be added
|
7531
|
|
- */
|
7532
|
|
- if ( ( args[0] & 4096 ) != 0 && exc->gray_cleartype )
|
7533
|
|
- K |= 1 << 19;
|
7534
|
|
- }
|
7535
|
|
- }
|
7536
|
|
- }
|
7537
|
|
-
|
7538
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7539
|
|
-
|
7540
|
6798
|
args[0] = K;
|
7541
|
6799
|
}
|
7542
|
6800
|
|
... |
... |
@@ -7679,20 +6937,6 @@ |
7679
|
6937
|
FT_ULong num_twilight_points;
|
7680
|
6938
|
FT_UShort i;
|
7681
|
6939
|
|
7682
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7683
|
|
- FT_Byte opcode_pattern[1][2] =
|
7684
|
|
- {
|
7685
|
|
- /* #8 TypeMan Talk Align */
|
7686
|
|
- {
|
7687
|
|
- 0x06, /* SPVTL */
|
7688
|
|
- 0x7D, /* RDTG */
|
7689
|
|
- },
|
7690
|
|
- };
|
7691
|
|
- FT_UShort opcode_patterns = 1;
|
7692
|
|
- FT_UShort opcode_pointer[1] = { 0 };
|
7693
|
|
- FT_UShort opcode_size[1] = { 1 };
|
7694
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7695
|
|
-
|
7696
|
6940
|
|
7697
|
6941
|
/* We restrict the number of twilight points to a reasonable, */
|
7698
|
6942
|
/* heuristic value to avoid slow execution of malformed bytecode. */
|
... |
... |
@@ -7770,9 +7014,6 @@ |
7770
|
7014
|
Compute_Round( exc, (FT_Byte)exc->GS.round_state );
|
7771
|
7015
|
|
7772
|
7016
|
/* These flags cancel execution of some opcodes after IUP is called */
|
7773
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7774
|
|
- exc->iup_called = FALSE;
|
7775
|
|
-#endif
|
7776
|
7017
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
7777
|
7018
|
exc->iupx_called = FALSE;
|
7778
|
7019
|
exc->iupy_called = FALSE;
|
... |
... |
@@ -7862,39 +7103,6 @@ |
7862
|
7103
|
exc->step_ins = TRUE;
|
7863
|
7104
|
exc->error = FT_Err_Ok;
|
7864
|
7105
|
|
7865
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
7866
|
|
-
|
7867
|
|
- if ( SUBPIXEL_HINTING_INFINALITY )
|
7868
|
|
- {
|
7869
|
|
- for ( i = 0; i < opcode_patterns; i++ )
|
7870
|
|
- {
|
7871
|
|
- if ( opcode_pointer[i] < opcode_size[i] &&
|
7872
|
|
- exc->opcode == opcode_pattern[i][opcode_pointer[i]] )
|
7873
|
|
- {
|
7874
|
|
- opcode_pointer[i] += 1;
|
7875
|
|
-
|
7876
|
|
- if ( opcode_pointer[i] == opcode_size[i] )
|
7877
|
|
- {
|
7878
|
|
- FT_TRACE6(( "sph: opcode ptrn: %d, %s %s\n",
|
7879
|
|
- i,
|
7880
|
|
- exc->face->root.family_name,
|
7881
|
|
- exc->face->root.style_name ));
|
7882
|
|
-
|
7883
|
|
- switch ( i )
|
7884
|
|
- {
|
7885
|
|
- case 0:
|
7886
|
|
- break;
|
7887
|
|
- }
|
7888
|
|
- opcode_pointer[i] = 0;
|
7889
|
|
- }
|
7890
|
|
- }
|
7891
|
|
- else
|
7892
|
|
- opcode_pointer[i] = 0;
|
7893
|
|
- }
|
7894
|
|
- }
|
7895
|
|
-
|
7896
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
7897
|
|
-
|
7898
|
7106
|
{
|
7899
|
7107
|
FT_Long* args = exc->stack + exc->args;
|
7900
|
7108
|
FT_Byte opcode = exc->opcode;
|
src/truetype/ttinterp.h
... |
... |
@@ -98,48 +98,6 @@ FT_BEGIN_HEADER |
98
|
98
|
} TT_CallRec, *TT_CallStack;
|
99
|
99
|
|
100
|
100
|
|
101
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
102
|
|
-
|
103
|
|
- /**************************************************************************
|
104
|
|
- *
|
105
|
|
- * These structures define rules used to tweak subpixel hinting for
|
106
|
|
- * various fonts. "", 0, "", NULL value indicates to match any value.
|
107
|
|
- */
|
108
|
|
-
|
109
|
|
-#define SPH_MAX_NAME_SIZE 32
|
110
|
|
-#define SPH_MAX_CLASS_MEMBERS 100
|
111
|
|
-
|
112
|
|
- typedef struct SPH_TweakRule_
|
113
|
|
- {
|
114
|
|
- const char family[SPH_MAX_NAME_SIZE];
|
115
|
|
- const FT_UInt ppem;
|
116
|
|
- const char style[SPH_MAX_NAME_SIZE];
|
117
|
|
- const FT_ULong glyph;
|
118
|
|
-
|
119
|
|
- } SPH_TweakRule;
|
120
|
|
-
|
121
|
|
-
|
122
|
|
- typedef struct SPH_ScaleRule_
|
123
|
|
- {
|
124
|
|
- const char family[SPH_MAX_NAME_SIZE];
|
125
|
|
- const FT_UInt ppem;
|
126
|
|
- const char style[SPH_MAX_NAME_SIZE];
|
127
|
|
- const FT_ULong glyph;
|
128
|
|
- const FT_ULong scale;
|
129
|
|
-
|
130
|
|
- } SPH_ScaleRule;
|
131
|
|
-
|
132
|
|
-
|
133
|
|
- typedef struct SPH_Font_Class_
|
134
|
|
- {
|
135
|
|
- const char name[SPH_MAX_NAME_SIZE];
|
136
|
|
- const char member[SPH_MAX_CLASS_MEMBERS][SPH_MAX_NAME_SIZE];
|
137
|
|
-
|
138
|
|
- } SPH_Font_Class;
|
139
|
|
-
|
140
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
141
|
|
-
|
142
|
|
-
|
143
|
101
|
/**************************************************************************
|
144
|
102
|
*
|
145
|
103
|
* The main structure for the interpreter which collects all necessary
|
... |
... |
@@ -399,38 +357,6 @@ FT_BEGIN_HEADER |
399
|
357
|
FT_Bool grayscale_cleartype;
|
400
|
358
|
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
|
401
|
359
|
|
402
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
403
|
|
- TT_Round_Func func_round_sphn; /* subpixel rounding function */
|
404
|
|
-
|
405
|
|
- FT_Bool subpixel_hinting; /* Using subpixel hinting? */
|
406
|
|
- FT_Bool ignore_x_mode; /* Standard rendering mode for */
|
407
|
|
- /* subpixel hinting. On if gray */
|
408
|
|
- /* or subpixel hinting is on. */
|
409
|
|
-
|
410
|
|
- /* The following 6 aren't fully implemented but here for MS rasterizer */
|
411
|
|
- /* compatibility. */
|
412
|
|
- FT_Bool compatible_widths; /* compatible widths? */
|
413
|
|
- FT_Bool symmetrical_smoothing; /* symmetrical_smoothing? */
|
414
|
|
- FT_Bool bgr; /* bgr instead of rgb? */
|
415
|
|
- FT_Bool vertical_lcd; /* long side of LCD subpixel */
|
416
|
|
- /* rectangles is horizontal */
|
417
|
|
- FT_Bool subpixel_positioned; /* subpixel positioned */
|
418
|
|
- /* (DirectWrite ClearType)? */
|
419
|
|
- FT_Bool gray_cleartype; /* ClearType hinting but */
|
420
|
|
- /* grayscale rendering */
|
421
|
|
-
|
422
|
|
- FT_Int rasterizer_version; /* MS rasterizer version */
|
423
|
|
-
|
424
|
|
- FT_Bool iup_called; /* IUP called for glyph? */
|
425
|
|
-
|
426
|
|
- FT_ULong sph_tweak_flags; /* flags to control */
|
427
|
|
- /* hint tweaks */
|
428
|
|
-
|
429
|
|
- FT_ULong sph_in_func_flags; /* flags to indicate if in */
|
430
|
|
- /* special functions */
|
431
|
|
-
|
432
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
433
|
|
-
|
434
|
360
|
/* We maintain two counters (in addition to the instruction counter) */
|
435
|
361
|
/* that act as loop detectors for LOOPCALL and jump opcodes with */
|
436
|
362
|
/* negative arguments. */
|
src/truetype/ttobjs.c
... |
... |
@@ -1481,9 +1481,6 @@ |
1481
|
1481
|
TT_Driver driver = (TT_Driver)ttdriver;
|
1482
|
1482
|
|
1483
|
1483
|
driver->interpreter_version = TT_INTERPRETER_VERSION_35;
|
1484
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
1485
|
|
- driver->interpreter_version = TT_INTERPRETER_VERSION_38;
|
1486
|
|
-#endif
|
1487
|
1484
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
1488
|
1485
|
driver->interpreter_version = TT_INTERPRETER_VERSION_40;
|
1489
|
1486
|
#endif
|
src/truetype/ttsubpix.c
deleted
1
|
|
-/****************************************************************************
|
2
|
|
- *
|
3
|
|
- * ttsubpix.c
|
4
|
|
- *
|
5
|
|
- * TrueType Subpixel Hinting.
|
6
|
|
- *
|
7
|
|
- * Copyright (C) 2010-2023 by
|
8
|
|
- * David Turner, Robert Wilhelm, and Werner Lemberg.
|
9
|
|
- *
|
10
|
|
- * This file is part of the FreeType project, and may only be used,
|
11
|
|
- * modified, and distributed under the terms of the FreeType project
|
12
|
|
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
|
13
|
|
- * this file you indicate that you have read the license and
|
14
|
|
- * understand and accept it fully.
|
15
|
|
- *
|
16
|
|
- */
|
17
|
|
-
|
18
|
|
-#include <freetype/internal/ftdebug.h>
|
19
|
|
-#include <freetype/internal/ftcalc.h>
|
20
|
|
-#include <freetype/internal/ftstream.h>
|
21
|
|
-#include <freetype/internal/sfnt.h>
|
22
|
|
-#include <freetype/tttags.h>
|
23
|
|
-#include <freetype/ftoutln.h>
|
24
|
|
-#include <freetype/ftdriver.h>
|
25
|
|
-
|
26
|
|
-#include "ttsubpix.h"
|
27
|
|
-
|
28
|
|
-
|
29
|
|
-#if defined( TT_USE_BYTECODE_INTERPRETER ) && \
|
30
|
|
- defined( TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY )
|
31
|
|
-
|
32
|
|
- /**************************************************************************
|
33
|
|
- *
|
34
|
|
- * These rules affect how the TT Interpreter does hinting, with the
|
35
|
|
- * goal of doing subpixel hinting by (in general) ignoring x moves.
|
36
|
|
- * Some of these rules are fixes that go above and beyond the
|
37
|
|
- * stated techniques in the MS whitepaper on Cleartype, due to
|
38
|
|
- * artifacts in many glyphs. So, these rules make some glyphs render
|
39
|
|
- * better than they do in the MS rasterizer.
|
40
|
|
- *
|
41
|
|
- * "" string or 0 int/char indicates to apply to all glyphs.
|
42
|
|
- * "-" used as dummy placeholders, but any non-matching string works.
|
43
|
|
- *
|
44
|
|
- * Some of this could arguably be implemented in fontconfig, however:
|
45
|
|
- *
|
46
|
|
- * - Fontconfig can't set things on a glyph-by-glyph basis.
|
47
|
|
- * - The tweaks that happen here are very low-level, from an average
|
48
|
|
- * user's point of view and are best implemented in the hinter.
|
49
|
|
- *
|
50
|
|
- * The goal is to make the subpixel hinting techniques as generalized
|
51
|
|
- * as possible across all fonts to prevent the need for extra rules such
|
52
|
|
- * as these.
|
53
|
|
- *
|
54
|
|
- * The rule structure is designed so that entirely new rules can easily
|
55
|
|
- * be added when a new compatibility feature is discovered.
|
56
|
|
- *
|
57
|
|
- * The rule structures could also use some enhancement to handle ranges.
|
58
|
|
- *
|
59
|
|
- * ****************** WORK IN PROGRESS *******************
|
60
|
|
- */
|
61
|
|
-
|
62
|
|
- /* These are `classes' of fonts that can be grouped together and used in */
|
63
|
|
- /* rules below. A blank entry "" is required at the end of these! */
|
64
|
|
-#define FAMILY_CLASS_RULES_SIZE 7
|
65
|
|
-
|
66
|
|
- static const SPH_Font_Class FAMILY_CLASS_Rules
|
67
|
|
- [FAMILY_CLASS_RULES_SIZE] =
|
68
|
|
- {
|
69
|
|
- { "MS Legacy Fonts",
|
70
|
|
- { "Aharoni",
|
71
|
|
- "Andale Mono",
|
72
|
|
- "Andalus",
|
73
|
|
- "Angsana New",
|
74
|
|
- "AngsanaUPC",
|
75
|
|
- "Arabic Transparent",
|
76
|
|
- "Arial Black",
|
77
|
|
- "Arial Narrow",
|
78
|
|
- "Arial Unicode MS",
|
79
|
|
- "Arial",
|
80
|
|
- "Batang",
|
81
|
|
- "Browallia New",
|
82
|
|
- "BrowalliaUPC",
|
83
|
|
- "Comic Sans MS",
|
84
|
|
- "Cordia New",
|
85
|
|
- "CordiaUPC",
|
86
|
|
- "Courier New",
|
87
|
|
- "DFKai-SB",
|
88
|
|
- "David Transparent",
|
89
|
|
- "David",
|
90
|
|
- "DilleniaUPC",
|
91
|
|
- "Estrangelo Edessa",
|
92
|
|
- "EucrosiaUPC",
|
93
|
|
- "FangSong_GB2312",
|
94
|
|
- "Fixed Miriam Transparent",
|
95
|
|
- "FrankRuehl",
|
96
|
|
- "Franklin Gothic Medium",
|
97
|
|
- "FreesiaUPC",
|
98
|
|
- "Garamond",
|
99
|
|
- "Gautami",
|
100
|
|
- "Georgia",
|
101
|
|
- "Gulim",
|
102
|
|
- "Impact",
|
103
|
|
- "IrisUPC",
|
104
|
|
- "JasmineUPC",
|
105
|
|
- "KaiTi_GB2312",
|
106
|
|
- "KodchiangUPC",
|
107
|
|
- "Latha",
|
108
|
|
- "Levenim MT",
|
109
|
|
- "LilyUPC",
|
110
|
|
- "Lucida Console",
|
111
|
|
- "Lucida Sans Unicode",
|
112
|
|
- "MS Gothic",
|
113
|
|
- "MS Mincho",
|
114
|
|
- "MV Boli",
|
115
|
|
- "Mangal",
|
116
|
|
- "Marlett",
|
117
|
|
- "Microsoft Sans Serif",
|
118
|
|
- "Mingliu",
|
119
|
|
- "Miriam Fixed",
|
120
|
|
- "Miriam Transparent",
|
121
|
|
- "Miriam",
|
122
|
|
- "Narkisim",
|
123
|
|
- "Palatino Linotype",
|
124
|
|
- "Raavi",
|
125
|
|
- "Rod Transparent",
|
126
|
|
- "Rod",
|
127
|
|
- "Shruti",
|
128
|
|
- "SimHei",
|
129
|
|
- "Simplified Arabic Fixed",
|
130
|
|
- "Simplified Arabic",
|
131
|
|
- "Simsun",
|
132
|
|
- "Sylfaen",
|
133
|
|
- "Symbol",
|
134
|
|
- "Tahoma",
|
135
|
|
- "Times New Roman",
|
136
|
|
- "Traditional Arabic",
|
137
|
|
- "Trebuchet MS",
|
138
|
|
- "Tunga",
|
139
|
|
- "Verdana",
|
140
|
|
- "Webdings",
|
141
|
|
- "Wingdings",
|
142
|
|
- "",
|
143
|
|
- },
|
144
|
|
- },
|
145
|
|
- { "Core MS Legacy Fonts",
|
146
|
|
- { "Arial Black",
|
147
|
|
- "Arial Narrow",
|
148
|
|
- "Arial Unicode MS",
|
149
|
|
- "Arial",
|
150
|
|
- "Comic Sans MS",
|
151
|
|
- "Courier New",
|
152
|
|
- "Garamond",
|
153
|
|
- "Georgia",
|
154
|
|
- "Impact",
|
155
|
|
- "Lucida Console",
|
156
|
|
- "Lucida Sans Unicode",
|
157
|
|
- "Microsoft Sans Serif",
|
158
|
|
- "Palatino Linotype",
|
159
|
|
- "Tahoma",
|
160
|
|
- "Times New Roman",
|
161
|
|
- "Trebuchet MS",
|
162
|
|
- "Verdana",
|
163
|
|
- "",
|
164
|
|
- },
|
165
|
|
- },
|
166
|
|
- { "Apple Legacy Fonts",
|
167
|
|
- { "Geneva",
|
168
|
|
- "Times",
|
169
|
|
- "Monaco",
|
170
|
|
- "Century",
|
171
|
|
- "Chalkboard",
|
172
|
|
- "Lobster",
|
173
|
|
- "Century Gothic",
|
174
|
|
- "Optima",
|
175
|
|
- "Lucida Grande",
|
176
|
|
- "Gill Sans",
|
177
|
|
- "Baskerville",
|
178
|
|
- "Helvetica",
|
179
|
|
- "Helvetica Neue",
|
180
|
|
- "",
|
181
|
|
- },
|
182
|
|
- },
|
183
|
|
- { "Legacy Sans Fonts",
|
184
|
|
- { "Andale Mono",
|
185
|
|
- "Arial Unicode MS",
|
186
|
|
- "Arial",
|
187
|
|
- "Century Gothic",
|
188
|
|
- "Comic Sans MS",
|
189
|
|
- "Franklin Gothic Medium",
|
190
|
|
- "Geneva",
|
191
|
|
- "Lucida Console",
|
192
|
|
- "Lucida Grande",
|
193
|
|
- "Lucida Sans Unicode",
|
194
|
|
- "Lucida Sans Typewriter",
|
195
|
|
- "Microsoft Sans Serif",
|
196
|
|
- "Monaco",
|
197
|
|
- "Tahoma",
|
198
|
|
- "Trebuchet MS",
|
199
|
|
- "Verdana",
|
200
|
|
- "",
|
201
|
|
- },
|
202
|
|
- },
|
203
|
|
-
|
204
|
|
- { "Misc Legacy Fonts",
|
205
|
|
- { "Dark Courier", "", }, },
|
206
|
|
- { "Verdana Clones",
|
207
|
|
- { "DejaVu Sans",
|
208
|
|
- "Bitstream Vera Sans", "", }, },
|
209
|
|
- { "Verdana and Clones",
|
210
|
|
- { "DejaVu Sans",
|
211
|
|
- "Bitstream Vera Sans",
|
212
|
|
- "Verdana", "", }, },
|
213
|
|
- };
|
214
|
|
-
|
215
|
|
-
|
216
|
|
- /* Define this to force natural (i.e. not bitmap-compatible) widths. */
|
217
|
|
- /* The default leans strongly towards natural widths except for a few */
|
218
|
|
- /* legacy fonts where a selective combination produces nicer results. */
|
219
|
|
-/* #define FORCE_NATURAL_WIDTHS */
|
220
|
|
-
|
221
|
|
-
|
222
|
|
- /* Define `classes' of styles that can be grouped together and used in */
|
223
|
|
- /* rules below. A blank entry "" is required at the end of these! */
|
224
|
|
-#define STYLE_CLASS_RULES_SIZE 5
|
225
|
|
-
|
226
|
|
- static const SPH_Font_Class STYLE_CLASS_Rules
|
227
|
|
- [STYLE_CLASS_RULES_SIZE] =
|
228
|
|
- {
|
229
|
|
- { "Regular Class",
|
230
|
|
- { "Regular",
|
231
|
|
- "Book",
|
232
|
|
- "Medium",
|
233
|
|
- "Roman",
|
234
|
|
- "Normal",
|
235
|
|
- "",
|
236
|
|
- },
|
237
|
|
- },
|
238
|
|
- { "Regular/Italic Class",
|
239
|
|
- { "Regular",
|
240
|
|
- "Book",
|
241
|
|
- "Medium",
|
242
|
|
- "Italic",
|
243
|
|
- "Oblique",
|
244
|
|
- "Roman",
|
245
|
|
- "Normal",
|
246
|
|
- "",
|
247
|
|
- },
|
248
|
|
- },
|
249
|
|
- { "Bold/BoldItalic Class",
|
250
|
|
- { "Bold",
|
251
|
|
- "Bold Italic",
|
252
|
|
- "Black",
|
253
|
|
- "",
|
254
|
|
- },
|
255
|
|
- },
|
256
|
|
- { "Bold/Italic/BoldItalic Class",
|
257
|
|
- { "Bold",
|
258
|
|
- "Bold Italic",
|
259
|
|
- "Black",
|
260
|
|
- "Italic",
|
261
|
|
- "Oblique",
|
262
|
|
- "",
|
263
|
|
- },
|
264
|
|
- },
|
265
|
|
- { "Regular/Bold Class",
|
266
|
|
- { "Regular",
|
267
|
|
- "Book",
|
268
|
|
- "Medium",
|
269
|
|
- "Normal",
|
270
|
|
- "Roman",
|
271
|
|
- "Bold",
|
272
|
|
- "Black",
|
273
|
|
- "",
|
274
|
|
- },
|
275
|
|
- },
|
276
|
|
- };
|
277
|
|
-
|
278
|
|
-
|
279
|
|
- /* Force special legacy fixes for fonts. */
|
280
|
|
-#define COMPATIBILITY_MODE_RULES_SIZE 1
|
281
|
|
-
|
282
|
|
- static const SPH_TweakRule COMPATIBILITY_MODE_Rules
|
283
|
|
- [COMPATIBILITY_MODE_RULES_SIZE] =
|
284
|
|
- {
|
285
|
|
- { "Verdana Clones", 0, "", 0 },
|
286
|
|
- };
|
287
|
|
-
|
288
|
|
-
|
289
|
|
- /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */
|
290
|
|
-#define PIXEL_HINTING_RULES_SIZE 2
|
291
|
|
-
|
292
|
|
- static const SPH_TweakRule PIXEL_HINTING_Rules
|
293
|
|
- [PIXEL_HINTING_RULES_SIZE] =
|
294
|
|
- {
|
295
|
|
- /* these characters are almost always safe */
|
296
|
|
- { "Courier New", 12, "Italic", 'z' },
|
297
|
|
- { "Courier New", 11, "Italic", 'z' },
|
298
|
|
- };
|
299
|
|
-
|
300
|
|
-
|
301
|
|
- /* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */
|
302
|
|
-#define DO_SHPIX_RULES_SIZE 1
|
303
|
|
-
|
304
|
|
- static const SPH_TweakRule DO_SHPIX_Rules
|
305
|
|
- [DO_SHPIX_RULES_SIZE] =
|
306
|
|
- {
|
307
|
|
- { "-", 0, "", 0 },
|
308
|
|
- };
|
309
|
|
-
|
310
|
|
-
|
311
|
|
- /* Skip Y moves that start with a point that is not on a Y pixel */
|
312
|
|
- /* boundary and don't move that point to a Y pixel boundary. */
|
313
|
|
-#define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 4
|
314
|
|
-
|
315
|
|
- static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
|
316
|
|
- [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
|
317
|
|
- {
|
318
|
|
- /* fix vwxyz thinness */
|
319
|
|
- { "Consolas", 0, "", 0 },
|
320
|
|
- /* Fix thin middle stems */
|
321
|
|
- { "Core MS Legacy Fonts", 0, "Regular", 0 },
|
322
|
|
- /* Cyrillic small letter I */
|
323
|
|
- { "Legacy Sans Fonts", 0, "", 0 },
|
324
|
|
- /* Fix artifacts with some Regular & Bold */
|
325
|
|
- { "Verdana Clones", 0, "", 0 },
|
326
|
|
- };
|
327
|
|
-
|
328
|
|
-
|
329
|
|
-#define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
|
330
|
|
-
|
331
|
|
- static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
|
332
|
|
- [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
|
333
|
|
- {
|
334
|
|
- /* Fixes < and > */
|
335
|
|
- { "Courier New", 0, "Regular", 0 },
|
336
|
|
- };
|
337
|
|
-
|
338
|
|
-
|
339
|
|
- /* Skip Y moves that start with a point that is not on a Y pixel */
|
340
|
|
- /* boundary and don't move that point to a Y pixel boundary. */
|
341
|
|
-#define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2
|
342
|
|
-
|
343
|
|
- static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
|
344
|
|
- [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =
|
345
|
|
- {
|
346
|
|
- /* Maintain thickness of diagonal in 'N' */
|
347
|
|
- { "Times New Roman", 0, "Regular/Bold Class", 'N' },
|
348
|
|
- { "Georgia", 0, "Regular/Bold Class", 'N' },
|
349
|
|
- };
|
350
|
|
-
|
351
|
|
-
|
352
|
|
- /* Skip Y moves that move a point off a Y pixel boundary. */
|
353
|
|
-#define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1
|
354
|
|
-
|
355
|
|
- static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
|
356
|
|
- [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
|
357
|
|
- {
|
358
|
|
- { "-", 0, "", 0 },
|
359
|
|
- };
|
360
|
|
-
|
361
|
|
-
|
362
|
|
-#define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
|
363
|
|
-
|
364
|
|
- static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
|
365
|
|
- [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
|
366
|
|
- {
|
367
|
|
- { "-", 0, "", 0 },
|
368
|
|
- };
|
369
|
|
-
|
370
|
|
-
|
371
|
|
- /* Round moves that don't move a point to a Y pixel boundary. */
|
372
|
|
-#define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2
|
373
|
|
-
|
374
|
|
- static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
|
375
|
|
- [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
|
376
|
|
- {
|
377
|
|
- /* Droid font instructions don't snap Y to pixels */
|
378
|
|
- { "Droid Sans", 0, "Regular/Italic Class", 0 },
|
379
|
|
- { "Droid Sans Mono", 0, "", 0 },
|
380
|
|
- };
|
381
|
|
-
|
382
|
|
-
|
383
|
|
-#define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
|
384
|
|
-
|
385
|
|
- static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
|
386
|
|
- [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
|
387
|
|
- {
|
388
|
|
- { "-", 0, "", 0 },
|
389
|
|
- };
|
390
|
|
-
|
391
|
|
-
|
392
|
|
- /* Allow a Direct_Move along X freedom vector if matched. */
|
393
|
|
-#define ALLOW_X_DMOVE_RULES_SIZE 1
|
394
|
|
-
|
395
|
|
- static const SPH_TweakRule ALLOW_X_DMOVE_Rules
|
396
|
|
- [ALLOW_X_DMOVE_RULES_SIZE] =
|
397
|
|
- {
|
398
|
|
- /* Fixes vanishing diagonal in 4 */
|
399
|
|
- { "Verdana", 0, "Regular", '4' },
|
400
|
|
- };
|
401
|
|
-
|
402
|
|
-
|
403
|
|
- /* Return MS rasterizer version 35 if matched. */
|
404
|
|
-#define RASTERIZER_35_RULES_SIZE 8
|
405
|
|
-
|
406
|
|
- static const SPH_TweakRule RASTERIZER_35_Rules
|
407
|
|
- [RASTERIZER_35_RULES_SIZE] =
|
408
|
|
- {
|
409
|
|
- /* This seems to be the only way to make these look good */
|
410
|
|
- { "Times New Roman", 0, "Regular", 'i' },
|
411
|
|
- { "Times New Roman", 0, "Regular", 'j' },
|
412
|
|
- { "Times New Roman", 0, "Regular", 'm' },
|
413
|
|
- { "Times New Roman", 0, "Regular", 'r' },
|
414
|
|
- { "Times New Roman", 0, "Regular", 'a' },
|
415
|
|
- { "Times New Roman", 0, "Regular", 'n' },
|
416
|
|
- { "Times New Roman", 0, "Regular", 'p' },
|
417
|
|
- { "Times", 0, "", 0 },
|
418
|
|
- };
|
419
|
|
-
|
420
|
|
-
|
421
|
|
- /* Don't round to the subpixel grid. Round to pixel grid. */
|
422
|
|
-#define NORMAL_ROUND_RULES_SIZE 1
|
423
|
|
-
|
424
|
|
- static const SPH_TweakRule NORMAL_ROUND_Rules
|
425
|
|
- [NORMAL_ROUND_RULES_SIZE] =
|
426
|
|
- {
|
427
|
|
- /* Fix serif thickness for certain ppems */
|
428
|
|
- /* Can probably be generalized somehow */
|
429
|
|
- { "Courier New", 0, "", 0 },
|
430
|
|
- };
|
431
|
|
-
|
432
|
|
-
|
433
|
|
- /* Skip IUP instructions if matched. */
|
434
|
|
-#define SKIP_IUP_RULES_SIZE 1
|
435
|
|
-
|
436
|
|
- static const SPH_TweakRule SKIP_IUP_Rules
|
437
|
|
- [SKIP_IUP_RULES_SIZE] =
|
438
|
|
- {
|
439
|
|
- { "Arial", 13, "Regular", 'a' },
|
440
|
|
- };
|
441
|
|
-
|
442
|
|
-
|
443
|
|
- /* Skip MIAP Twilight hack if matched. */
|
444
|
|
-#define MIAP_HACK_RULES_SIZE 1
|
445
|
|
-
|
446
|
|
- static const SPH_TweakRule MIAP_HACK_Rules
|
447
|
|
- [MIAP_HACK_RULES_SIZE] =
|
448
|
|
- {
|
449
|
|
- { "Geneva", 12, "", 0 },
|
450
|
|
- };
|
451
|
|
-
|
452
|
|
-
|
453
|
|
- /* Skip DELTAP instructions if matched. */
|
454
|
|
-#define ALWAYS_SKIP_DELTAP_RULES_SIZE 23
|
455
|
|
-
|
456
|
|
- static const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
|
457
|
|
- [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
|
458
|
|
- {
|
459
|
|
- { "Georgia", 0, "Regular", 'k' },
|
460
|
|
- /* fix various problems with e in different versions */
|
461
|
|
- { "Trebuchet MS", 14, "Regular", 'e' },
|
462
|
|
- { "Trebuchet MS", 13, "Regular", 'e' },
|
463
|
|
- { "Trebuchet MS", 15, "Regular", 'e' },
|
464
|
|
- { "Trebuchet MS", 0, "Italic", 'v' },
|
465
|
|
- { "Trebuchet MS", 0, "Italic", 'w' },
|
466
|
|
- { "Trebuchet MS", 0, "Regular", 'Y' },
|
467
|
|
- { "Arial", 11, "Regular", 's' },
|
468
|
|
- /* prevent problems with '3' and others */
|
469
|
|
- { "Verdana", 10, "Regular", 0 },
|
470
|
|
- { "Verdana", 9, "Regular", 0 },
|
471
|
|
- /* Cyrillic small letter short I */
|
472
|
|
- { "Legacy Sans Fonts", 0, "", 0x438 },
|
473
|
|
- { "Legacy Sans Fonts", 0, "", 0x439 },
|
474
|
|
- { "Arial", 10, "Regular", '6' },
|
475
|
|
- { "Arial", 0, "Bold/BoldItalic Class", 'a' },
|
476
|
|
- /* Make horizontal stems consistent with the rest */
|
477
|
|
- { "Arial", 24, "Bold", 'a' },
|
478
|
|
- { "Arial", 25, "Bold", 'a' },
|
479
|
|
- { "Arial", 24, "Bold", 's' },
|
480
|
|
- { "Arial", 25, "Bold", 's' },
|
481
|
|
- { "Arial", 34, "Bold", 's' },
|
482
|
|
- { "Arial", 35, "Bold", 's' },
|
483
|
|
- { "Arial", 36, "Bold", 's' },
|
484
|
|
- { "Arial", 25, "Regular", 's' },
|
485
|
|
- { "Arial", 26, "Regular", 's' },
|
486
|
|
- };
|
487
|
|
-
|
488
|
|
-
|
489
|
|
- /* Always do DELTAP instructions if matched. */
|
490
|
|
-#define ALWAYS_DO_DELTAP_RULES_SIZE 1
|
491
|
|
-
|
492
|
|
- static const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
|
493
|
|
- [ALWAYS_DO_DELTAP_RULES_SIZE] =
|
494
|
|
- {
|
495
|
|
- { "-", 0, "", 0 },
|
496
|
|
- };
|
497
|
|
-
|
498
|
|
-
|
499
|
|
- /* Don't allow ALIGNRP after IUP. */
|
500
|
|
-#define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 1
|
501
|
|
-
|
502
|
|
- static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules
|
503
|
|
- [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =
|
504
|
|
- {
|
505
|
|
- /* Prevent creation of dents in outline */
|
506
|
|
- { "-", 0, "", 0 },
|
507
|
|
- };
|
508
|
|
-
|
509
|
|
-
|
510
|
|
- /* Don't allow DELTAP after IUP. */
|
511
|
|
-#define NO_DELTAP_AFTER_IUP_RULES_SIZE 1
|
512
|
|
-
|
513
|
|
- static const SPH_TweakRule NO_DELTAP_AFTER_IUP_Rules
|
514
|
|
- [NO_DELTAP_AFTER_IUP_RULES_SIZE] =
|
515
|
|
- {
|
516
|
|
- { "-", 0, "", 0 },
|
517
|
|
- };
|
518
|
|
-
|
519
|
|
-
|
520
|
|
- /* Don't allow CALL after IUP. */
|
521
|
|
-#define NO_CALL_AFTER_IUP_RULES_SIZE 1
|
522
|
|
-
|
523
|
|
- static const SPH_TweakRule NO_CALL_AFTER_IUP_Rules
|
524
|
|
- [NO_CALL_AFTER_IUP_RULES_SIZE] =
|
525
|
|
- {
|
526
|
|
- /* Prevent creation of dents in outline */
|
527
|
|
- { "-", 0, "", 0 },
|
528
|
|
- };
|
529
|
|
-
|
530
|
|
-
|
531
|
|
- /* De-embolden these glyphs slightly. */
|
532
|
|
-#define DEEMBOLDEN_RULES_SIZE 9
|
533
|
|
-
|
534
|
|
- static const SPH_TweakRule DEEMBOLDEN_Rules
|
535
|
|
- [DEEMBOLDEN_RULES_SIZE] =
|
536
|
|
- {
|
537
|
|
- { "Courier New", 0, "Bold", 'A' },
|
538
|
|
- { "Courier New", 0, "Bold", 'W' },
|
539
|
|
- { "Courier New", 0, "Bold", 'w' },
|
540
|
|
- { "Courier New", 0, "Bold", 'M' },
|
541
|
|
- { "Courier New", 0, "Bold", 'X' },
|
542
|
|
- { "Courier New", 0, "Bold", 'K' },
|
543
|
|
- { "Courier New", 0, "Bold", 'x' },
|
544
|
|
- { "Courier New", 0, "Bold", 'z' },
|
545
|
|
- { "Courier New", 0, "Bold", 'v' },
|
546
|
|
- };
|
547
|
|
-
|
548
|
|
-
|
549
|
|
- /* Embolden these glyphs slightly. */
|
550
|
|
-#define EMBOLDEN_RULES_SIZE 2
|
551
|
|
-
|
552
|
|
- static const SPH_TweakRule EMBOLDEN_Rules
|
553
|
|
- [EMBOLDEN_RULES_SIZE] =
|
554
|
|
- {
|
555
|
|
- { "Courier New", 0, "Regular", 0 },
|
556
|
|
- { "Courier New", 0, "Italic", 0 },
|
557
|
|
- };
|
558
|
|
-
|
559
|
|
-
|
560
|
|
- /* This is a CVT hack that makes thick horizontal stems on 2, 5, 7 */
|
561
|
|
- /* similar to Windows XP. */
|
562
|
|
-#define TIMES_NEW_ROMAN_HACK_RULES_SIZE 12
|
563
|
|
-
|
564
|
|
- static const SPH_TweakRule TIMES_NEW_ROMAN_HACK_Rules
|
565
|
|
- [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =
|
566
|
|
- {
|
567
|
|
- { "Times New Roman", 16, "Italic", '2' },
|
568
|
|
- { "Times New Roman", 16, "Italic", '5' },
|
569
|
|
- { "Times New Roman", 16, "Italic", '7' },
|
570
|
|
- { "Times New Roman", 16, "Regular", '2' },
|
571
|
|
- { "Times New Roman", 16, "Regular", '5' },
|
572
|
|
- { "Times New Roman", 16, "Regular", '7' },
|
573
|
|
- { "Times New Roman", 17, "Italic", '2' },
|
574
|
|
- { "Times New Roman", 17, "Italic", '5' },
|
575
|
|
- { "Times New Roman", 17, "Italic", '7' },
|
576
|
|
- { "Times New Roman", 17, "Regular", '2' },
|
577
|
|
- { "Times New Roman", 17, "Regular", '5' },
|
578
|
|
- { "Times New Roman", 17, "Regular", '7' },
|
579
|
|
- };
|
580
|
|
-
|
581
|
|
-
|
582
|
|
- /* This fudges distance on 2 to get rid of the vanishing stem issue. */
|
583
|
|
- /* A real solution to this is certainly welcome. */
|
584
|
|
-#define COURIER_NEW_2_HACK_RULES_SIZE 15
|
585
|
|
-
|
586
|
|
- static const SPH_TweakRule COURIER_NEW_2_HACK_Rules
|
587
|
|
- [COURIER_NEW_2_HACK_RULES_SIZE] =
|
588
|
|
- {
|
589
|
|
- { "Courier New", 10, "Regular", '2' },
|
590
|
|
- { "Courier New", 11, "Regular", '2' },
|
591
|
|
- { "Courier New", 12, "Regular", '2' },
|
592
|
|
- { "Courier New", 13, "Regular", '2' },
|
593
|
|
- { "Courier New", 14, "Regular", '2' },
|
594
|
|
- { "Courier New", 15, "Regular", '2' },
|
595
|
|
- { "Courier New", 16, "Regular", '2' },
|
596
|
|
- { "Courier New", 17, "Regular", '2' },
|
597
|
|
- { "Courier New", 18, "Regular", '2' },
|
598
|
|
- { "Courier New", 19, "Regular", '2' },
|
599
|
|
- { "Courier New", 20, "Regular", '2' },
|
600
|
|
- { "Courier New", 21, "Regular", '2' },
|
601
|
|
- { "Courier New", 22, "Regular", '2' },
|
602
|
|
- { "Courier New", 23, "Regular", '2' },
|
603
|
|
- { "Courier New", 24, "Regular", '2' },
|
604
|
|
- };
|
605
|
|
-
|
606
|
|
-
|
607
|
|
-#ifndef FORCE_NATURAL_WIDTHS
|
608
|
|
-
|
609
|
|
- /* Use compatible widths with these glyphs. Compatible widths is always */
|
610
|
|
- /* on when doing B/W TrueType instructing, but is used selectively here, */
|
611
|
|
- /* typically on glyphs with 3 or more vertical stems. */
|
612
|
|
-#define COMPATIBLE_WIDTHS_RULES_SIZE 38
|
613
|
|
-
|
614
|
|
- static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
|
615
|
|
- [COMPATIBLE_WIDTHS_RULES_SIZE] =
|
616
|
|
- {
|
617
|
|
- { "Arial Unicode MS", 12, "Regular Class", 'm' },
|
618
|
|
- { "Arial Unicode MS", 14, "Regular Class", 'm' },
|
619
|
|
- /* Cyrillic small letter sha */
|
620
|
|
- { "Arial", 10, "Regular Class", 0x448 },
|
621
|
|
- { "Arial", 11, "Regular Class", 'm' },
|
622
|
|
- { "Arial", 12, "Regular Class", 'm' },
|
623
|
|
- /* Cyrillic small letter sha */
|
624
|
|
- { "Arial", 12, "Regular Class", 0x448 },
|
625
|
|
- { "Arial", 13, "Regular Class", 0x448 },
|
626
|
|
- { "Arial", 14, "Regular Class", 'm' },
|
627
|
|
- /* Cyrillic small letter sha */
|
628
|
|
- { "Arial", 14, "Regular Class", 0x448 },
|
629
|
|
- { "Arial", 15, "Regular Class", 0x448 },
|
630
|
|
- { "Arial", 17, "Regular Class", 'm' },
|
631
|
|
- { "DejaVu Sans", 15, "Regular Class", 0 },
|
632
|
|
- { "Microsoft Sans Serif", 11, "Regular Class", 0 },
|
633
|
|
- { "Microsoft Sans Serif", 12, "Regular Class", 0 },
|
634
|
|
- { "Segoe UI", 11, "Regular Class", 0 },
|
635
|
|
- { "Monaco", 0, "Regular Class", 0 },
|
636
|
|
- { "Segoe UI", 12, "Regular Class", 'm' },
|
637
|
|
- { "Segoe UI", 14, "Regular Class", 'm' },
|
638
|
|
- { "Tahoma", 11, "Regular Class", 0 },
|
639
|
|
- { "Times New Roman", 16, "Regular Class", 'c' },
|
640
|
|
- { "Times New Roman", 16, "Regular Class", 'm' },
|
641
|
|
- { "Times New Roman", 16, "Regular Class", 'o' },
|
642
|
|
- { "Times New Roman", 16, "Regular Class", 'w' },
|
643
|
|
- { "Trebuchet MS", 11, "Regular Class", 0 },
|
644
|
|
- { "Trebuchet MS", 12, "Regular Class", 0 },
|
645
|
|
- { "Trebuchet MS", 14, "Regular Class", 0 },
|
646
|
|
- { "Trebuchet MS", 15, "Regular Class", 0 },
|
647
|
|
- { "Ubuntu", 12, "Regular Class", 'm' },
|
648
|
|
- /* Cyrillic small letter sha */
|
649
|
|
- { "Verdana", 10, "Regular Class", 0x448 },
|
650
|
|
- { "Verdana", 11, "Regular Class", 0x448 },
|
651
|
|
- { "Verdana and Clones", 12, "Regular Class", 'i' },
|
652
|
|
- { "Verdana and Clones", 12, "Regular Class", 'j' },
|
653
|
|
- { "Verdana and Clones", 12, "Regular Class", 'l' },
|
654
|
|
- { "Verdana and Clones", 12, "Regular Class", 'm' },
|
655
|
|
- { "Verdana and Clones", 13, "Regular Class", 'i' },
|
656
|
|
- { "Verdana and Clones", 13, "Regular Class", 'j' },
|
657
|
|
- { "Verdana and Clones", 13, "Regular Class", 'l' },
|
658
|
|
- { "Verdana and Clones", 14, "Regular Class", 'm' },
|
659
|
|
- };
|
660
|
|
-
|
661
|
|
-
|
662
|
|
- /* Scaling slightly in the x-direction prior to hinting results in */
|
663
|
|
- /* more visually pleasing glyphs in certain cases. */
|
664
|
|
- /* This sometimes needs to be coordinated with compatible width rules. */
|
665
|
|
- /* A value of 1000 corresponds to a scaled value of 1.0. */
|
666
|
|
-
|
667
|
|
-#define X_SCALING_RULES_SIZE 50
|
668
|
|
-
|
669
|
|
- static const SPH_ScaleRule X_SCALING_Rules[X_SCALING_RULES_SIZE] =
|
670
|
|
- {
|
671
|
|
- { "DejaVu Sans", 12, "Regular Class", 'm', 950 },
|
672
|
|
- { "Verdana and Clones", 12, "Regular Class", 'a', 1100 },
|
673
|
|
- { "Verdana and Clones", 13, "Regular Class", 'a', 1050 },
|
674
|
|
- { "Arial", 11, "Regular Class", 'm', 975 },
|
675
|
|
- { "Arial", 12, "Regular Class", 'm', 1050 },
|
676
|
|
- /* Cyrillic small letter el */
|
677
|
|
- { "Arial", 13, "Regular Class", 0x43B, 950 },
|
678
|
|
- { "Arial", 13, "Regular Class", 'o', 950 },
|
679
|
|
- { "Arial", 13, "Regular Class", 'e', 950 },
|
680
|
|
- { "Arial", 14, "Regular Class", 'm', 950 },
|
681
|
|
- /* Cyrillic small letter el */
|
682
|
|
- { "Arial", 15, "Regular Class", 0x43B, 925 },
|
683
|
|
- { "Bitstream Vera Sans", 10, "Regular/Italic Class", 0, 1100 },
|
684
|
|
- { "Bitstream Vera Sans", 12, "Regular/Italic Class", 0, 1050 },
|
685
|
|
- { "Bitstream Vera Sans", 16, "Regular Class", 0, 1050 },
|
686
|
|
- { "Bitstream Vera Sans", 9, "Regular/Italic Class", 0, 1050 },
|
687
|
|
- { "DejaVu Sans", 12, "Regular Class", 'l', 975 },
|
688
|
|
- { "DejaVu Sans", 12, "Regular Class", 'i', 975 },
|
689
|
|
- { "DejaVu Sans", 12, "Regular Class", 'j', 975 },
|
690
|
|
- { "DejaVu Sans", 13, "Regular Class", 'l', 950 },
|
691
|
|
- { "DejaVu Sans", 13, "Regular Class", 'i', 950 },
|
692
|
|
- { "DejaVu Sans", 13, "Regular Class", 'j', 950 },
|
693
|
|
- { "DejaVu Sans", 10, "Regular/Italic Class", 0, 1100 },
|
694
|
|
- { "DejaVu Sans", 12, "Regular/Italic Class", 0, 1050 },
|
695
|
|
- { "Georgia", 10, "", 0, 1050 },
|
696
|
|
- { "Georgia", 11, "", 0, 1100 },
|
697
|
|
- { "Georgia", 12, "", 0, 1025 },
|
698
|
|
- { "Georgia", 13, "", 0, 1050 },
|
699
|
|
- { "Georgia", 16, "", 0, 1050 },
|
700
|
|
- { "Georgia", 17, "", 0, 1030 },
|
701
|
|
- { "Liberation Sans", 12, "Regular Class", 'm', 1100 },
|
702
|
|
- { "Lucida Grande", 11, "Regular Class", 'm', 1100 },
|
703
|
|
- { "Microsoft Sans Serif", 11, "Regular Class", 'm', 950 },
|
704
|
|
- { "Microsoft Sans Serif", 12, "Regular Class", 'm', 1050 },
|
705
|
|
- { "Segoe UI", 12, "Regular Class", 'H', 1050 },
|
706
|
|
- { "Segoe UI", 12, "Regular Class", 'm', 1050 },
|
707
|
|
- { "Segoe UI", 14, "Regular Class", 'm', 1050 },
|
708
|
|
- { "Tahoma", 11, "Regular Class", 'i', 975 },
|
709
|
|
- { "Tahoma", 11, "Regular Class", 'l', 975 },
|
710
|
|
- { "Tahoma", 11, "Regular Class", 'j', 900 },
|
711
|
|
- { "Tahoma", 11, "Regular Class", 'm', 918 },
|
712
|
|
- { "Verdana", 10, "Regular/Italic Class", 0, 1100 },
|
713
|
|
- { "Verdana", 12, "Regular Class", 'm', 975 },
|
714
|
|
- { "Verdana", 12, "Regular/Italic Class", 0, 1050 },
|
715
|
|
- { "Verdana", 13, "Regular/Italic Class", 'i', 950 },
|
716
|
|
- { "Verdana", 13, "Regular/Italic Class", 'j', 950 },
|
717
|
|
- { "Verdana", 13, "Regular/Italic Class", 'l', 950 },
|
718
|
|
- { "Verdana", 16, "Regular Class", 0, 1050 },
|
719
|
|
- { "Verdana", 9, "Regular/Italic Class", 0, 1050 },
|
720
|
|
- { "Times New Roman", 16, "Regular Class", 'm', 918 },
|
721
|
|
- { "Trebuchet MS", 11, "Regular Class", 'm', 800 },
|
722
|
|
- { "Trebuchet MS", 12, "Regular Class", 'm', 800 },
|
723
|
|
- };
|
724
|
|
-
|
725
|
|
-#else
|
726
|
|
-
|
727
|
|
-#define COMPATIBLE_WIDTHS_RULES_SIZE 1
|
728
|
|
-
|
729
|
|
- static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
|
730
|
|
- [COMPATIBLE_WIDTHS_RULES_SIZE] =
|
731
|
|
- {
|
732
|
|
- { "-", 0, "", 0 },
|
733
|
|
- };
|
734
|
|
-
|
735
|
|
-
|
736
|
|
-#define X_SCALING_RULES_SIZE 1
|
737
|
|
-
|
738
|
|
- static const SPH_ScaleRule X_SCALING_Rules
|
739
|
|
- [X_SCALING_RULES_SIZE] =
|
740
|
|
- {
|
741
|
|
- { "-", 0, "", 0, 1000 },
|
742
|
|
- };
|
743
|
|
-
|
744
|
|
-#endif /* FORCE_NATURAL_WIDTHS */
|
745
|
|
-
|
746
|
|
-
|
747
|
|
- static FT_Bool
|
748
|
|
- is_member_of_family_class( const FT_String* detected_font_name,
|
749
|
|
- const FT_String* rule_font_name )
|
750
|
|
- {
|
751
|
|
- FT_UInt i, j;
|
752
|
|
-
|
753
|
|
-
|
754
|
|
- /* Does font name match rule family? */
|
755
|
|
- if ( ft_strcmp( detected_font_name, rule_font_name ) == 0 )
|
756
|
|
- return TRUE;
|
757
|
|
-
|
758
|
|
- /* Is font name a wildcard ""? */
|
759
|
|
- if ( ft_strcmp( rule_font_name, "" ) == 0 )
|
760
|
|
- return TRUE;
|
761
|
|
-
|
762
|
|
- /* Is font name contained in a class list? */
|
763
|
|
- for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )
|
764
|
|
- {
|
765
|
|
- if ( ft_strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )
|
766
|
|
- {
|
767
|
|
- for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
|
768
|
|
- {
|
769
|
|
- if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j], "" ) == 0 )
|
770
|
|
- continue;
|
771
|
|
- if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j],
|
772
|
|
- detected_font_name ) == 0 )
|
773
|
|
- return TRUE;
|
774
|
|
- }
|
775
|
|
- }
|
776
|
|
- }
|
777
|
|
-
|
778
|
|
- return FALSE;
|
779
|
|
- }
|
780
|
|
-
|
781
|
|
-
|
782
|
|
- static FT_Bool
|
783
|
|
- is_member_of_style_class( const FT_String* detected_font_style,
|
784
|
|
- const FT_String* rule_font_style )
|
785
|
|
- {
|
786
|
|
- FT_UInt i, j;
|
787
|
|
-
|
788
|
|
-
|
789
|
|
- /* Does font style match rule style? */
|
790
|
|
- if ( ft_strcmp( detected_font_style, rule_font_style ) == 0 )
|
791
|
|
- return TRUE;
|
792
|
|
-
|
793
|
|
- /* Is font style a wildcard ""? */
|
794
|
|
- if ( ft_strcmp( rule_font_style, "" ) == 0 )
|
795
|
|
- return TRUE;
|
796
|
|
-
|
797
|
|
- /* Is font style contained in a class list? */
|
798
|
|
- for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )
|
799
|
|
- {
|
800
|
|
- if ( ft_strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
|
801
|
|
- {
|
802
|
|
- for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
|
803
|
|
- {
|
804
|
|
- if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j], "" ) == 0 )
|
805
|
|
- continue;
|
806
|
|
- if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j],
|
807
|
|
- detected_font_style ) == 0 )
|
808
|
|
- return TRUE;
|
809
|
|
- }
|
810
|
|
- }
|
811
|
|
- }
|
812
|
|
-
|
813
|
|
- return FALSE;
|
814
|
|
- }
|
815
|
|
-
|
816
|
|
-
|
817
|
|
- FT_LOCAL_DEF( FT_Bool )
|
818
|
|
- sph_test_tweak( TT_Face face,
|
819
|
|
- const FT_String* family,
|
820
|
|
- FT_UInt ppem,
|
821
|
|
- const FT_String* style,
|
822
|
|
- FT_UInt glyph_index,
|
823
|
|
- const SPH_TweakRule* rule,
|
824
|
|
- FT_UInt num_rules )
|
825
|
|
- {
|
826
|
|
- FT_UInt i;
|
827
|
|
-
|
828
|
|
-
|
829
|
|
- /* rule checks may be able to be optimized further */
|
830
|
|
- for ( i = 0; i < num_rules; i++ )
|
831
|
|
- {
|
832
|
|
- if ( family &&
|
833
|
|
- ( is_member_of_family_class ( family, rule[i].family ) ) )
|
834
|
|
- if ( rule[i].ppem == 0 ||
|
835
|
|
- rule[i].ppem == ppem )
|
836
|
|
- if ( style &&
|
837
|
|
- is_member_of_style_class ( style, rule[i].style ) )
|
838
|
|
- if ( rule[i].glyph == 0 ||
|
839
|
|
- FT_Get_Char_Index( (FT_Face)face,
|
840
|
|
- rule[i].glyph ) == glyph_index )
|
841
|
|
- return TRUE;
|
842
|
|
- }
|
843
|
|
-
|
844
|
|
- return FALSE;
|
845
|
|
- }
|
846
|
|
-
|
847
|
|
-
|
848
|
|
- static FT_UInt
|
849
|
|
- scale_test_tweak( TT_Face face,
|
850
|
|
- const FT_String* family,
|
851
|
|
- FT_UInt ppem,
|
852
|
|
- const FT_String* style,
|
853
|
|
- FT_UInt glyph_index,
|
854
|
|
- const SPH_ScaleRule* rule,
|
855
|
|
- FT_UInt num_rules )
|
856
|
|
- {
|
857
|
|
- FT_UInt i;
|
858
|
|
-
|
859
|
|
-
|
860
|
|
- /* rule checks may be able to be optimized further */
|
861
|
|
- for ( i = 0; i < num_rules; i++ )
|
862
|
|
- {
|
863
|
|
- if ( family &&
|
864
|
|
- ( is_member_of_family_class ( family, rule[i].family ) ) )
|
865
|
|
- if ( rule[i].ppem == 0 ||
|
866
|
|
- rule[i].ppem == ppem )
|
867
|
|
- if ( style &&
|
868
|
|
- is_member_of_style_class( style, rule[i].style ) )
|
869
|
|
- if ( rule[i].glyph == 0 ||
|
870
|
|
- FT_Get_Char_Index( (FT_Face)face,
|
871
|
|
- rule[i].glyph ) == glyph_index )
|
872
|
|
- return rule[i].scale;
|
873
|
|
- }
|
874
|
|
-
|
875
|
|
- return 1000;
|
876
|
|
- }
|
877
|
|
-
|
878
|
|
-
|
879
|
|
- FT_LOCAL_DEF( FT_UInt )
|
880
|
|
- sph_test_tweak_x_scaling( TT_Face face,
|
881
|
|
- const FT_String* family,
|
882
|
|
- FT_UInt ppem,
|
883
|
|
- const FT_String* style,
|
884
|
|
- FT_UInt glyph_index )
|
885
|
|
- {
|
886
|
|
- return scale_test_tweak( face, family, ppem, style, glyph_index,
|
887
|
|
- X_SCALING_Rules, X_SCALING_RULES_SIZE );
|
888
|
|
- }
|
889
|
|
-
|
890
|
|
-
|
891
|
|
-#define TWEAK_RULES( x ) \
|
892
|
|
- if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
|
893
|
|
- x##_Rules, x##_RULES_SIZE ) ) \
|
894
|
|
- loader->exec->sph_tweak_flags |= SPH_TWEAK_##x
|
895
|
|
-
|
896
|
|
-#define TWEAK_RULES_EXCEPTIONS( x ) \
|
897
|
|
- if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
|
898
|
|
- x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \
|
899
|
|
- loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x
|
900
|
|
-
|
901
|
|
-
|
902
|
|
- FT_LOCAL_DEF( void )
|
903
|
|
- sph_set_tweaks( TT_Loader loader,
|
904
|
|
- FT_UInt glyph_index )
|
905
|
|
- {
|
906
|
|
- TT_Face face = loader->face;
|
907
|
|
- FT_String* family = face->root.family_name;
|
908
|
|
- FT_UInt ppem = loader->size->metrics->x_ppem;
|
909
|
|
- FT_String* style = face->root.style_name;
|
910
|
|
-
|
911
|
|
-
|
912
|
|
- /* don't apply rules if style isn't set */
|
913
|
|
- if ( !face->root.style_name )
|
914
|
|
- return;
|
915
|
|
-
|
916
|
|
-#ifdef SPH_DEBUG_MORE_VERBOSE
|
917
|
|
- printf( "%s,%d,%s,%c=%d ",
|
918
|
|
- family, ppem, style, glyph_index, glyph_index );
|
919
|
|
-#endif
|
920
|
|
-
|
921
|
|
- TWEAK_RULES( PIXEL_HINTING );
|
922
|
|
-
|
923
|
|
- if ( loader->exec->sph_tweak_flags & SPH_TWEAK_PIXEL_HINTING )
|
924
|
|
- {
|
925
|
|
- loader->exec->ignore_x_mode = FALSE;
|
926
|
|
- return;
|
927
|
|
- }
|
928
|
|
-
|
929
|
|
- TWEAK_RULES( ALLOW_X_DMOVE );
|
930
|
|
- TWEAK_RULES( ALWAYS_DO_DELTAP );
|
931
|
|
- TWEAK_RULES( ALWAYS_SKIP_DELTAP );
|
932
|
|
- TWEAK_RULES( DEEMBOLDEN );
|
933
|
|
- TWEAK_RULES( DO_SHPIX );
|
934
|
|
- TWEAK_RULES( EMBOLDEN );
|
935
|
|
- TWEAK_RULES( MIAP_HACK );
|
936
|
|
- TWEAK_RULES( NORMAL_ROUND );
|
937
|
|
- TWEAK_RULES( NO_ALIGNRP_AFTER_IUP );
|
938
|
|
- TWEAK_RULES( NO_CALL_AFTER_IUP );
|
939
|
|
- TWEAK_RULES( NO_DELTAP_AFTER_IUP );
|
940
|
|
- TWEAK_RULES( RASTERIZER_35 );
|
941
|
|
- TWEAK_RULES( SKIP_IUP );
|
942
|
|
-
|
943
|
|
- TWEAK_RULES( SKIP_OFFPIXEL_Y_MOVES );
|
944
|
|
- TWEAK_RULES_EXCEPTIONS( SKIP_OFFPIXEL_Y_MOVES );
|
945
|
|
-
|
946
|
|
- TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES_DELTAP );
|
947
|
|
-
|
948
|
|
- TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES );
|
949
|
|
- TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES );
|
950
|
|
-
|
951
|
|
- TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );
|
952
|
|
- TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );
|
953
|
|
-
|
954
|
|
- if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
|
955
|
|
- {
|
956
|
|
- if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 )
|
957
|
|
- {
|
958
|
|
- loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
|
959
|
|
- loader->exec->size->cvt_ready = -1;
|
960
|
|
-
|
961
|
|
- tt_size_ready_bytecode(
|
962
|
|
- loader->exec->size,
|
963
|
|
- FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
|
964
|
|
- }
|
965
|
|
- else
|
966
|
|
- loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
|
967
|
|
- }
|
968
|
|
- else
|
969
|
|
- {
|
970
|
|
- if ( loader->exec->rasterizer_version !=
|
971
|
|
- SPH_OPTION_SET_RASTERIZER_VERSION )
|
972
|
|
- {
|
973
|
|
- loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
|
974
|
|
- loader->exec->size->cvt_ready = -1;
|
975
|
|
-
|
976
|
|
- tt_size_ready_bytecode(
|
977
|
|
- loader->exec->size,
|
978
|
|
- FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
|
979
|
|
- }
|
980
|
|
- else
|
981
|
|
- loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
|
982
|
|
- }
|
983
|
|
-
|
984
|
|
- if ( IS_HINTED( loader->load_flags ) )
|
985
|
|
- {
|
986
|
|
- TWEAK_RULES( TIMES_NEW_ROMAN_HACK );
|
987
|
|
- TWEAK_RULES( COURIER_NEW_2_HACK );
|
988
|
|
- }
|
989
|
|
-
|
990
|
|
- if ( sph_test_tweak( face, family, ppem, style, glyph_index,
|
991
|
|
- COMPATIBILITY_MODE_Rules, COMPATIBILITY_MODE_RULES_SIZE ) )
|
992
|
|
- loader->exec->face->sph_compatibility_mode = TRUE;
|
993
|
|
-
|
994
|
|
-
|
995
|
|
- if ( IS_HINTED( loader->load_flags ) )
|
996
|
|
- {
|
997
|
|
- if ( sph_test_tweak( face, family, ppem, style, glyph_index,
|
998
|
|
- COMPATIBLE_WIDTHS_Rules, COMPATIBLE_WIDTHS_RULES_SIZE ) )
|
999
|
|
- loader->exec->compatible_widths |= TRUE;
|
1000
|
|
- }
|
1001
|
|
- }
|
1002
|
|
-
|
1003
|
|
-#else /* !(TT_USE_BYTECODE_INTERPRETER && */
|
1004
|
|
- /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
|
1005
|
|
-
|
1006
|
|
- /* ANSI C doesn't like empty source files */
|
1007
|
|
- typedef int tt_subpix_dummy_;
|
1008
|
|
-
|
1009
|
|
-#endif /* !(TT_USE_BYTECODE_INTERPRETER && */
|
1010
|
|
- /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
|
1011
|
|
-
|
1012
|
|
-
|
1013
|
|
-/* END */ |
src/truetype/ttsubpix.h
deleted
1
|
|
-/****************************************************************************
|
2
|
|
- *
|
3
|
|
- * ttsubpix.h
|
4
|
|
- *
|
5
|
|
- * TrueType Subpixel Hinting.
|
6
|
|
- *
|
7
|
|
- * Copyright (C) 2010-2023 by
|
8
|
|
- * David Turner, Robert Wilhelm, and Werner Lemberg.
|
9
|
|
- *
|
10
|
|
- * This file is part of the FreeType project, and may only be used,
|
11
|
|
- * modified, and distributed under the terms of the FreeType project
|
12
|
|
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
|
13
|
|
- * this file you indicate that you have read the license and
|
14
|
|
- * understand and accept it fully.
|
15
|
|
- *
|
16
|
|
- */
|
17
|
|
-
|
18
|
|
-
|
19
|
|
-#ifndef TTSUBPIX_H_
|
20
|
|
-#define TTSUBPIX_H_
|
21
|
|
-
|
22
|
|
-#include "ttobjs.h"
|
23
|
|
-#include "ttinterp.h"
|
24
|
|
-
|
25
|
|
-
|
26
|
|
-FT_BEGIN_HEADER
|
27
|
|
-
|
28
|
|
-
|
29
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
30
|
|
-
|
31
|
|
- /**************************************************************************
|
32
|
|
- *
|
33
|
|
- * ID flags to identify special functions at FDEF and runtime.
|
34
|
|
- *
|
35
|
|
- */
|
36
|
|
-#define SPH_FDEF_INLINE_DELTA_1 0x0000001
|
37
|
|
-#define SPH_FDEF_INLINE_DELTA_2 0x0000002
|
38
|
|
-#define SPH_FDEF_DIAGONAL_STROKE 0x0000004
|
39
|
|
-#define SPH_FDEF_VACUFORM_ROUND_1 0x0000008
|
40
|
|
-#define SPH_FDEF_TTFAUTOHINT_1 0x0000010
|
41
|
|
-#define SPH_FDEF_SPACING_1 0x0000020
|
42
|
|
-#define SPH_FDEF_SPACING_2 0x0000040
|
43
|
|
-#define SPH_FDEF_TYPEMAN_STROKES 0x0000080
|
44
|
|
-#define SPH_FDEF_TYPEMAN_DIAGENDCTRL 0x0000100
|
45
|
|
-
|
46
|
|
-
|
47
|
|
- /**************************************************************************
|
48
|
|
- *
|
49
|
|
- * Tweak flags that are set for each glyph by the below rules.
|
50
|
|
- *
|
51
|
|
- */
|
52
|
|
-#define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001UL
|
53
|
|
-#define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000002UL
|
54
|
|
-#define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000004UL
|
55
|
|
-#define SPH_TWEAK_COURIER_NEW_2_HACK 0x0000008UL
|
56
|
|
-#define SPH_TWEAK_DEEMBOLDEN 0x0000010UL
|
57
|
|
-#define SPH_TWEAK_DO_SHPIX 0x0000020UL
|
58
|
|
-#define SPH_TWEAK_EMBOLDEN 0x0000040UL
|
59
|
|
-#define SPH_TWEAK_MIAP_HACK 0x0000080UL
|
60
|
|
-#define SPH_TWEAK_NORMAL_ROUND 0x0000100UL
|
61
|
|
-#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP 0x0000200UL
|
62
|
|
-#define SPH_TWEAK_NO_CALL_AFTER_IUP 0x0000400UL
|
63
|
|
-#define SPH_TWEAK_NO_DELTAP_AFTER_IUP 0x0000800UL
|
64
|
|
-#define SPH_TWEAK_PIXEL_HINTING 0x0001000UL
|
65
|
|
-#define SPH_TWEAK_RASTERIZER_35 0x0002000UL
|
66
|
|
-#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES 0x0004000UL
|
67
|
|
-#define SPH_TWEAK_SKIP_IUP 0x0008000UL
|
68
|
|
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES 0x0010000UL
|
69
|
|
-#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES 0x0020000UL
|
70
|
|
-#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK 0x0040000UL
|
71
|
|
-#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP 0x0080000UL
|
72
|
|
-
|
73
|
|
-
|
74
|
|
- FT_LOCAL( FT_Bool )
|
75
|
|
- sph_test_tweak( TT_Face face,
|
76
|
|
- const FT_String* family,
|
77
|
|
- FT_UInt ppem,
|
78
|
|
- const FT_String* style,
|
79
|
|
- FT_UInt glyph_index,
|
80
|
|
- const SPH_TweakRule* rule,
|
81
|
|
- FT_UInt num_rules );
|
82
|
|
-
|
83
|
|
- FT_LOCAL( FT_UInt )
|
84
|
|
- sph_test_tweak_x_scaling( TT_Face face,
|
85
|
|
- const FT_String* family,
|
86
|
|
- FT_UInt ppem,
|
87
|
|
- const FT_String* style,
|
88
|
|
- FT_UInt glyph_index );
|
89
|
|
-
|
90
|
|
- FT_LOCAL( void )
|
91
|
|
- sph_set_tweaks( TT_Loader loader,
|
92
|
|
- FT_UInt glyph_index );
|
93
|
|
-
|
94
|
|
-
|
95
|
|
- /* These macros are defined absent a method for setting them */
|
96
|
|
-#define SPH_OPTION_BITMAP_WIDTHS FALSE
|
97
|
|
-#define SPH_OPTION_SET_SUBPIXEL TRUE
|
98
|
|
-#define SPH_OPTION_SET_GRAYSCALE FALSE
|
99
|
|
-#define SPH_OPTION_SET_COMPATIBLE_WIDTHS FALSE
|
100
|
|
-#define SPH_OPTION_SET_RASTERIZER_VERSION 38
|
101
|
|
-
|
102
|
|
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
103
|
|
-
|
104
|
|
-
|
105
|
|
-FT_END_HEADER
|
106
|
|
-
|
107
|
|
-#endif /* TTSUBPIX_H_ */
|
108
|
|
-
|
109
|
|
-
|
110
|
|
-/* END */ |
|