From 13197b8d4f1000249fa98b587c047d35f4ab1cf2 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Mon, 14 Aug 2017 11:06:12 -0400 Subject: Add BOOK and DEMI_LIGHT. It would be nice to use FcWeightToOpenType but this was buggy until 2.12.4. Change-Id: Ifcf9bfc783ea63c684bedb2a22267e97461d4945 Reviewed-on: https://skia-review.googlesource.com/129182 Reviewed-by: Herb Derby Commit-Queue: Ben Wagner --- src/ports/SkFontConfigInterface_direct.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ports/SkFontConfigInterface_direct.cpp') diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp index 51a72e2816..875000daa5 100644 --- a/src/ports/SkFontConfigInterface_direct.cpp +++ b/src/ports/SkFontConfigInterface_direct.cpp @@ -410,6 +410,10 @@ template struct SkTFixed { static const SkFixed value = static_cast(n << 16); }; +#ifndef FC_WEIGHT_DEMILIGHT +#define FC_WEIGHT_DEMILIGHT 65 +#endif + static SkFontStyle skfontstyle_from_fcpattern(FcPattern* pattern) { typedef SkFontStyle SkFS; @@ -417,6 +421,8 @@ static SkFontStyle skfontstyle_from_fcpattern(FcPattern* pattern) { { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, + { SkTFixed::value, SkTFixed<350>::value }, + { SkTFixed::value, SkTFixed<380>::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, @@ -460,6 +466,8 @@ static void fcpattern_from_skfontstyle(SkFontStyle style, FcPattern* pattern) { { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, + { SkTFixed<350>::value, SkTFixed::value }, + { SkTFixed<380>::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, { SkTFixed::value, SkTFixed::value }, -- cgit v1.2.3