Photon microGUI widgets library 0.6.0
PhWidgets::Drawing::Font Class Reference

Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited. More...

#include <Font.h>

Public Member Functions

 Font (const Font &other, typedefs::font_style_bitmask fstyle)
 (constructor) More...
 
 Font (FontFamily ffamily, std::uint32_t size, typedefs::font_style_bitmask fstyle=FontStyle::Regular)
 (constructor) More...
 
 Font (font_id_type fid)
 (constructor) More...
 
 Font (const Font &other)
 (copy constructor) More...
 
Fontoperator= (const Font &other)
 Assigns value in Font. More...
 
bool operator== (const Font &other) const
 Compares Fonts. More...
 
bool operator!= (const Font &other) const
 Compares Fonts. More...
 
bool operator< (const Font &other) const
 Compares Fonts. More...
 
 operator const font_id_type () const
 Converts Font to Photon FontID.
 

Properties

Properties are used to simplify use of fonts.

const bool & Bold
 Gets a value that indicates whether this Font is bold.
 
const FontFamilyFamily
 Gets the FontFamily associated with this Font.
 
const std::uint32_t & Height
 Gets the line spacing of this Font.
 
const bool & Italic
 Gets a value that indicates whether this Font has the italic style applied.
 
const std::string & Name
 Gets the face name of this Font.
 
const std::uint32_t & Size
 Gets the em-size, in points, of this Font.
 

Detailed Description

Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.

Constructor & Destructor Documentation

◆ Font() [1/4]

PhWidgets::Drawing::Font::Font ( const Font other,
typedefs::font_style_bitmask  fstyle 
)

(constructor)

Initializes a new Font that uses the specified existing Font and FontStyle::eFontStyle enumeration.

Parameters
[in]otherThe existing Font from which to create the new Font.
[in]fstyleThe FontStyle::eFontStyle to apply to the new Font. Multiple values of the FontStyle::eFontStyle enumeration can be combined with the OR operator.
Exceptions
std::invalid_argument

◆ Font() [2/4]

PhWidgets::Drawing::Font::Font ( FontFamily  ffamily,
std::uint32_t  size,
typedefs::font_style_bitmask  fstyle = FontStyle::Regular 
)

(constructor)

Initializes a new Font using a specified size and style.

Parameters
[in]ffamilyThe FontFamily of the new Font.
[in]sizeThe em-size, in points, of the new font.
[in]fstyleThe FontStyle::eFontStyle combination of flags.

◆ Font() [3/4]

PhWidgets::Drawing::Font::Font ( font_id_type  fid)

(constructor)

Initializes a new Font using a Photon FontID.

Parameters
[in]fidPhoton FontID.

◆ Font() [4/4]

PhWidgets::Drawing::Font::Font ( const Font other)

(copy constructor)

Constructs a Font by copy.

Parameters
[in]otheranother Font to be used as source to initialize the elements of the container with.

Member Function Documentation

◆ operator!=()

bool PhWidgets::Drawing::Font::operator!= ( const Font other) const

Compares Fonts.

Compares the Fonts by their Photon FontID.

Parameters
[in]otherFont whose contents to compare.

◆ operator<()

bool PhWidgets::Drawing::Font::operator< ( const Font other) const

Compares Fonts.

Compares the Fonts by their Photon FontID.

Parameters
[in]otherFont whose contents to compare.

◆ operator=()

Font & PhWidgets::Drawing::Font::operator= ( const Font other)

Assigns value in Font.

Replaces the contents of the Font.

Parameters
[in]otheranother Font to use as data source.

◆ operator==()

bool PhWidgets::Drawing::Font::operator== ( const Font other) const

Compares Fonts.

Compares the Fonts by their Photon FontID.

Parameters
[in]otherFont whose contents to compare.

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