A style class describing a font. More...
#include <Wt/WFont>
Public Types | |
enum | GenericFamily { Default, Serif, SansSerif, Cursive, Fantasy, Monospace } |
The generic font family. More... | |
enum | Style { NormalStyle, Italic, Oblique } |
The font style. More... | |
enum | Variant { NormalVariant, SmallCaps } |
The font variant. More... | |
enum | Weight { NormalWeight, Bold, Bolder, Lighter, Value } |
The font weight. More... | |
enum | Size { XXSmall, XSmall, Small, Medium, Large, XLarge, XXLarge, Smaller, Larger, FixedSize } |
The font size. More... | |
Public Member Functions | |
WFont () | |
A default font (dependent on the user agent). | |
bool | operator== (const WFont &other) const |
Comparison operator. | |
void | setFamily (GenericFamily genericFamily, const WString &specificFamilies=WString()) |
Sets the font family. | |
GenericFamily | genericFamily () const |
Returns the font generic family. | |
const WString & | specificFamilies () const |
Returns the font specific family names. | |
void | setStyle (Style style) |
Sets the font style. | |
Style | style () const |
Returns the font style. | |
void | setVariant (Variant variant) |
Sets the font variant. | |
Variant | variant () const |
Returns the font variant. | |
void | setWeight (Weight weight, int value=400) |
Sets the font weight. | |
Weight | weight () const |
Returns the font weight. | |
int | weightValue () const |
Returns the font weight value. | |
void | setSize (Size size, const WLength &fixedSize=WLength::Auto) |
Sets the font size. | |
Size | size () const |
Returns the font size. | |
WLength | fixedSize () const |
Returns the fixed font size for FixedSize . |
A style class describing a font.
enum Wt::WFont::Size |
The font size.
enum Wt::WFont::Style |
enum Wt::WFont::Variant |
enum Wt::WFont::Weight |
void Wt::WFont::setFamily | ( | GenericFamily | genericFamily, | |
const WString & | specificFamilies = WString() | |||
) |
Sets the font family.
The font family is specified using a generic family name, in addition to a comma-seperated list of specific font choices.
The first specific font that can be matched will be used, otherwise a generic font will be used.
void Wt::WFont::setWeight | ( | Weight | weight, | |
int | value = 400 | |||
) |
Sets the font weight.
When setting weight == Value, you may specify a value.
Valid values are between 100 and 900, and are rounded to multiples of 100.