Top Description Fields Constructors Methods
com.openhtmltopdf.render

public Class LineMetricsAdapter

extends Object
implements FSFontMetrics
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.render.FSFontMetrics
Imports
java.awt.Font, java.awt.font.FontRenderContext, .LineMetrics, java.util.ArrayList, .List

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

Modifier and TypeField and Description
private final List<LineMetrics>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public float
public float
getDescent()

Implements com.openhtmltopdf.render.FSFontMetrics.getDescent.

In keeping with the JDK java.awt.font.LineMetrics convention, this number is positive for values below the baseline.

public float
public float
public float
getUnderlineOffset()

Implements com.openhtmltopdf.render.FSFontMetrics.getUnderlineOffset.

In keeping with the JDK java.awt.font.LineMetrics convention, this number is positive for values below the baseline.

public float
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_lineMetricsback to summary
private final List<LineMetrics> _lineMetrics

Constructor Detail

LineMetricsAdapterback to summary
public LineMetricsAdapter(List<Font> fonts, String str, FontRenderContext ctx)

Method Detail

getAscentback to summary
public float getAscent()

Implements com.openhtmltopdf.render.FSFontMetrics.getAscent.

getDescentback to summary
public float getDescent()

Implements com.openhtmltopdf.render.FSFontMetrics.getDescent.

Doc from com.openhtmltopdf.render.FSFontMetrics.getDescent.

In keeping with the JDK java.awt.font.LineMetrics convention, this number is positive for values below the baseline.

getStrikethroughOffsetback to summary
public float getStrikethroughOffset()

Implements com.openhtmltopdf.render.FSFontMetrics.getStrikethroughOffset.

getStrikethroughThicknessback to summary
public float getStrikethroughThickness()

Implements com.openhtmltopdf.render.FSFontMetrics.getStrikethroughThickness.

getUnderlineOffsetback to summary
public float getUnderlineOffset()

Implements com.openhtmltopdf.render.FSFontMetrics.getUnderlineOffset.

Doc from com.openhtmltopdf.render.FSFontMetrics.getUnderlineOffset.

In keeping with the JDK java.awt.font.LineMetrics convention, this number is positive for values below the baseline.

getUnderlineThicknessback to summary
public float getUnderlineThickness()

Implements com.openhtmltopdf.render.FSFontMetrics.getUnderlineThickness.