Class Font

  • All Implemented Interfaces:
    IsDefaultFont, IsFont

    public final class Font
    extends AbstractNode
    implements IsFont
    Base object to map font options for configuration.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • setSize

        public void setSize​(int size)
        Sets the font size.
        Specified by:
        setSize in interface IsFont
        Parameters:
        size - the font size.
      • getSize

        public int getSize()
        Returns the font size.
        Specified by:
        getSize in interface IsDefaultFont
        Returns:
        the font size.
      • setStyle

        public void setStyle​(FontStyle style)
        Sets the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
        Specified by:
        setStyle in interface IsFont
        Parameters:
        style - Font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
      • getStyle

        public FontStyle getStyle()
        Returns the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
        Specified by:
        getStyle in interface IsDefaultFont
        Returns:
        the font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
      • setFamily

        public void setFamily​(String family)
        Sets the font family, follows CSS font-family options.
        Specified by:
        setFamily in interface IsFont
        Parameters:
        family - Font family, follows CSS font-family options.
      • getFamily

        public String getFamily()
        Returns the font family, follows CSS font-family options.
        Specified by:
        getFamily in interface IsDefaultFont
        Returns:
        Font family, follows CSS font-family options.
      • setWeight

        public void setWeight​(Weight weight)
        Sets the font weight, follows CSS font-style-weight options.
        Specified by:
        setWeight in interface IsFont
        Parameters:
        weight - font weight, follows CSS font-style-weight options.
      • getWeight

        public Weight getWeight()
        Returns the font weight, follows CSS font-style-weight options.
        Specified by:
        getWeight in interface IsDefaultFont
        Returns:
        the font weight, follows CSS font-style-weight options.
      • setLineHeight

        public void setLineHeight​(double lineHeight)
        Sets the line height.
        Specified by:
        setLineHeight in interface IsFont
        Parameters:
        lineHeight - the line height.
      • setLineHeight

        public void setLineHeight​(String lineHeight)
        Sets the line height.
        Specified by:
        setLineHeight in interface IsFont
        Parameters:
        lineHeight - the line height.
      • getLineHeight

        public double getLineHeight()
        Returns the height of an individual line of text.
        Specified by:
        getLineHeight in interface IsDefaultFont
        Returns:
        the height of an individual line of text.
      • getLineHeightAsString

        public String getLineHeightAsString()
        Returns the height of an individual line of text.
        Specified by:
        getLineHeightAsString in interface IsDefaultFont
        Returns:
        the height of an individual line of text.
      • create

        public FontItem create()
        Description copied from interface: IsDefaultFont
        Creates a font options instance using default or cloning current instance.
        Specified by:
        create in interface IsDefaultFont
        Returns:
        a font options instance using default or cloning current instance
      • create

        public FontItem create​(IsDefaultFont defaultValues)
        Description copied from interface: IsDefaultFont
        Creates a font options instance using default or cloning current instance.
        Specified by:
        create in interface IsDefaultFont
        Parameters:
        defaultValues - default provider
        Returns:
        a font options instance using default or cloning current instance