Class FontSizeUtil


  • public final class FontSizeUtil
    extends java.lang.Object
    Utility class for font size calculations.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FontSizeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static float approximateFontSizeToFitSingleLine​(PdfFont localFont, Rectangle bBox, java.lang.String value, float minValue, float borderWidth)
      Calculates the font size that will fit the text in the given rectangle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FontSizeUtil

        private FontSizeUtil()
    • Method Detail

      • approximateFontSizeToFitSingleLine

        public static float approximateFontSizeToFitSingleLine​(PdfFont localFont,
                                                               Rectangle bBox,
                                                               java.lang.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