8#ifndef SkFontStyle_DEFINED
9#define SkFontStyle_DEFINED
19 kInvisible_Weight = 0,
21 kExtraLight_Weight = 200,
25 kSemiBold_Weight = 600,
27 kExtraBold_Weight = 800,
29 kExtraBlack_Weight = 1000,
33 kUltraCondensed_Width = 1,
34 kExtraCondensed_Width = 2,
36 kSemiCondensed_Width = 4,
38 kSemiExpanded_Width = 6,
40 kExtraExpanded_Width = 8,
41 kUltraExpanded_Width = 9,
51 (
SkTPin<
int>(weight, kInvisible_Weight, kExtraBlack_Weight)) +
52 (
SkTPin<
int>(
width, kUltraCondensed_Width, kUltraExpanded_Width) << 16) +
53 (
SkTPin<
int>(slant, kUpright_Slant, kOblique_Slant) << 24)
59 return fValue == rhs.fValue;
62 int weight()
const {
return fValue & 0xFFFF; }
63 int width()
const {
return (fValue >> 16) & 0xFF; }
67 return SkFontStyle(kNormal_Weight, kNormal_Width, kUpright_Slant);
70 return SkFontStyle(kBold_Weight, kNormal_Width, kUpright_Slant);
73 return SkFontStyle(kNormal_Weight, kNormal_Width, kItalic_Slant );
76 return SkFontStyle(kBold_Weight, kNormal_Width, kItalic_Slant );
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
constexpr SkFontStyle(int weight, int width, Slant slant)
static constexpr SkFontStyle Italic()
static constexpr SkFontStyle BoldItalic()
bool operator==(const SkFontStyle &rhs) const
static constexpr SkFontStyle Bold()
static constexpr SkFontStyle Normal()