Class AbstractFontMetrics

java.lang.Object
eu.europa.esig.dss.pdf.visible.AbstractFontMetrics
Direct Known Subclasses:
ITextFontMetrics, JavaFontMetrics, PdfBoxFontMetrics

public abstract class AbstractFontMetrics
extends Object
  • Constructor Details

  • Method Details

    • getLines

      public String[] getLines​(String text)
      Returns an array of strings, divided by a new line character
      Parameters:
      text - String original text to get lines from
      Returns:
      an array of Strings
    • computeDimension

      public Dimension computeDimension​(String text, float fontSize, float padding)
      Computes a text Dimension boundary box
      Parameters:
      text - String the original text to get Dimension for
      fontSize - the size of a font
      padding - the padding between text and its boundaries
      Returns:
      Dimension of the text
    • getWidth

      public abstract float getWidth​(String str, float size)
      Computes a width for a string of a given size
      Parameters:
      str - String to get width of
      size - of a string
      Returns:
      string width
    • getHeight

      public abstract float getHeight​(String str, float size)
      Computes a height for a string of a given size
      Parameters:
      str - String to get height of
      size - of a string
      Returns:
      string width