Class MFont

    • Constructor Detail

      • MFont

        public MFont​(String family,
                     int style,
                     double size)
        Contructs a font.
        Parameters:
        family - the family
        style - the style
        size - the size
      • MFont

        public MFont​(MFont f)
        Copy constructor.
        Parameters:
        f - the font to copy
      • MFont

        public MFont​(Font f)
        Create a wrapper for the specified AWT font.
        Parameters:
        f - the AWT font
    • Method Detail

      • getFamily

        public String getFamily()
        Gets the font family name.
        Returns:
        the font family
      • getStyle

        public int getStyle()
        Gets the font style.
        Returns:
        the font style
      • getSizeDouble

        public double getSizeDouble()
        Gets the font size.
        Returns:
        the font size
      • isBold

        public boolean isBold()
        Tests whether the font is bold.
        Returns:
        true if the font is bold, false otherwise
      • isItalic

        public boolean isItalic()
        Tests whether the font is italic.
        Returns:
        true if the font is italic, false otherwise
      • getAWTFont

        public Font getAWTFont()
        Gets an AWT font instance.
        Returns:
        the AWT font
      • getScaledAWTFont

        public Font getScaledAWTFont​(Float scale)
        Gets an AWT font instance after scaling.
        Parameters:
        scale - the scaling factor
        Returns:
        the AWT font
      • getString

        public String getString()
        Gets the string representation.
        Returns:
        the string representation
      • equals

        public boolean equals​(Object o)
        Tests whether two font objects equal.
        Overrides:
        equals in class Object
        Returns:
        true if they are equal, false otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • cloneMFont

        public MFont cloneMFont()
        Creates a clone.
        Returns:
        the clone
      • clone

        public Object clone()
        Creates a clone.
        Overrides:
        clone in class Object
        Returns:
        the clone
      • sizeToString

        public static String sizeToString​(double size)
        Converts an integer or fractional size to a string.
        Returns:
        the string