From: Sylvain Pasche Date: Sun, 4 May 2008 02:33:45 +0000 (-0700) Subject: Fontconfig options for freetype sub-pixel filter configuration X-Git-Tag: 2.5.92~11 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=53aec111074cf7b46d15eb84a55791d3c95bc15e;p=fontconfig.git 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. --- diff --git a/doc/fontconfig-devel.sgml b/doc/fontconfig-devel.sgml index 8231b3f..6ca8e60 100644 --- a/doc/fontconfig-devel.sgml +++ b/doc/fontconfig-devel.sgml @@ -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 diff --git a/doc/fontconfig-user.sgml b/doc/fontconfig-user.sgml index 1007782..22fadbb 100644 --- a/doc/fontconfig-user.sgml +++ b/doc/fontconfig-user.sgml @@ -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 diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index 36e4ccc..8280a3a 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -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, diff --git a/src/fcint.h b/src/fcint.h index ddeb745..8912d16 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -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); diff --git a/src/fcname.c b/src/fcname.c index 21e6da1..7a5371b 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -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])