public static class StyleParser.FontInfo extends Object
Constructor and Description |
---|
FontInfo() |
Modifier and Type | Method and Description |
---|---|
Font |
createFont(Style baseStyle)
Creates a font based on this font information.
|
String |
getFile()
Gets the font file name.
|
String |
getName()
Gets the name of the font.
|
Float |
getSize()
Gets the font size.
|
float |
getSizeInPixels(Style baseStyle)
Gets the size of the font in pixels.
|
byte |
getSizeUnit()
Gets the font size unit.
|
void |
setFile(String file)
Sets the font file name.
|
void |
setName(String name)
Sets the name of the font.
|
void |
setSize(Float size)
Sets the font size.
|
void |
setSizeUnit(byte sizeUnit)
Sets the font size unit.
|
String |
sizeString(String prefix)
Gets the font size as a style string.
|
String |
toString()
Returns the font in a format that can be used as the value of the font property of a style string.
|
public String toString()
public String sizeString(String prefix)
prefix
- String to prefix to the size.public float getSizeInPixels(Style baseStyle)
baseStyle
- The base style to use in case the font size isn't specified in the style string.public Float getSize()
getSizeUnit()
public void setSize(Float size)
size
- the size to setsetSizeUnit(byte)
public byte getSizeUnit()
Style.UNIT_TYPE_DIPS
, Style.UNIT_TYPE_PIXELS
, or StyleParser.UNIT_INHERIT
.public void setSizeUnit(byte sizeUnit)
Style.UNIT_TYPE_DIPS
, Style.UNIT_TYPE_PIXELS
, or StyleParser.UNIT_INHERIT
.sizeUnit
- the sizeUnit to setpublic String getName()
public void setName(String name)
name
- the name to setpublic String getFile()
public void setFile(String file)
file
- the file to set