|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
/* */ |
|
|
|
|
/* TrueType Subpixel Hinting. */ |
|
|
|
|
/* */ |
|
|
|
|
/* Copyright 2010-2012 by */ |
|
|
|
|
/* Copyright 2010-2013 by */ |
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
|
|
|
|
/* */ |
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */ |
|
|
|
@ -28,6 +28,36 @@ |
|
|
|
|
|
|
|
|
|
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING |
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* These rules affect how the TT Interpreter does hinting, with the */ |
|
|
|
|
/* goal of doing subpixel hinting by (in general) ignoring x moves. */ |
|
|
|
|
/* Some of these rules are fixes that go above and beyond the */ |
|
|
|
|
/* stated techniques in the MS whitepaper on Cleartype, due to */ |
|
|
|
|
/* artifacts in many glyphs. So, these rules make some glyphs render */ |
|
|
|
|
/* better than they do in the MS rasterizer. */ |
|
|
|
|
/* */ |
|
|
|
|
/* "" string or 0 int/char indicates to apply to all glyphs. */ |
|
|
|
|
/* "-" used as dummy placeholders, but any non-matching string works. */ |
|
|
|
|
/* */ |
|
|
|
|
/* Some of this could arguably be implemented in fontconfig, however: */ |
|
|
|
|
/* */ |
|
|
|
|
/* - Fontconfig can't set things on a glyph-by-glyph basis. */ |
|
|
|
|
/* - The tweaks that happen here are very low-level, from an average */ |
|
|
|
|
/* user's point of view and are best implemented in the hinter. */ |
|
|
|
|
/* */ |
|
|
|
|
/* The goal is to make the subpixel hinting techniques as generalized */ |
|
|
|
|
/* as possible across all fonts to prevent the need for extra rules such */ |
|
|
|
|
/* as these. */ |
|
|
|
|
/* */ |
|
|
|
|
/* The rule structure is designed so that entirely new rules can easily */ |
|
|
|
|
/* be added when a new compatibility feature is discovered. */ |
|
|
|
|
/* */ |
|
|
|
|
/* The rule structures could also use some enhancement to handle ranges. */ |
|
|
|
|
/* */ |
|
|
|
|
/* ****************** WORK IN PROGRESS ******************* */ |
|
|
|
|
/* */ |
|
|
|
|
|
|
|
|
|
/* These are `classes' of fonts that can be grouped together and used in */ |
|
|
|
|
/* rules below. A blank entry "" is required at the end of these! */ |
|
|
|
|
#define FAMILY_CLASS_RULES_SIZE 7 |
|
|
|
@ -181,13 +211,13 @@ |
|
|
|
|
"Verdana", "", }, }, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Define this to force natural (i.e. not bitmap-compatible) widths. */ |
|
|
|
|
/* The default leans strongly towards natural widths except for a few */ |
|
|
|
|
/* legacy fonts where a selective combination produces nicer results. */ |
|
|
|
|
/* #define FORCE_NATURAL_WIDTHS */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Define `classes' of styles that can be grouped together and used in */ |
|
|
|
|
/* rules below. A blank entry "" is required at the end of these! */ |
|
|
|
|
#define STYLE_CLASS_RULES_SIZE 5 |
|
|
|
@ -803,8 +833,10 @@ |
|
|
|
|
|
|
|
|
|
#endif /* FORCE_NATURAL_WIDTHS */ |
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( const SPH_ScaleRule* const ) |
|
|
|
|
sph_X_SCALING_Rules = X_SCALING_Rules; |
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( const SPH_ScaleRule* const ) sph_X_SCALING_Rules |
|
|
|
|
= X_SCALING_Rules; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FT_LOCAL_DEF( FT_Bool ) |
|
|
|
|
is_member_of_family_class( const FT_String* detected_font_name, |
|
|
|
|