com.itextpdf.tool.xml.css
Class FontSizeTranslator
java.lang.Object
com.itextpdf.tool.xml.css.FontSizeTranslator
public class FontSizeTranslator
- extends Object
- Author:
- Emiel Ackermann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_FONT_SIZE
public static final float DEFAULT_FONT_SIZE
- See Also:
- Constant Field Values
FontSizeTranslator
public FontSizeTranslator()
getInstance
public static FontSizeTranslator getInstance()
- Returns:
- Singleton instance of FontSizeTranslater.
translateFontSize
public float translateFontSize(Tag tag)
- 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
public float getFontSize(Tag tag)
- Retrieves the pt font size from
Tag.getCSS()
with CSS.Property.FONT_SIZE
or returns default 12pt
- Parameters:
tag
- the tag to get the font-size from.
- Returns:
- the font size
Copyright © 2012. All Rights Reserved.