]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcfreetype.c
Include fcftaliastail.h so that the freetype funcs are exported.
[fontconfig.git] / src / fcfreetype.c
index da2aa803daa42f3ae4cb00c8c48a6b99dcd1086c..c5d5251d9a6d87e9060463f409499a4725a6db8a 100644 (file)
@@ -45,6 +45,7 @@
 */
 
 #include "fcint.h"
+#include "fcftint.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -959,8 +960,18 @@ FcStringContainsConst (const FcChar8           *string,
     int        i;
 
     for (i = 0; i < nc; i++)
-       if (FcStrContainsIgnoreBlanksAndCase (string, c[i].name))
-           return c[i].value;
+    {
+       if (c[i].name[0] == '<')
+       {
+           if (FcStrContainsWord (string, c[i].name + 1))
+               return c[i].value;
+       }
+       else
+       {
+           if (FcStrContainsIgnoreBlanksAndCase (string, c[i].name))
+               return c[i].value;
+       }
+    }
     return -1;
 }
 
@@ -982,6 +993,10 @@ static const FcStringConst  weightConsts[] = {
     { (FC8) "superbold",       FC_WEIGHT_EXTRABOLD },
     { (FC8) "ultrabold",       FC_WEIGHT_ULTRABOLD },
     { (FC8) "bold",            FC_WEIGHT_BOLD },
+    { (FC8) "ultrablack",      FC_WEIGHT_ULTRABLACK },
+    { (FC8) "superblack",      FC_WEIGHT_EXTRABLACK },
+    { (FC8) "extrablack",      FC_WEIGHT_EXTRABLACK },
+    { (FC8) "<ultra",          FC_WEIGHT_ULTRABOLD }, /* only if a word */
     { (FC8) "black",           FC_WEIGHT_BLACK },
     { (FC8) "heavy",           FC_WEIGHT_HEAVY },
 };
@@ -1439,8 +1454,10 @@ FcFreeTypeQueryFace (const FT_Face  face,
            weight = FC_WEIGHT_BOLD;
        else if (os2->usWeightClass < 850)
            weight = FC_WEIGHT_EXTRABOLD;
-       else if (os2->usWeightClass < 950)
+       else if (os2->usWeightClass < 925)
            weight = FC_WEIGHT_BLACK;
+       else if (os2->usWeightClass < 1000)
+           weight = FC_WEIGHT_EXTRABLACK;
        if ((FcDebug() & FC_DBG_SCANV) && weight != -1)
            printf ("\tos2 weight class %d maps to weight %d\n",
                    os2->usWeightClass, weight);
@@ -2972,4 +2989,5 @@ bail:
 
 #define __fcfreetype__
 #include "fcaliastail.h"
+#include "fcftaliastail.h"
 #undef __fcfreetype__