Package com.iizix
Interface IFontInfo
- All Known Implementing Classes:
FontInfo
public interface IFontInfo
Interface for the font information class for the UI. The values are the styles that govern the font information and contains the font family, weight, style and line height.
- Author:
- Christopher Mindus
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Resolver interface to get font information from a component.Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the font average character width.double
getEM()
Gets the EM size.double
getEX()
Gets the EX size.Gets the font family.double
Gets the font height.double
Gets the input character width used in calculations of HTML elements that are "input" tag based.Gets the letter spacing as in CSS.Gets the line height as in CSS.double
getPT()
Gets the PT size.getSize()
Gets the font size with unit as in CSS.int
getStringWidth
(KString text) Gets the string width of the specified unwrapped string.getStyle()
Gets the font style as in CSS.Gets the font weight as in CSS.
Method Details
getFamily
String getFamily()Gets the font family.- Returns:
- The family name, null for default.
getSize
String getSize()Gets the font size with unit as in CSS.- Returns:
- e.g. 12px, 110% or 14pt, null for default.
getWeight
String getWeight()Gets the font weight as in CSS.- Returns:
- e.g. bold, thin or 800, null for default.
getStyle
String getStyle()Gets the font style as in CSS.- Returns:
- e.g. italic or oblique, null for default.
getLineHeight
String getLineHeight()Gets the line height as in CSS.- Returns:
- Line height, null for default.
getLetterSpacing
String getLetterSpacing()Gets the letter spacing as in CSS.- Returns:
- Letter spacing, null for default.
getHeight
double getHeight()Gets the font height.- Returns:
- The font height.
getAverageWidth
double getAverageWidth()Gets the font average character width.- Returns:
- The average width.
getEM
double getEM()Gets the EM size.- Returns:
- EM size.
getEX
double getEX()Gets the EX size.- Returns:
- EX size.
getPT
double getPT()Gets the PT size.- Returns:
- The point size.
getInputCharWidth
double getInputCharWidth()Gets the input character width used in calculations of HTML elements that are "input" tag based.- Returns:
- The input character width.
getStringWidth
Gets the string width of the specified unwrapped string. This method requires a call to JavaScript in the (IE) browser and inter-thread communication and should be used with care.- Parameters:
text
- The text to measure.- Returns:
- The width in pixels in the current font.