From: Owen Taylor Date: Tue, 23 Sep 2003 20:12:20 +0000 (+0000) Subject: Add a FC_HINT_STYLE key for patterns, with possible values X-Git-Tag: fc-2_2_91~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f077d662c001468eb2aa1261549accd9ff3de401;p=fontconfig.git Add a FC_HINT_STYLE key for patterns, with possible values HINT_NONE/HINT_SLIGHT/HINT_MEDIUM/HINT_FULL. (Bug #117) --- diff --git a/ChangeLog b/ChangeLog index 2adb4c3..cc86d87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-09-23 Owen Taylor + + * fontconfig/fontconfig.h src/fcdefault.c (FcDefaultSubstitute) + src/fcname.c: Add a FC_HINT_STYLE key for patterns, with + possible values HINT_NONE/HINT_SLIGHT/HINT_MEDIUM/HINT_FULL. + (Bug #117) + 2003-09-23 Owen Taylor * fc-lang/ka.orth: Remove Georgian capitals, they diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index cb5f95f..3e0237d 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -70,6 +70,7 @@ typedef int FcBool; #define FC_FOUNDRY "foundry" /* String */ #define FC_ANTIALIAS "antialias" /* Bool (depends) */ #define FC_HINTING "hinting" /* Bool (true) */ +#define FC_HINT_STYLE "hintstyle" /* Int */ #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ #define FC_AUTOHINT "autohint" /* Bool (false) */ #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ @@ -140,6 +141,12 @@ typedef int FcBool; #define FC_RGBA_VBGR 4 #define FC_RGBA_NONE 5 +/* hinting style */ +#define FC_HINT_NONE 0 +#define FC_HINT_SLIGHT 1 +#define FC_HINT_MEDIUM 2 +#define FC_HINT_FULL 3 + typedef enum _FcType { FcTypeVoid, FcTypeInteger, diff --git a/src/fcdefault.c b/src/fcdefault.c index b070ea8..39cf27d 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -144,4 +144,9 @@ FcDefaultSubstitute (FcPattern *pattern) { FcPatternAddInteger (pattern, FC_FONTVERSION, 0x7fffffff); } + + if (FcPatternGet (pattern, FC_HINT_STYLE, 0, &v) == FcResultNoMatch) + { + FcPatternAddInteger (pattern, FC_HINT_STYLE, FC_HINT_FULL); + } } diff --git a/src/fcname.c b/src/fcname.c index b15b8fb..c1df41b 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -41,6 +41,7 @@ static const FcObjectType _FcBaseObjectTypes[] = { { FC_FOUNDRY, FcTypeString, }, /* { FC_CORE, FcTypeBool, }, */ { FC_ANTIALIAS, FcTypeBool, }, + { FC_HINT_STYLE, FcTypeInteger, }, { FC_HINTING, FcTypeBool, }, { FC_VERTICAL_LAYOUT, FcTypeBool, }, { FC_AUTOHINT, FcTypeBool, }, @@ -177,6 +178,11 @@ static const FcConstant _FcBaseConstants[] = { { (FcChar8 *) "vrgb", "rgba", FC_RGBA_VRGB }, { (FcChar8 *) "vbgr", "rgba", FC_RGBA_VBGR }, { (FcChar8 *) "none", "rgba", FC_RGBA_NONE }, + + { (FcChar8 *) "hintnone", "hintstyle", FC_HINT_NONE }, + { (FcChar8 *) "hintslight", "hintstyle", FC_HINT_SLIGHT }, + { (FcChar8 *) "hintmedium", "hintstyle", FC_HINT_MEDIUM }, + { (FcChar8 *) "hintfull", "hintstyle", FC_HINT_FULL }, }; #define NUM_FC_CONSTANTS (sizeof _FcBaseConstants/sizeof _FcBaseConstants[0])