Class Font
- java.lang.Object
-
- org.pepstock.charba.client.configuration.Font
-
- All Implemented Interfaces:
IsDefaultFont
,IsFont
public final class Font extends Object implements IsFont
Base object to map font configuration.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontItem
create()
Creates a font options instance using default or cloning current instance.String
getFamily()
Returns the font family, follows CSS font-family options.double
getLineHeight()
Returns the height of an individual line of text.String
getLineHeightAsString()
Returns the height of an individual line of text.int
getSize()
Returns the font size.FontStyle
getStyle()
Returns the font style, follows CSS font-style options (i.e.Weight
getWeight()
Returns the font weight, follows CSS font-style-weight options.protected void
resetCallback()
Invokes when any property of the font is being set, in order to reset theFontCallback
if existsvoid
setFamily(String family)
Sets the font family, follows CSS font-family options.void
setLineHeight(double lineHeight)
Sets the line height.void
setLineHeight(String lineHeight)
Sets the line height.void
setSize(int size)
Sets the font size.void
setStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e.void
setWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultFont
create
-
-
-
-
Method Detail
-
setSize
public void setSize(int size)
Sets the font size.
-
getSize
public int getSize()
Returns the font size.- Specified by:
getSize
in interfaceIsDefaultFont
- Returns:
- the font size.
-
setStyle
public void setStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-
getStyle
public FontStyle getStyle()
Returns the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).- Specified by:
getStyle
in interfaceIsDefaultFont
- Returns:
- the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-
setFamily
public void setFamily(String family)
Sets the font family, follows CSS font-family options.
-
getFamily
public String getFamily()
Returns the font family, follows CSS font-family options.- Specified by:
getFamily
in interfaceIsDefaultFont
- Returns:
- Font family, follows CSS font-family options.
-
setWeight
public void setWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options.
-
getWeight
public Weight getWeight()
Returns the font weight, follows CSS font-style-weight options.- Specified by:
getWeight
in interfaceIsDefaultFont
- Returns:
- the font weight, follows CSS font-style-weight options.
-
setLineHeight
public void setLineHeight(double lineHeight)
Sets the line height.- Specified by:
setLineHeight
in interfaceIsFont
- Parameters:
lineHeight
- the line height.
-
setLineHeight
public void setLineHeight(String lineHeight)
Sets the line height.- Specified by:
setLineHeight
in interfaceIsFont
- Parameters:
lineHeight
- the line height.
-
getLineHeight
public double getLineHeight()
Returns the height of an individual line of text.- Specified by:
getLineHeight
in interfaceIsDefaultFont
- Returns:
- the height of an individual line of text.
-
getLineHeightAsString
public String getLineHeightAsString()
Returns the height of an individual line of text.- Specified by:
getLineHeightAsString
in interfaceIsDefaultFont
- Returns:
- the height of an individual line of text.
-
create
public FontItem create()
Creates a font options instance using default or cloning current instance.- Specified by:
create
in interfaceIsDefaultFont
- Returns:
- a font options instance using default or cloning current instance
-
resetCallback
protected void resetCallback()
Invokes when any property of the font is being set, in order to reset theFontCallback
if exists
-
-