org.xhtmlrenderer.render
Class LineMetricsAdapter
java.lang.Object
org.xhtmlrenderer.render.LineMetricsAdapter
- All Implemented Interfaces:
- FSFontMetrics
public class LineMetricsAdapter
- extends java.lang.Object
- implements FSFontMetrics
A note on this class: What we really want is a FontMetrics2D object (i.e.
font metrics with float precision). Unfortunately, it doesn't seem
the JDK provides this. However, looking at the JDK code, it appears the
metrics contained in the LineMetrics are actually the metrics of the font, not
the metrics of the line (and empirically strings of "X" and "j" return the same
value for getAscent()). So... for now we use LineMetrics for font metrics.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineMetricsAdapter
public LineMetricsAdapter(java.awt.font.LineMetrics lineMetrics)
getAscent
public float getAscent()
- Specified by:
getAscent
in interface FSFontMetrics
getDescent
public float getDescent()
- Description copied from interface:
FSFontMetrics
- In keeping with the JDK
LineMetrics
convention, this number is
positive for values below the baseline.
- Specified by:
getDescent
in interface FSFontMetrics
getStrikethroughOffset
public float getStrikethroughOffset()
- Specified by:
getStrikethroughOffset
in interface FSFontMetrics
getStrikethroughThickness
public float getStrikethroughThickness()
- Specified by:
getStrikethroughThickness
in interface FSFontMetrics
getUnderlineOffset
public float getUnderlineOffset()
- Description copied from interface:
FSFontMetrics
- In keeping with the JDK
LineMetrics
convention, this number is
positive for values below the baseline.
- Specified by:
getUnderlineOffset
in interface FSFontMetrics
getUnderlineThickness
public float getUnderlineThickness()
- Specified by:
getUnderlineThickness
in interface FSFontMetrics
Flying Saucer Project Home