Package com.itextpdf.tool.xml.css
Class FontSizeTranslator
java.lang.Object
com.itextpdf.tool.xml.css.FontSizeTranslator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
private static FontSizeTranslator
private static CssUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
getFontSize
(Tag tag) Retrieves the pt font size fromTag.getCSS()
withCSS.Property.FONT_SIZE
or returns default 12ptstatic FontSizeTranslator
float
translateFontSize
(Tag tag) Returns the css value of the style font-size in a pt-value.
-
Field Details
-
DEFAULT_FONT_SIZE
public static final float DEFAULT_FONT_SIZE- See Also:
-
utils
-
myself
-
-
Constructor Details
-
FontSizeTranslator
public FontSizeTranslator()
-
-
Method Details
-
getInstance
- Returns:
- Singleton instance of FontSizeTranslater.
-
translateFontSize
Returns the css value of the style font-size in a pt-value. Possible font-size values:- a constant in px, in, cm, mm, pc, em or ex,
- xx-small,
- x-small,
- small,
- medium,
- large,
- x-large,
- xx-large,
- smaller (than tag's parent size),
- larger (than tag's parent size),
- a percentage (e.g font-size:250%) of tag's parent size,
- Parameters:
tag
- to get the font size of.- Returns:
- float font size of the content of the tag in pt.
-
getFontSize
Retrieves the pt font size fromTag.getCSS()
withCSS.Property.FONT_SIZE
or returns default 12pt- Parameters:
tag
- the tag to get the font-size from.- Returns:
- the font size
-