Class FontSizeUtil

java.lang.Object
com.itextpdf.forms.util.FontSizeUtil

public final class FontSizeUtil extends Object
Utility class for font size calculations.
  • Method Details

    • approximateFontSizeToFitSingleLine

      public static float approximateFontSizeToFitSingleLine (PdfFont localFont, Rectangle bBox, String value, float minValue, float borderWidth)
      Calculates the font size that will fit the text in the given rectangle.
      Parameters:
      localFont - the font to be used
      bBox - the bounding box of the field
      value - the value of the field
      minValue - the minimum font size
      borderWidth - the border width of the field
      Returns:
      the font size that will fit the text in the given rectangle