Wt::WFont Class Reference
[Style classesPainting system]

A style class describing a font. More...

#include <Wt/WFont>

List of all members.

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 WStringspecificFamilies () 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 .


Detailed Description

A style class describing a font.

Member Enumeration Documentation

The generic font family.

Enumerator:
Default  Browser-dependent default.
Serif  for example: Times
SansSerif  for example: Helvetica
Cursive  for example: Zapf-Chancery
Fantasy  for example: Western
Monospace  for example: Courier

The font style.

Enumerator:
NormalStyle  Normal (default).
Italic  Italic.
Oblique  Oblique.

The font variant.

Enumerator:
NormalVariant  Normal (default).
SmallCaps  Small Capitals.

The font weight.

Enumerator:
NormalWeight  Normal (default) (Value == 400).
Bold  Bold (Value == 700).
Bolder  Bolder than the parent widget.
Lighter  Lighter than the parent widget.
Value  Specify a value (100 - 900).

The font size.

Enumerator:
XXSmall  Extra Extra small.
XSmall  Extra small.
Small  Small.
Medium  Medium, default.
Large  Large.
XLarge  Extra large.
XXLarge  Extra Extra large.
Smaller  Relatively smaller than the parent widget.
Larger  Relatively larger than the parent widget.
FixedSize  Explicit size, See also fontFixedSize().


Member Function Documentation

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.


Generated on Fri Mar 26 17:12:07 2010 for Wt by doxygen 1.5.6