Interface CloudFontFamily

  • All Superinterfaces:
    IconProvider

    public interface CloudFontFamily
    extends IconProvider
    A family of related cloud fonts that come from a single collection and share a family name.
    Since:
    3.4
    Author:
    Chris Jennings
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Axis[] getAxes()
      Returns the variable axes associated with fonts in this family.
      CategorySet getCategories()
      Returns the set of categories that describe this family, such as whether it is a serif or sans-serif font, and whether or not it is intended for display or text.
      CloudFont[] getCloudFonts()
      Returns the fonts that are part of this family.
      CloudFontCollection getCollection()
      Returns the collection to which this family belongs.
      java.awt.Font[] getFonts()
      Returns an array of AWT fonts, one for each font in this family, downloading them as necessary.
      java.lang.String getLicenseType()
      Returns the type of font license for this family, if available.
      java.lang.String getName()
      Returns the family name.
      java.lang.String[] getSubsets()
      Returns the subsets for which this font provides coverage.
      java.lang.String getTypeDesigner()
      Returns the name of the designer of the typeface, if available.
      boolean hasItalics()
      Returns true if the family has at least one italic or oblique variant.
      boolean hasSubset​(java.lang.String subset)
      Returns true if the font provides coverage for the specified subset.
      boolean hasWeights()
      Returns true if the family has at least one non-regular weight.
      default boolean isDownloaded()
      Returns true if all fonts in the family have been downloaded to the local cache.
      default boolean isRegistered()
      Returns true if the family has been registered.
      boolean isVariable()
      Returns true if the family has at least one variable axis.
      ResourceKit.FontRegistrationResult[] register()
      Registers this font family.
    • Method Detail

      • getCollection

        CloudFontCollection getCollection()
        Returns the collection to which this family belongs.
        Returns:
        the collection containing this family
      • getName

        java.lang.String getName()
        Returns the family name. Note that this is based on the file name, as the actual fonts might not be downloaded. Therefore this name may not exactly match the family name in the actual fonts.
        Returns:
        the family name
      • getTypeDesigner

        java.lang.String getTypeDesigner()
        Returns the name of the designer of the typeface, if available.
        Returns:
        the typographer, or an empty string
      • getLicenseType

        java.lang.String getLicenseType()
        Returns the type of font license for this family, if available.
        Returns:
        the license type, such as OFL, or an empty string
      • getCategories

        CategorySet getCategories()
        Returns the set of categories that describe this family, such as whether it is a serif or sans-serif font, and whether or not it is intended for display or text.
        Returns:
        the set of applicable categories
      • getSubsets

        java.lang.String[] getSubsets()
        Returns the subsets for which this font provides coverage.
        Returns:
        an array of subset names
      • hasSubset

        boolean hasSubset​(java.lang.String subset)
        Returns true if the font provides coverage for the specified subset.
        Parameters:
        subset - the subset name
        Returns:
        true if the font provides coverage for the subset
      • getAxes

        Axis[] getAxes()
        Returns the variable axes associated with fonts in this family.
        Returns:
        an array of font axes
      • hasWeights

        boolean hasWeights()
        Returns true if the family has at least one non-regular weight.
        Returns:
        true if the family has weights other than regular
        See Also:
        CloudFont.getStyle(), CloudFont.getAxes()
      • hasItalics

        boolean hasItalics()
        Returns true if the family has at least one italic or oblique variant.
        Returns:
        true if the family has a slanted variant
        See Also:
        CloudFont.getStyle(), CloudFont.getAxes()
      • isVariable

        boolean isVariable()
        Returns true if the family has at least one variable axis. Note that the Java font API may not support all variable axes.
        Returns:
        true if the family has at least one variable axis
      • getCloudFonts

        CloudFont[] getCloudFonts()
        Returns the fonts that are part of this family.
      • getFonts

        java.awt.Font[] getFonts()
                          throws java.io.IOException
        Returns an array of AWT fonts, one for each font in this family, downloading them as necessary.
        Returns:
        an array of fonts, in the same order as returned by getCloudFonts()
        Throws:
        java.io.IOException - if an error occurs while downloading, loading, or decoding any font
      • register

        ResourceKit.FontRegistrationResult[] register()
                                               throws java.io.IOException
        Registers this font family. Registered font families can be located by their family name when creating a font.
        Returns:
        an array of registration results, one for each font in the family
        Throws:
        java.io.IOException - if an error occurs while downloading, loading, or decoding any font
        See Also:
        ResourceKit#registerFont(java.awt.Font)
      • isDownloaded

        default boolean isDownloaded()
        Returns true if all fonts in the family have been downloaded to the local cache. Individual fonts can be checked using CloudFont.isDownloaded().
        Returns:
        true if all fonts are downloaded
      • isRegistered

        default boolean isRegistered()
        Returns true if the family has been registered.
        Returns:
        true if all fonts are registered