Package org.xhtmlrenderer.render
Class LineMetricsAdapter
java.lang.Object
org.xhtmlrenderer.render.LineMetricsAdapter
- All Implemented Interfaces:
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
float
In keeping with the JDKLineMetrics
convention, this number is positive for values below the baseline.float
float
float
In keeping with the JDKLineMetrics
convention, this number is positive for values below the baseline.float
-
Field Details
-
_lineMetrics
-
-
Constructor Details
-
LineMetricsAdapter
-
-
Method Details
-
getAscent
public float getAscent()- Specified by:
getAscent
in interfaceFSFontMetrics
-
getDescent
public float getDescent()Description copied from interface:FSFontMetrics
In keeping with the JDKLineMetrics
convention, this number is positive for values below the baseline.- Specified by:
getDescent
in interfaceFSFontMetrics
-
getStrikethroughOffset
public float getStrikethroughOffset()- Specified by:
getStrikethroughOffset
in interfaceFSFontMetrics
-
getStrikethroughThickness
public float getStrikethroughThickness()- Specified by:
getStrikethroughThickness
in interfaceFSFontMetrics
-
getUnderlineOffset
public float getUnderlineOffset()Description copied from interface:FSFontMetrics
In keeping with the JDKLineMetrics
convention, this number is positive for values below the baseline.- Specified by:
getUnderlineOffset
in interfaceFSFontMetrics
-
getUnderlineThickness
public float getUnderlineThickness()- Specified by:
getUnderlineThickness
in interfaceFSFontMetrics
-