Package adams.core.io

Class PdfFont

    • Constructor Detail

      • PdfFont

        public PdfFont()
        Initializes a default font.
      • PdfFont

        public PdfFont​(String family,
                       String face,
                       float size)
        Initializes the font with the given values.
        Parameters:
        family - the font family (helvetica, etc)
        face - the font face (bold, etc)
        size - the size of the font
      • PdfFont

        public PdfFont​(String family,
                       int face,
                       float size)
        Initializes the font with the given values.
        Parameters:
        family - the font family (helvetica, etc)
        face - the font face (bold, etc)
        size - the size of the font
      • PdfFont

        public PdfFont​(int family,
                       int face,
                       float size)
        Initializes the font with the given values.
        Parameters:
        family - the font family (helvetica, etc)
        face - the font face (bold, etc)
        size - the size of the font
      • PdfFont

        public PdfFont​(String fontStr)
        Parses the given string.
        Parameters:
        fontStr - the string to parse
    • Method Detail

      • getFontFamily

        public int getFontFamily()
        Turns the font family into the String constant of the font family.
        Returns:
        the font family
      • getFontFamilyName

        public String getFontFamilyName()
        Turns the font family into the String constant of the font family.
        Returns:
        the font family name
      • getFontFace

        public int getFontFace()
        Returns the font face.
        Returns:
        the font face
      • getFontFaces

        public String[] getFontFaces()
        Generates a list of font faces.
        Returns:
        the array of font faces
      • getSize

        public float getSize()
        Returns the font size.
        Returns:
        the font size
      • toString

        public String toString()
        Returns the font as string.
        Overrides:
        toString in class Object
        Returns:
        the string representation
      • toFont

        public com.itextpdf.text.Font toFont()
        Turns the font object into the PDF font.
        Returns:
        the font
      • toFont

        public com.itextpdf.text.Font toFont​(Color color)
        Turns the font object into the PDF font.
        Parameters:
        color - the color to use
        Returns:
        the font
      • toJavaFont

        public Font toJavaFont()
        Returns the closest Java font.
        Returns:
        the closest java font
      • getFontFamily

        public static int getFontFamily​(String name)
        Turns the font family name into the constant of the font family.
        Parameters:
        name - the font family name
        Returns:
        the font family identifier
      • getFontFamily

        public static String getFontFamily​(com.itextpdf.text.Font font)
        Turns the font family into the String constant of the font family.
        Parameters:
        font - the font to analyze
        Returns:
        the font family name
      • getFontFamilyEnum

        public static com.itextpdf.text.Font.FontFamily getFontFamilyEnum​(int family)
        Turns the font family into the enum of the font family.
        Parameters:
        family - the family to analyze
        Returns:
        the font family enum
      • getFontFamily

        public static String getFontFamily​(int family)
        Turns the font family into the String constant of the font family.
        Parameters:
        family - the family to analyze
        Returns:
        the font family name
      • getFontFace

        public static int getFontFace​(String name)
        Turns the font style name into the constant of the font style.
        Parameters:
        name - the font style name
        Returns:
        the font style identifier
      • getFontFaces

        public static String[] getFontFaces​(com.itextpdf.text.Font font)
        Generates a list of font style names from the given font setup.
        Parameters:
        font - the font to analyze
        Returns:
        the array of font names