Class FontSpecifier

    • Method Detail

      • collectionIndex

        public int collectionIndex()
        Gets the collection index of the font. -1 when not a collection.
        Returns:
        The type of the font.
      • hashCode

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

        public String id()
        Gets the unique ID of the font.
        Returns:
        The type of the font.
      • byFileName

        public static FontSpecifier.Builder byFileName​(String fileName)
        Creates a new builder for a font specifier based on the file name. The file name should include the extension, e.g. "LiberationMono-BoldItalic.ttf". The base name is used as the font ID, and the extension is used to determine the font type.
        Parameters:
        fileName - The file name of the font file.
        Returns:
        A new builder for a font specifier.
      • openType

        public static FontSpecifier.Builder openType​(String id)
        Creates a new builder for an OpenType font specifier.
        Parameters:
        id - The unique identifier of the font, including its style and variation, e.g. "LiberationMono-BoldItalic".
        Returns:
        A new builder for an OpenType font specifier.
      • trueType

        public static FontSpecifier.Builder trueType​(String id)
        Creates a new builder for a TrueType font specifier.
        Parameters:
        id - The unique identifier of the font, including its style and variation, e.g. "LiberationMono-BoldItalic".
        Returns:
        A new builder for a TrueType font specifier.