Interface CloudFontConnector

  • All Known Implementing Classes:
    DefaultCloudFontConnector

    public interface CloudFontConnector
    A connector provides the connection details needed to connect to a cloud font collection, and a location where the collection can be cached locally.
    Since:
    3.4
    Author:
    Chris Jennings
    • Method Detail

      • getIdentifier

        java.lang.String getIdentifier()
        Returns a unique identifier for the connector. This can be used to distinguish data from different connectors, for example, when storing settings.
        Returns:
        a unique identifier for the connector
      • getUrlForFontPath

        java.net.URL getUrlForFontPath​(java.lang.String fontPath)
        Given a path to a font resource relative to the cloud file system root, returns a URL that can be used to download the resource.
        Parameters:
        fontPath - a path to a font resource, such as "ofl/lobster/Lobster-Regular.ttf"
        Returns:
        a URL that can be used to download the resource
        Throws:
        java.lang.IllegalArgumentException - if the path is invalid
      • getUrlForMetadata

        java.net.URL getUrlForMetadata()
        Returns a URL for metadata that describes the available fonts.
        Returns:
        a URL for the font metadata
      • getUrlForMetadataVersion

        java.net.URL getUrlForMetadataVersion()
        Returns a URL that returns a version code for the font metadata. When this version code changes, any cached metadata should be considered stale.
        Returns:
        a URL for the font metadata version
      • getLocalCacheRoot

        java.io.File getLocalCacheRoot()
        Returns the root directory of the local cache. This directory is used to store downloaded font files and metadata. Two collection instances should not share the same cache root.
        Returns:
        the local cache root
      • createFontCollection

        CloudFontCollection createFontCollection()
        Creates a collection that will use this connector's connection details.