CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Font Class Reference

Font selector More...

#include <cc/Font>

Public Member Functions

 Font ()
 Create an unspecific font selector.
 
 Font (double size)
 Create font selector for given size.
 
 operator bool () const
 Check if this font selector is specific.
 
 Font (const String &family, double size)
 Create font selector for given family and size.
 
 Font (const String &family)
 Create font selector for given family.
 
 Font (Pitch pitch)
 Create font selector for given pitch.
 
 Font (Pitch pitch, double size)
 Create font selector for given pitch and size.
 
String family () const
 Get font family.
 
Fontfamily (const String &newValue)
 Set font family
 
double size () const
 Get font size (in pixel)
 
Fontsize (double newValue)
 Set font size (in pixel)
 
Slant slant () const
 Get slant.
 
Fontslant (Slant newValue)
 Set slant
 
Weight weight () const
 Get weight.
 
Fontweight (Weight newValue)
 Set weight
 
Stretch stretch () const
 Get stretch.
 
Fontstretch (Stretch newValue)
 Set stretch
 
Decoration decoration () const
 Get decoration.
 
Fontdecoration (Decoration newValue)
 Set decoration
 
FontSmoothing smoothing () const
 Get smoothing.
 
Fontsmoothing (FontSmoothing newValue)
 Set smoothing
 
OutlineHinting outlineHinting () const
 Get outline hinting.
 
FontoutlineHinting (OutlineHinting newValue)
 Set outline hinting
 
MetricsHinting metricsHinting () const
 Get metrics hinting.
 
FontmetricsHinting (MetricsHinting newValue)
 Set metrics hinting
 
Color color () const
 Get foreground color.
 
Fontcolor (Color newValue)
 Set foreground color
 
Color paper () const
 Get background color.
 
Fontpaper (Color newValue)
 Set background color
 
String path () const
 Obtain the path of the font file this font would select.
 
Fontoperator*= (double scale)
 
bool operator== (const Font &b) const
 Equal to operator.
 
bool operator!= (const Font &b) const
 Not equal to operator.
 

Static Public Member Functions

static double defaultSize (Pitch pitch=Pitch::Variable)
 Get default font size (in pixel) for given pitch.
 

Detailed Description

Font selector

Constructor & Destructor Documentation

◆ Font() [1/6]

Font ( )

Create an unspecific font selector.

◆ Font() [2/6]

Font ( double size)

Create font selector for given size.

◆ Font() [3/6]

Font ( const String & family,
double size )

Create font selector for given family and size.

◆ Font() [4/6]

Font ( const String & family)

Create font selector for given family.

◆ Font() [5/6]

Font ( Pitch pitch)

Create font selector for given pitch.

◆ Font() [6/6]

Font ( Pitch pitch,
double size )

Create font selector for given pitch and size.

Member Function Documentation

◆ operator bool()

operator bool ( ) const

Check if this font selector is specific.

◆ family() [1/2]

String family ( ) const

Get font family.

◆ family() [2/2]

Font & family ( const String & newValue)

Set font family

◆ size() [1/2]

double size ( ) const

Get font size (in pixel)

◆ size() [2/2]

Font & size ( double newValue)

Set font size (in pixel)

◆ defaultSize()

double defaultSize ( Pitch pitch = Pitch::Variable)
static

Get default font size (in pixel) for given pitch.

◆ slant() [1/2]

Slant slant ( ) const

Get slant.

◆ slant() [2/2]

Font & slant ( Slant newValue)

Set slant

◆ weight() [1/2]

Weight weight ( ) const

Get weight.

◆ weight() [2/2]

Font & weight ( Weight newValue)

Set weight

◆ stretch() [1/2]

Stretch stretch ( ) const

Get stretch.

◆ stretch() [2/2]

Font & stretch ( Stretch newValue)

Set stretch

◆ decoration() [1/2]

Decoration decoration ( ) const

Get decoration.

◆ decoration() [2/2]

Font & decoration ( Decoration newValue)

Set decoration

◆ smoothing() [1/2]

FontSmoothing smoothing ( ) const

Get smoothing.

◆ smoothing() [2/2]

Font & smoothing ( FontSmoothing newValue)

Set smoothing

◆ outlineHinting() [1/2]

OutlineHinting outlineHinting ( ) const

Get outline hinting.

◆ outlineHinting() [2/2]

Font & outlineHinting ( OutlineHinting newValue)

Set outline hinting

◆ metricsHinting() [1/2]

MetricsHinting metricsHinting ( ) const

Get metrics hinting.

◆ metricsHinting() [2/2]

Font & metricsHinting ( MetricsHinting newValue)

Set metrics hinting

◆ color() [1/2]

Color color ( ) const

Get foreground color.

◆ color() [2/2]

Font & color ( Color newValue)

Set foreground color

◆ paper() [1/2]

Color paper ( ) const

Get background color.

◆ paper() [2/2]

Font & paper ( Color newValue)

Set background color

◆ path()

String path ( ) const

Obtain the path of the font file this font would select.

◆ operator==()

bool operator== ( const Font & b) const

Equal to operator.

◆ operator!=()

bool operator!= ( const Font & b) const

Not equal to operator.