Interface CloudFont


  • public interface CloudFont
    Represents a font that can be downloaded from a CloudFontCollection.

    While some methods are included to obtain basic information about the font, these may be provided without access to the actual font, and therefore are not definitive since a remote font could change at any time.

    Since:
    3.4
    Author:
    Chris Jennings
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Axis[] getAxes()
      Returns an array of variable axes associated with the font.
      CloudFontFamily getFamily()
      Returns the family that includes the font.
      java.awt.Font getFont()
      Returns an AWT font for this cloud font, downloading it from the cloud if necessary.
      java.io.File getFontFile()
      Returns the file of the downloaded font, downloading it from the cloud if necessary.
      java.lang.String getName()
      Returns the name of the font.
      java.lang.String getStyle()
      Returns a description of the style of the font, if any is available, such as "Regular" or "BoldItalic".
      boolean isDownloaded()
      Returns true if the font is downloaded locally.
      boolean isRegistered()
      Returns true if this font was successfully registered during a call to CloudFontFamily.register().
      java.lang.String toString()
      Returns a string descriptor of the font.
    • Method Detail

      • getFamily

        CloudFontFamily getFamily()
        Returns the family that includes the font.
        Returns:
        the font family
      • getName

        java.lang.String getName()
        Returns the name of the font.
        Returns:
        the font name
      • getStyle

        java.lang.String getStyle()
        Returns a description of the style of the font, if any is available, such as "Regular" or "BoldItalic".
        Returns:
        the font style
      • getAxes

        Axis[] getAxes()
        Returns an array of variable axes associated with the font.
        Returns:
        an array of font axes
      • getFont

        java.awt.Font getFont()
                       throws java.io.IOException
        Returns an AWT font for this cloud font, downloading it from the cloud if necessary. If the entire font family should be downloaded, use CloudFontFamily#download() instead as it may download needed files more efficiently.
        Returns:
        a font instance for this cloud font
        Throws:
        java.io.IOException - if an error occurs while downloading, loading, or decoding the font
      • getFontFile

        java.io.File getFontFile()
                          throws java.io.IOException
        Returns the file of the downloaded font, downloading it from the cloud if necessary.
        Returns:
        the local cache file for the font
        Throws:
        java.io.IOException - if an error occurs while downloading the font
      • isDownloaded

        boolean isDownloaded()
        Returns true if the font is downloaded locally. In some cases, requesting the font may initiate a download even if this method returns true (for example, if the local copy is out of date.)
        Returns:
        true if the font is in the local download cache
      • isRegistered

        boolean isRegistered()
        Returns true if this font was successfully registered during a call to CloudFontFamily.register().
        Returns:
        true if the font is known to be registereds
      • toString

        java.lang.String toString()
        Returns a string descriptor of the font.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string descriptor of the font