Fontconfig options for freetype sub-pixel filter configuration

David Turner has modified FreeType to be able to render sub-pixel decimated
glyphs using different methods of filtering. Fontconfig needs new
configurables to support selecting these new filtering options. A patch
follows that would correspond to one available for Cairo in bug 10301.
This commit is contained in:
Sylvain Pasche 2008-05-03 19:33:45 -07:00 committed by Keith Packard
parent c26344ecfc
commit 53aec11107
5 changed files with 22 additions and 3 deletions

View File

@ -177,6 +177,7 @@ convenience for the applications rendering mechanism.
dpi FC_DPI Double Target dots per inch
rgba FC_RGBA Int unknown, rgb, bgr, vrgb,
vbgr, none - subpixel geometry
lcdfilter FC_LCD_FILTER Int Type of LCD filter
minspace FC_MINSPACE Bool Eliminate leading from line
spacing
charset FC_CHARSET CharSet Unicode chars encoded by

View File

@ -120,6 +120,7 @@ convenience for the applications' rendering mechanism.
dpi Double Target dots per inch
rgba Int unknown, rgb, bgr, vrgb, vbgr,
none - subpixel geometry
lcdfilter Int Type of LCD filter
minspace Bool Eliminate leading from line spacing
charset CharSet Unicode chars encoded by the font
lang String List of RFC-3066-style languages this
@ -476,6 +477,10 @@ symbolic names for common font values:
vrgb rgba 3
vbgr rgba 4
none rgba 5
lcdnone lcdfilter 0
lcddefault lcdfilter 1
lcdlight lcdfilter 2
lcdlegacy lcdfilter 3
hintnone hintstyle 0
hintslight hintstyle 1
hintmedium hintstyle 2

View File

@ -111,6 +111,7 @@ typedef int FcBool;
#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
#define FC_LCD_FILTER "lcdfilter" /* Int */
#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION
#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
@ -171,7 +172,13 @@ typedef int FcBool;
#define FC_HINT_SLIGHT 1
#define FC_HINT_MEDIUM 2
#define FC_HINT_FULL 3
/* LCD filter */
#define FC_LCD_NONE 0
#define FC_LCD_DEFAULT 1
#define FC_LCD_LIGHT 2
#define FC_LCD_LEGACY 3
typedef enum _FcType {
FcTypeVoid,
FcTypeInteger,

View File

@ -848,7 +848,8 @@ FcListPatternMatchAny (const FcPattern *p,
#define FC_EMBOLDEN_OBJECT 38
#define FC_EMBEDDED_BITMAP_OBJECT 39
#define FC_DECORATIVE_OBJECT 40
#define FC_MAX_BASE_OBJECT FC_DECORATIVE_OBJECT
#define FC_LCD_FILTER_OBJECT 41
#define FC_MAX_BASE_OBJECT FC_LCD_FILTER_OBJECT
FcPrivate FcBool
FcNameBool (const FcChar8 *v, FcBool *result);

View File

@ -74,7 +74,8 @@ static const FcObjectType _FcBaseObjectTypes[] = {
{ FC_FONTFORMAT, FcTypeString },
{ FC_EMBOLDEN, FcTypeBool },
{ FC_EMBEDDED_BITMAP, FcTypeBool },
{ FC_DECORATIVE, FcTypeBool }, /* 40 */
{ FC_DECORATIVE, FcTypeBool },
{ FC_LCD_FILTER, FcTypeInteger }, /* 41 */
};
#define NUM_OBJECT_TYPES (sizeof _FcBaseObjectTypes / sizeof _FcBaseObjectTypes[0])
@ -435,6 +436,10 @@ static const FcConstant _FcBaseConstants[] = {
{ (FcChar8 *) "embolden", "embolden", FcTrue },
{ (FcChar8 *) "embeddedbitmap", "embeddedbitmap", FcTrue },
{ (FcChar8 *) "decorative", "decorative", FcTrue },
{ (FcChar8 *) "lcdnone", "lcdfilter", FC_LCD_NONE },
{ (FcChar8 *) "lcddefault", "lcdfilter", FC_LCD_DEFAULT },
{ (FcChar8 *) "lcdlight", "lcdfilter", FC_LCD_LIGHT },
{ (FcChar8 *) "lcdlegacy", "lcdfilter", FC_LCD_LEGACY },
};
#define NUM_FC_CONSTANTS (sizeof _FcBaseConstants/sizeof _FcBaseConstants[0])