Package eu.europa.esig.dss.pdf.visible
Class AbstractFontMetrics
java.lang.Object
eu.europa.esig.dss.pdf.visible.AbstractFontMetrics
- Direct Known Subclasses:
ITextFontMetrics,JavaFontMetrics,PdfBoxFontMetrics
public abstract class AbstractFontMetrics extends Object
Contains methods for dealing with textual visual signature creation
-
Constructor Summary
Constructors Constructor Description AbstractFontMetrics() -
Method Summary
Modifier and Type Method Description AnnotationBoxcomputeTextBoundaryBox(String text, float fontSize, float padding)Computes a text boundary boxabstract floatgetHeight(String str, float size)Computes a height for a string of a given sizeString[]getLines(String text)Returns an array of strings, divided by a new line characterabstract floatgetWidth(String str, float size)Computes a width for a string of a given size
-
Constructor Details
-
AbstractFontMetrics
public AbstractFontMetrics()
-
-
Method Details
-
getLines
Returns an array of strings, divided by a new line character -
computeTextBoundaryBox
Computes a text boundary box- Parameters:
text-Stringthe original text to get Dimension forfontSize- the size of a fontpadding- the padding between text and its boundaries- Returns:
AnnotationBoxof the text
-
getWidth
Computes a width for a string of a given size- Parameters:
str-Stringto get width ofsize- of a string- Returns:
- string width
-
getHeight
Computes a height for a string of a given size- Parameters:
str-Stringto get height ofsize- of a string- Returns:
- string width
-