Package eu.webtoolkit.jwt
Class WFont
java.lang.Object
eu.webtoolkit.jwt.WFont
A value class that describes a font.
-
Constructor Summary
ConstructorDescriptionWFont()
A default font (dependent on the user agent).WFont
(FontFamily family) A font of a given family. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.Returns the font generic family.final FontSize
getSize()
Returns the font size.getSize
(double mediumSize) Returns the font size.final WLength
Returns the font size as a numerical value.getSizeLength
(double mediumSize) Returns the font size as a numerical value.Returns the font specific family names.getStyle()
Returns the font style.Returns the font variant.Returns the font weight.int
Returns the font weight value.final void
setFamily
(FontFamily genericFamily) Sets the font family.void
setFamily
(FontFamily genericFamily, CharSequence specificFamilies) Sets the font family.void
Sets the font size.void
Sets the font size.void
Sets the font style.void
setVariant
(FontVariant variant) Sets the font variant.final void
setWeight
(FontWeight weight) Sets the font weight.void
setWeight
(FontWeight weight, int value) Sets the font weight.void
updateDomElement
(DomElement element, boolean fontall, boolean all)
-
Constructor Details
-
WFont
public WFont()A default font (dependent on the user agent). -
WFont
A font of a given family.Creates a Medium font of the given family.
-
-
Method Details
-
equals
Indicates whether some other object is "equal to" this one. -
setFamily
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
setFamily()
, e.g.WFont mono; mono.setFamily(FontFamily::Monospace, "'Courier New'"); mono.setSize(18);
-
setFamily
Sets the font family. -
getGenericFamily
Returns the font generic family. -
getSpecificFamilies
Returns the font specific family names. -
setStyle
Sets the font style. -
getStyle
Returns the font style. -
setVariant
Sets the font variant. -
getVariant
Returns the font variant. -
setWeight
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.
-
setWeight
Sets the font weight.Calls
setWeight(weight, 400)
-
getWeight
Returns the font weight. -
getWeightValue
public int getWeightValue()Returns the font weight value. -
setSize
Sets the font size.Sets the font size using a predefined CSS size.
-
setSize
Sets the font size.Sets the font size.
-
getSize
Returns the font size. -
getSize
Returns the font size.Returns
getSize(16)
-
getSizeLength
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. -
getSizeLength
Returns the font size as a numerical value.Returns
getSizeLength(16)
-
updateDomElement
-