Class StyleParser.FontInfo
java.lang.Object
com.codename1.ui.plaf.StyleParser.FontInfo
- Enclosing class:
StyleParser
Encapsulates the value of the font property in a style string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFont(Style baseStyle) Creates a font based on this font information.getFile()Gets the font file name.getName()Gets the name of the font.getSize()Gets the font size.floatgetSizeInPixels(Style baseStyle) Gets the size of the font in pixels.byteGets the font size unit.voidSets the font file name.voidSets the name of the font.voidSets the font size.voidsetSizeUnit(byte sizeUnit) Sets the font size unit.sizeString(String prefix) Gets the font size as a style string.toString()Returns the font in a format that can be used as the value of the font property of a style string.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
FontInfo
public FontInfo()
-
-
Method Details
-
toString
-
sizeString
-
getSizeInPixels
Gets the size of the font in pixels.
Parameters
baseStyle: The base style to use in case the font size isn't specified in the style string.
-
getSize
Gets the font size.
Returns
the size
See also
- #getSizeUnit()
-
setSize
Sets the font size.
Parameters
size: the size to set
See also
- #setSizeUnit(byte)
-
getSizeUnit
public byte getSizeUnit()Gets the font size unit. One of
Style#UNIT_TYPE_DIPS,Style#UNIT_TYPE_PIXELS, or#UNIT_INHERIT.Returns
the sizeUnit
-
setSizeUnit
public void setSizeUnit(byte sizeUnit) Sets the font size unit. One of
Style#UNIT_TYPE_DIPS,Style#UNIT_TYPE_PIXELS, or#UNIT_INHERIT.Parameters
sizeUnit: the sizeUnit to set
-
getName
Gets the name of the font.
Returns
the name
-
setName
Sets the name of the font.
Parameters
name: the name to set
-
getFile
Gets the font file name. Should start with "/".
Returns
the file
-
setFile
Sets the font file name. Should start with "/".
Parameters
file: the file to set
-
createFont
-