|
Wt
4.10.0
|
A value class that describes a font. More...
#include <Wt/WFont.h>
Public Types | |
| typedef FontFamily | Family |
| Typedef for enum Wt::FontFamily. | |
| typedef FontStyle | Style |
| Typedef for enum Wt::FontStyle. | |
| typedef FontVariant | Variant |
| Typedef for enum Wt::FontVariant. | |
| typedef FontWeight | Weight |
| Typedef for enum Wt::FontWeight. | |
| typedef FontSize | Size |
| Typedef for enum Wt::FontSize. | |
Public Member Functions | |
| WFont () | |
| A default font (dependent on the user agent). | |
| WFont (FontFamily family) | |
| A font of a given family. | |
| bool | operator== (const WFont &other) const |
| Comparison operator. | |
| void | setFamily (FontFamily genericFamily, const WString &specificFamilies=WString()) |
| Sets the font family. | |
| FontFamily | genericFamily () const |
| Returns the font generic family. | |
| const WString & | specificFamilies () const |
| Returns the font specific family names. | |
| void | setStyle (FontStyle style) |
| Sets the font style. | |
| FontStyle | style () const |
| Returns the font style. | |
| void | setVariant (FontVariant variant) |
| Sets the font variant. | |
| FontVariant | variant () const |
| Returns the font variant. | |
| void | setWeight (FontWeight weight, int value=400) |
| Sets the font weight. | |
| FontWeight | weight () const |
| Returns the font weight. | |
| int | weightValue () const |
| Returns the font weight value. | |
| void | setSize (FontSize size) |
| Sets the font size. | |
| void | setSize (const WLength &size) |
| Sets the font size. | |
| FontSize | size (double mediumSize=16) const |
| Returns the font size. | |
| WLength | sizeLength (double mediumSize=16) const |
| Returns the font size as a numerical value. | |
A value class that describes a font.
| Wt::WFont::WFont | ( | FontFamily | family | ) |
A font of a given family.
Creates a Medium font of the given family.
| void Wt::WFont::setFamily | ( | FontFamily | genericFamily, |
| const WString & | specificFamilies = WString() |
||
| ) |
Sets the font family.
The font family is specified using a generic family name, in addition to a comma-separated list of specific font choices.
The first specific font that can be matched will be used, otherwise a generic font will be used.
Careful, for a font family name that contains a space, you need to add quotes, to WFont::setFamily(), e.g.
| void Wt::WFont::setSize | ( | const WLength & | size | ) |
Sets the font size.
Sets the font size.
| void Wt::WFont::setSize | ( | FontSize | size | ) |
Sets the font size.
Sets the font size using a predefined CSS size.
| void Wt::WFont::setWeight | ( | FontWeight | 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.
| WLength Wt::WFont::sizeLength | ( | double | mediumSize = 16 | ) | const |
Returns the font size as a numerical value.
PositionScheme::Absolute size enumerations are converted to a length assuming a Medium font size of 16 px.