Add FC_WEIGHT_DEMILIGHT

Part of https://bugs.freedesktop.org/show_bug.cgi?id=81453
Also hooks up FC_WEIGHT_BOOK to fcfreetype.c.
This commit is contained in:
Behdad Esfahbod 2014-07-25 16:24:26 -04:00
parent 9839d0112c
commit be6506ca04
4 changed files with 13 additions and 1 deletions

View File

@ -473,6 +473,8 @@ symbolic names for common font values:
extralight weight 40 extralight weight 40
ultralight weight 40 ultralight weight 40
light weight 50 light weight 50
demilight weight 65
semilight weight 65
book weight 75 book weight 75
regular weight 80 regular weight 80
normal weight 80 normal weight 80

View File

@ -131,6 +131,8 @@ typedef int FcBool;
#define FC_WEIGHT_EXTRALIGHT 40 #define FC_WEIGHT_EXTRALIGHT 40
#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
#define FC_WEIGHT_LIGHT 50 #define FC_WEIGHT_LIGHT 50
#define FC_WEIGHT_DEMILIGHT 65
#define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
#define FC_WEIGHT_BOOK 75 #define FC_WEIGHT_BOOK 75
#define FC_WEIGHT_REGULAR 80 #define FC_WEIGHT_REGULAR 80
#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR

View File

@ -1095,6 +1095,8 @@ static const FcStringConst weightConsts[] = {
{ (FC8) "thin", FC_WEIGHT_THIN }, { (FC8) "thin", FC_WEIGHT_THIN },
{ (FC8) "extralight", FC_WEIGHT_EXTRALIGHT }, { (FC8) "extralight", FC_WEIGHT_EXTRALIGHT },
{ (FC8) "ultralight", FC_WEIGHT_ULTRALIGHT }, { (FC8) "ultralight", FC_WEIGHT_ULTRALIGHT },
{ (FC8) "demilight", FC_WEIGHT_DEMILIGHT },
{ (FC8) "semilight", FC_WEIGHT_SEMILIGHT },
{ (FC8) "light", FC_WEIGHT_LIGHT }, { (FC8) "light", FC_WEIGHT_LIGHT },
{ (FC8) "book", FC_WEIGHT_BOOK }, { (FC8) "book", FC_WEIGHT_BOOK },
{ (FC8) "regular", FC_WEIGHT_REGULAR }, { (FC8) "regular", FC_WEIGHT_REGULAR },
@ -1632,8 +1634,12 @@ FcFreeTypeQueryFace (const FT_Face face,
weight = FC_WEIGHT_THIN; weight = FC_WEIGHT_THIN;
else if (os2->usWeightClass < 250) else if (os2->usWeightClass < 250)
weight = FC_WEIGHT_EXTRALIGHT; weight = FC_WEIGHT_EXTRALIGHT;
else if (os2->usWeightClass < 350) else if (os2->usWeightClass < 325)
weight = FC_WEIGHT_LIGHT; weight = FC_WEIGHT_LIGHT;
else if (os2->usWeightClass < 365)
weight = FC_WEIGHT_SEMILIGHT;
else if (os2->usWeightClass < 390)
weight = FC_WEIGHT_BOOK;
else if (os2->usWeightClass < 450) else if (os2->usWeightClass < 450)
weight = FC_WEIGHT_REGULAR; weight = FC_WEIGHT_REGULAR;
else if (os2->usWeightClass < 550) else if (os2->usWeightClass < 550)

View File

@ -136,6 +136,8 @@ static const FcConstant _FcBaseConstants[] = {
{ (FcChar8 *) "thin", "weight", FC_WEIGHT_THIN, }, { (FcChar8 *) "thin", "weight", FC_WEIGHT_THIN, },
{ (FcChar8 *) "extralight", "weight", FC_WEIGHT_EXTRALIGHT, }, { (FcChar8 *) "extralight", "weight", FC_WEIGHT_EXTRALIGHT, },
{ (FcChar8 *) "ultralight", "weight", FC_WEIGHT_EXTRALIGHT, }, { (FcChar8 *) "ultralight", "weight", FC_WEIGHT_EXTRALIGHT, },
{ (FcChar8 *) "demilight", "weight", FC_WEIGHT_DEMILIGHT, },
{ (FcChar8 *) "semilight", "weight", FC_WEIGHT_DEMILIGHT, },
{ (FcChar8 *) "light", "weight", FC_WEIGHT_LIGHT, }, { (FcChar8 *) "light", "weight", FC_WEIGHT_LIGHT, },
{ (FcChar8 *) "book", "weight", FC_WEIGHT_BOOK, }, { (FcChar8 *) "book", "weight", FC_WEIGHT_BOOK, },
{ (FcChar8 *) "regular", "weight", FC_WEIGHT_REGULAR, }, { (FcChar8 *) "regular", "weight", FC_WEIGHT_REGULAR, },