@ -287,25 +287,14 @@
/* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */
# define PIXEL_HINTING_RULES_SIZE 1
# define PIXEL_HINTING_RULES_SIZE 2
const SPH_TweakRule PIXEL_HINTING_Rules
[ PIXEL_HINTING_RULES_SIZE ] =
{
/* these characters are almost always safe */
{ " - " , 0 , " " , 0 } ,
} ;
/* According to Greg Hitchcock and the MS whitepaper, this should work */
/* on all legacy MS fonts, but creates artifacts with some. Only using */
/* where absolutely necessary. */
# define SKIP_INLINE_DELTAS_RULES_SIZE 1
const SPH_TweakRule SKIP_INLINE_DELTAS_Rules
[ SKIP_INLINE_DELTAS_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
{ " Courier New " , 12 , " Italic " , ' z ' } ,
{ " Courier New " , 11 , " Italic " , ' z ' } ,
} ;
@ -321,42 +310,41 @@
/* Skip Y moves that start with a point that is not on a Y pixel */
/* boundary and don't move that point to a Y pixel boundary. */
# define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 9
# define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 5
const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
[ SKIP_NONPIXEL_Y_MOVES_RULES_SIZE ] =
{
/* fix vwxyz thinness*/
{ " Consolas " , 0 , " Regular " , 0 } ,
/* fix tiny gap at top of m */
{ " Arial " , 0 , " Regular " , ' m ' } ,
{ " Consolas " , 0 , " " , 0 } , { " - " , 0 , " N " , 0 } ,
/* Fix thin middle stems */
{ " Core MS Legacy Fonts " , 0 , " Regular/Bold Class " , ' N ' } ,
{ " Lucida Grande " , 0 , " " , ' N ' } ,
{ " Lucida Grande " , 0 , " Bold " , ' y ' } ,
{ " -Core MS Legacy Fonts " , 0 , " Regular/Bold Class " , 0 } ,
/* Cyrillic small letter I */
{ " Legacy Sans Fonts " , 0 , " " , 0x438 } ,
{ " Verdana Clones " , 0 , " " , ' N ' } ,
/* Fix misshapen x */
{ " Verdana " , 0 , " Bold " , ' x ' } ,
/* Fix misshapen s */
{ " Tahoma " , 0 , " " , ' s ' } ,
{ " Legacy Sans Fonts " , 0 , " " , 0 } ,
/* Fix artifacts with some Regular & Bold */
{ " Verdana Clones " , 0 , " " , 0 } ,
} ;
# define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 7
# define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
[ SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE ] =
{
{ " Tahoma " , 0 , " " , ' N ' } ,
{ " Comic Sans MS " , 0 , " " , ' N ' } ,
{ " Verdana " , 0 , " Regular/Bold Class " , ' N ' } ,
{ " Verdana " , 11 , " Bold " , ' x ' } ,
/* Cyrillic small letter I */
{ " Arial " , 0 , " " , 0x438 } ,
{ " Arial " , 11 , " Bold " , ' N ' } ,
{ " Trebuchet MS " , 0 , " Bold " , 0 } ,
{ " - " , 0 , " " , 0 } ,
} ;
/* Skip Y moves that start with a point that is not on a Y pixel */
/* boundary and don't move that point to a Y pixel boundary. */
# define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2
const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
[ SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE ] =
{
/* Maintain thickness of diagonal in 'N' */
{ " Times New Roman " , 0 , " Regular/Bold Class " , ' N ' } ,
{ " Georgia " , 0 , " Regular/Bold Class " , ' N ' } ,
} ;
@ -400,16 +388,6 @@
} ;
/* Allow a Direct_Move_X along X freedom vector if matched. */
# define ALLOW_X_DMOVEX_RULES_SIZE 1
const SPH_TweakRule ALLOW_X_DMOVEX_Rules
[ ALLOW_X_DMOVEX_RULES_SIZE ] =
{
{ " - " , 0 , " Regular " , 0 } ,
} ;
/* Allow a Direct_Move along X freedom vector if matched. */
# define ALLOW_X_DMOVE_RULES_SIZE 1
@ -421,17 +399,6 @@
} ;
/* Allow a ZP2 move along freedom vector if matched; */
/* This is called from SHP, SHPIX, SHC, SHZ. */
# define ALLOW_X_MOVE_ZP2_RULES_SIZE 1
const SPH_TweakRule ALLOW_X_MOVE_ZP2_Rules
[ ALLOW_X_MOVE_ZP2_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
} ;
/* Return MS rasterizer version 35 if matched. */
# define RASTERIZER_35_RULES_SIZE 8
@ -456,7 +423,8 @@
const SPH_TweakRule NORMAL_ROUND_Rules
[ NORMAL_ROUND_RULES_SIZE ] =
{
/* Fix serif thickness */
/* Fix serif thickness for certain ppems */
/* Can probably be generalized somehow */
{ " Courier New " , 0 , " " , 0 } ,
} ;
@ -482,7 +450,7 @@
/* Skip DELTAP instructions if matched. */
# define ALWAYS_SKIP_DELTAP_RULES_SIZE 15
# define ALWAYS_SKIP_DELTAP_RULES_SIZE 18
const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
[ ALWAYS_SKIP_DELTAP_RULES_SIZE ] =
@ -492,7 +460,11 @@
{ " Trebuchet MS " , 14 , " Regular " , ' e ' } ,
{ " Trebuchet MS " , 13 , " Regular " , ' e ' } ,
{ " Trebuchet MS " , 15 , " Regular " , ' e ' } ,
{ " Trebuchet MS " , 0 , " Italic " , ' v ' } ,
{ " Trebuchet MS " , 0 , " Italic " , ' w ' } ,
{ " Trebuchet MS " , 0 , " Regular " , ' Y ' } ,
{ " Arial " , 11 , " Regular " , ' s ' } ,
/* prevent problems with '3' and others */
{ " Verdana " , 10 , " Regular " , 0 } ,
{ " Verdana " , 9 , " Regular " , 0 } ,
/* Cyrillic small letter short I */
@ -509,57 +481,23 @@
/* Always do DELTAP instructions if matched. */
# define ALWAYS_DO_DELTAP_RULES_SIZE 2
# define ALWAYS_DO_DELTAP_RULES_SIZE 1
const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
[ ALWAYS_DO_DELTAP_RULES_SIZE ] =
{
{ " Verdana Clones " , 17 , " Regular Class " , ' K ' } ,
{ " Verdana Clones " , 17 , " Regular Class " , ' k ' } ,
} ;
/* Do an extra RTG instruction in DELTAP if matched. */
# define DELTAP_RTG_RULES_SIZE 1
static const SPH_TweakRule DELTAP_RTG_Rules
[ DELTAP_RTG_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
} ;
/* Force CVT distance to zero in MIRP. */
# define MIRP_CVT_ZERO_RULES_SIZE 1
static const SPH_TweakRule MIRP_CVT_ZERO_Rules
[ MIRP_CVT_ZERO_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
} ;
/* Skip moves that meet or exceed 1 pixel. */
# define DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE 1
static const SPH_TweakRule DELTAP_SKIP_EXAGGERATED_VALUES_Rules
[ DELTAP_SKIP_EXAGGERATED_VALUES_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
} ;
/* Don't allow ALIGNRP after IUP. */
# define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 4
# define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 1
static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules
[ NO_ALIGNRP_AFTER_IUP_RULES_SIZE ] =
{
/* Prevent creation of dents in outline */
{ " Courier New " , 0 , " Bold " , ' C ' } ,
{ " Courier New " , 0 , " Bold " , ' D ' } ,
{ " Courier New " , 0 , " Bold " , ' Q ' } ,
{ " Courier New " , 0 , " Bold " , ' 0 ' } ,
{ " - " , 0 , " " , 0 } ,
} ;
@ -574,16 +512,13 @@
/* Don't allow CALL after IUP. */
# define NO_CALL_AFTER_IUP_RULES_SIZE 4
# define NO_CALL_AFTER_IUP_RULES_SIZE 1
static const SPH_TweakRule NO_CALL_AFTER_IUP_Rules
[ NO_CALL_AFTER_IUP_RULES_SIZE ] =
{
/* Prevent creation of dents in outline */
{ " Courier New " , 0 , " Bold " , ' O ' } ,
{ " Courier New " , 0 , " Bold " , ' Q ' } ,
{ " Courier New " , 0 , " Bold " , ' k ' } ,
{ " Courier New " , 0 , " Bold Italic " , ' M ' } ,
{ " - " , 0 , " " , 0 } ,
} ;
@ -606,29 +541,16 @@
/* Embolden these glyphs slightly. */
# define EMBOLDEN_RULES_SIZE 5
# define EMBOLDEN_RULES_SIZE 2
static const SPH_TweakRule EMBOLDEN_Rules
[ EMBOLDEN_RULES_SIZE ] =
{
{ " Courier New " , 12 , " Italic " , ' z ' } ,
{ " Courier New " , 11 , " Italic " , ' z ' } ,
{ " Courier New " , 10 , " Italic " , ' z ' } ,
{ " Courier New " , 0 , " Regular " , 0 } ,
{ " Courier New " , 0 , " Italic " , 0 } ,
} ;
/* Do an extra RDTG instruction in DELTAP if matched. */
# define DELTAP_RDTG_RULES_SIZE 1
static const SPH_TweakRule DELTAP_RDTG_Rules
[ DELTAP_RDTG_RULES_SIZE ] =
{
{ " - " , 0 , " " , 0 } ,
} ;
/* This is a CVT hack that makes thick horizontal stems on 2, 5, 7 */
/* similar to Windows XP. */
# define TIMES_NEW_ROMAN_HACK_RULES_SIZE 12
@ -999,12 +921,9 @@
}
TWEAK_RULES ( ALLOW_X_DMOVE ) ;
TWEAK_RULES ( ALLOW_X_DMOVEX ) ;
TWEAK_RULES ( ALLOW_X_MOVE_ZP2 ) ;
TWEAK_RULES ( ALWAYS_DO_DELTAP ) ;
TWEAK_RULES ( ALWAYS_SKIP_DELTAP ) ;
TWEAK_RULES ( DEEMBOLDEN ) ;
TWEAK_RULES ( DELTAP_SKIP_EXAGGERATED_VALUES ) ;
TWEAK_RULES ( DO_SHPIX ) ;
TWEAK_RULES ( EMBOLDEN ) ;
TWEAK_RULES ( MIAP_HACK ) ;
@ -1013,13 +932,13 @@
TWEAK_RULES ( NO_CALL_AFTER_IUP ) ;
TWEAK_RULES ( NO_DELTAP_AFTER_IUP ) ;
TWEAK_RULES ( RASTERIZER_35 ) ;
TWEAK_RULES ( SKIP_INLINE_DELTAS ) ;
TWEAK_RULES ( SKIP_IUP ) ;
TWEAK_RULES ( MIRP_CVT_ZERO ) ;
TWEAK_RULES ( SKIP_OFFPIXEL_Y_MOVES ) ;
TWEAK_RULES_EXCEPTIONS ( SKIP_OFFPIXEL_Y_MOVES ) ;
TWEAK_RULES ( SKIP_NONPIXEL_Y_MOVES_DELTAP ) ;
TWEAK_RULES ( SKIP_NONPIXEL_Y_MOVES ) ;
TWEAK_RULES_EXCEPTIONS ( SKIP_NONPIXEL_Y_MOVES ) ;