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 AnnotationBox
computeTextBoundaryBox(String text, float fontSize, float padding)
Computes a text boundary boxabstract float
getHeight(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 float
getWidth(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
-String
the original text to get Dimension forfontSize
- the size of a fontpadding
- the padding between text and its boundaries- Returns:
AnnotationBox
of the text
-
getWidth
Computes a width for a string of a given size- Parameters:
str
-String
to get width ofsize
- of a string- Returns:
- string width
-
getHeight
Computes a height for a string of a given size- Parameters:
str
-String
to get height ofsize
- of a string- Returns:
- string width
-