Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
SkFontStyle Class Reference

#include <SkFontStyle.h>

Public Types

enum  Weight {
  kInvisible_Weight = 0 , kThin_Weight = 100 , kExtraLight_Weight = 200 , kLight_Weight = 300 ,
  kNormal_Weight = 400 , kMedium_Weight = 500 , kSemiBold_Weight = 600 , kBold_Weight = 700 ,
  kExtraBold_Weight = 800 , kBlack_Weight = 900 , kExtraBlack_Weight = 1000
}
 
enum  Width {
  kUltraCondensed_Width = 1 , kExtraCondensed_Width = 2 , kCondensed_Width = 3 , kSemiCondensed_Width = 4 ,
  kNormal_Width = 5 , kSemiExpanded_Width = 6 , kExpanded_Width = 7 , kExtraExpanded_Width = 8 ,
  kUltraExpanded_Width = 9
}
 
enum  Slant { kUpright_Slant , kItalic_Slant , kOblique_Slant }
 

Public Member Functions

constexpr SkFontStyle (int weight, int width, Slant slant)
 
constexpr SkFontStyle ()
 
bool operator== (const SkFontStyle &rhs) const
 
int weight () const
 
int width () const
 
Slant slant () const
 

Static Public Member Functions

static constexpr SkFontStyle Normal ()
 
static constexpr SkFontStyle Bold ()
 
static constexpr SkFontStyle Italic ()
 
static constexpr SkFontStyle BoldItalic ()
 

Friends

class SkTypefaceProxyPrototype
 

Detailed Description

Definition at line 16 of file SkFontStyle.h.

Member Enumeration Documentation

◆ Slant

Enumerator
kUpright_Slant 
kItalic_Slant 
kOblique_Slant 

Definition at line 44 of file SkFontStyle.h.

◆ Weight

Enumerator
kInvisible_Weight 
kThin_Weight 
kExtraLight_Weight 
kLight_Weight 
kNormal_Weight 
kMedium_Weight 
kSemiBold_Weight 
kBold_Weight 
kExtraBold_Weight 
kBlack_Weight 
kExtraBlack_Weight 

Definition at line 18 of file SkFontStyle.h.

18 {
20 kThin_Weight = 100,
22 kLight_Weight = 300,
23 kNormal_Weight = 400,
24 kMedium_Weight = 500,
25 kSemiBold_Weight = 600,
26 kBold_Weight = 700,
28 kBlack_Weight = 900,
29 kExtraBlack_Weight = 1000,
30 };

◆ Width

Enumerator
kUltraCondensed_Width 
kExtraCondensed_Width 
kCondensed_Width 
kSemiCondensed_Width 
kNormal_Width 
kSemiExpanded_Width 
kExpanded_Width 
kExtraExpanded_Width 
kUltraExpanded_Width 

Definition at line 32 of file SkFontStyle.h.

Constructor & Destructor Documentation

◆ SkFontStyle() [1/2]

constexpr SkFontStyle::SkFontStyle ( int  weight,
int  width,
Slant  slant 
)
inlineconstexpr

Definition at line 50 of file SkFontStyle.h.

50 : fValue(
52 (SkTPin<int>(width, kUltraCondensed_Width, kUltraExpanded_Width) << 16) +
53 (SkTPin<int>(slant, kUpright_Slant, kOblique_Slant) << 24)
54 ) { }
Slant slant() const
Definition SkFontStyle.h:64
int width() const
Definition SkFontStyle.h:63
int weight() const
Definition SkFontStyle.h:62

◆ SkFontStyle() [2/2]

constexpr SkFontStyle::SkFontStyle ( )
inlineconstexpr

Member Function Documentation

◆ Bold()

static constexpr SkFontStyle SkFontStyle::Bold ( )
inlinestaticconstexpr

Definition at line 69 of file SkFontStyle.h.

69 {
71 }
constexpr SkFontStyle()
Definition SkFontStyle.h:56

◆ BoldItalic()

static constexpr SkFontStyle SkFontStyle::BoldItalic ( )
inlinestaticconstexpr

Definition at line 75 of file SkFontStyle.h.

◆ Italic()

static constexpr SkFontStyle SkFontStyle::Italic ( )
inlinestaticconstexpr

Definition at line 72 of file SkFontStyle.h.

◆ Normal()

static constexpr SkFontStyle SkFontStyle::Normal ( )
inlinestaticconstexpr

Definition at line 66 of file SkFontStyle.h.

◆ operator==()

bool SkFontStyle::operator== ( const SkFontStyle rhs) const
inline

Definition at line 58 of file SkFontStyle.h.

58 {
59 return fValue == rhs.fValue;
60 }

◆ slant()

Slant SkFontStyle::slant ( ) const
inline

Definition at line 64 of file SkFontStyle.h.

64{ return (Slant)((fValue >> 24) & 0xFF); }

◆ weight()

int SkFontStyle::weight ( ) const
inline

Definition at line 62 of file SkFontStyle.h.

62{ return fValue & 0xFFFF; }

◆ width()

int SkFontStyle::width ( ) const
inline

Definition at line 63 of file SkFontStyle.h.

63{ return (fValue >> 16) & 0xFF; }

Friends And Related Symbol Documentation

◆ SkTypefaceProxyPrototype

friend class SkTypefaceProxyPrototype
friend

Definition at line 80 of file SkFontStyle.h.


The documentation for this class was generated from the following file: