Boost.UI
User Interface Boost library
Public Types | Public Member Functions | Static Public Member Functions | List of all members
boost::ui::font Class Reference

Font class. More...

Public Types

enum  family {
  family::other, family::serif, family::sans_serif, family::cursive,
  family::fantasy, family::monospace
}
 Enumaration of font families. More...
 
enum  slant { slant::normal, slant::italic, slant::oblique }
 Enumaration of font slants. More...
 
enum  weight { weight::normal, weight::bold }
 Enumaration of font weights. More...
 
typedef void * native_handle_type
 Implementation-defined font type.
 

Public Member Functions

fontset_family (family f)
 Sets font family.
 
family get_family () const
 Returns font family.
 
fontset_slant (slant s)
 Sets font slant.
 
slant get_slant () const
 Returns font slant.
 
fontset_weight (weight w)
 Sets font weight.
 
weight get_weight () const
 Returns font weight.
 
fontname (const uistring &n)
 Sets font name. More...
 
uistring name () const
 Returns font name.
 
fontsize_pt (double pt)
 Sets font size in points. More...
 
double size_pt () const
 Returns font size in points.
 
bool valid () const noexcept
 Returns true only if font is valid.
 
 font (double pt, family f, slant s=slant::normal, weight w=weight::normal)
 Creates font.
 
 font (double pt, const uistring &n, slant s=slant::normal, weight w=weight::normal)
 Creates font.
 
native_handle_type native_handle ()
 Returns the implementation-defined underlying font handle.
 
const native_handle_type native_handle () const
 Returns the implementation-defined underlying font handle.
 

Static Public Member Functions

static font caption () noexcept
 Returns default font used for captioned widgets.
 

Detailed Description

Font class.

See also
CSS 2 Fonts (W3C)
CSS Fonts 3 (W3C)
Font (Wikipedia)

Member Enumeration Documentation

◆ family

Enumaration of font families.

Enumerator
other 

Font family not listed here.

serif 

Serif font family.

sans_serif 

Sans-serif font family.

cursive 

Curisive font family.

fantasy 

Decorative font family.

monospace 

Font family that all glyphs have the same fixed width.

◆ slant

Enumaration of font slants.

Enumerator
normal 

Normal slant.

italic 

Italic slant.

oblique 

Oblique slant.

◆ weight

Enumaration of font weights.

Enumerator
normal 

Normal weight.

bold 

Bold weight.

Member Function Documentation

◆ name()

font& boost::ui::font::name ( const uistring n)

Sets font name.

Exceptions
std::out_of_rangeIf font name isn't supported

◆ size_pt()

font& boost::ui::font::size_pt ( double  pt)

Sets font size in points.

Exceptions
std::out_of_rangeIf font size isn't positive value

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