Class FormattedStringSettings


  • public class FormattedStringSettings
    extends Object
    The settings for formatted text.
    • Field Detail

      • DEFAULT_DPI

        public static final int DEFAULT_DPI
        Common DPI value (100% scaling in Windows).
        See Also:
        Constant Field Values
      • DPI_FONT_SCALE_FACTOR

        public static double DPI_FONT_SCALE_FACTOR
    • Constructor Detail

      • FormattedStringSettings

        public FormattedStringSettings​(Font font,
                                       Color color,
                                       Color backgroundColor,
                                       int scale)
        The constructor.
        Parameters:
        font - the formatted text font, cannot be null
        color - the formatted text color, cannot be null
        background - color the formatted text color, can be null
        scale - the form scale factor
      • FormattedStringSettings

        public FormattedStringSettings​(Font font,
                                       Color color,
                                       Color backgroundColor,
                                       int scale,
                                       FormattedStringSettings.Unit fontSizeUnit,
                                       double margin,
                                       FormattedStringSettings.Unit marginUnit,
                                       double padding,
                                       FormattedStringSettings.Unit paddingUnit,
                                       double letterSpacing,
                                       FormattedStringSettings.Unit letterSpacingUnit,
                                       double lineHeight,
                                       FormattedStringSettings.Unit lineHeightUnit)
        The constructor.
        Parameters:
        font - the formatted text font, cannot be null
        color - the formatted text color, cannot be null
        background - color the formatted text color, can be null
        scale - the form scale factor
        fontSizeUnit - the formatted text size units
        margin - the formatted text margin
        marginUnit - the formatted text margin units
        padding - the formatted text padding
        paddingUnit - the formatted text padding units
        letterSpacing - the formatted text letter spacing
        letterSpacingUnit - the formatted text letter spacing units
        lineHeight - the formatted text line height
        lineHeightUnit - the formatted text line height units
    • Method Detail

      • getFont

        public Font getFont()
        Returns font.
        Returns:
        font, cannot be null
      • getColor

        public Color getColor()
        Returns color.
        Returns:
        color, cannot be null
      • getBackgroundColor

        public Color getBackgroundColor()
        Returns background color.
        Returns:
        background color, can be null
      • getScale

        public int getScale()
        Returns scale factor.
        Returns:
        scale factor
      • getPadding

        public double getPadding()
        Returns formatted text padding.
        Returns:
        formatted text padding
      • getMargin

        public double getMargin()
        Returns formatted text margin.
        Returns:
        formatted text margin
      • getLineHeight

        public double getLineHeight()
        Returns formatted text line height.
        Returns:
        formatted text line height
      • getLetterSpacing

        public double getLetterSpacing()
        Returns formatted text letter spacing.
        Returns:
        formatted text letter spacing
      • getPaddingUnit

        public FormattedStringSettings.Unit getPaddingUnit()
        Returns formatted text padding units.
        Returns:
        formatted text padding units
      • getMarginUnit

        public FormattedStringSettings.Unit getMarginUnit()
        Returns formatted text margin units.
        Returns:
        formatted text margin units
      • getLineHeightUnit

        public FormattedStringSettings.Unit getLineHeightUnit()
        Returns formatted text line height units.
        Returns:
        formatted text line height units
      • getLetterSpacingUnit

        public FormattedStringSettings.Unit getLetterSpacingUnit()
        Returns formatted text letter spacing units.
        Returns:
        formatted text letter spacing units
      • getFontSizeUnit

        public FormattedStringSettings.Unit getFontSizeUnit()
        Returns formatted text font size units.
        Returns:
        formatted text font size units
      • removeFormatTags

        public static String removeFormatTags​(String stringWithTags)
        Removes format tags from given string.
        Parameters:
        stringWithTags - the string with tags, can be null.
        Returns:
        the string without tags, can be null.