8 #ifndef SkFontStyle_DEFINED
9 #define SkFontStyle_DEFINED
12 #include "include/private/base/SkTPin.h"
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 );
80 friend class SkTypefaceProxyPrototype;
Definition: SkFontStyle.h:16
constexpr SkFontStyle(int weight, int width, Slant slant)
Definition: SkFontStyle.h:50
Weight
Definition: SkFontStyle.h:18
constexpr SkFontStyle()
Definition: SkFontStyle.h:56
Slant slant() const
Definition: SkFontStyle.h:64
static constexpr SkFontStyle Italic()
Definition: SkFontStyle.h:72
int width() const
Definition: SkFontStyle.h:63
int weight() const
Definition: SkFontStyle.h:62
Width
Definition: SkFontStyle.h:32
static constexpr SkFontStyle BoldItalic()
Definition: SkFontStyle.h:75
Slant
Definition: SkFontStyle.h:44
@ kOblique_Slant
Definition: SkFontStyle.h:47
@ kItalic_Slant
Definition: SkFontStyle.h:46
@ kUpright_Slant
Definition: SkFontStyle.h:45
bool operator==(const SkFontStyle &rhs) const
Definition: SkFontStyle.h:58
static constexpr SkFontStyle Bold()
Definition: SkFontStyle.h:69
static constexpr SkFontStyle Normal()
Definition: SkFontStyle.h:66