Class CloudFonts
- java.lang.Object
-
- ca.cgjennings.graphics.cloudfonts.CloudFonts
-
public final class CloudFonts extends java.lang.Object
Provides a default cloud font collection.- Since:
- 3.4
- Author:
- Chris Jennings
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addReservedFamily(CloudFontFamily family)
Adds a font family to the user's reserved list.static CloudFontCollection
getDefaultCollection()
static void
installReservedFamilies()
If the user has reserved font families in the default collection, this method ensures that the relevant fonts are up to date and registered.static boolean
isReservedFamily(CloudFontFamily family)
Returns true if the user has reserved the specified font familystatic void
removeReservedFamily(CloudFontFamily family)
Removes a font family from the user's reserved list.
-
-
-
Method Detail
-
getDefaultCollection
public static CloudFontCollection getDefaultCollection()
-
installReservedFamilies
public static void installReservedFamilies()
If the user has reserved font families in the default collection, this method ensures that the relevant fonts are up to date and registered. This is called during application startup.
-
isReservedFamily
public static boolean isReservedFamily(CloudFontFamily family)
Returns true if the user has reserved the specified font family- Parameters:
familyName
- the font family to check- Returns:
- true if the user has reserved the font family, either in this session or in a previous session
-
addReservedFamily
public static void addReservedFamily(CloudFontFamily family)
Adds a font family to the user's reserved list. Reserving a font family causes that family to be loaded and registered during application startup so that it is always available for the user to use by family name. The font will also be updated automatically as updates are published (when the local cache is updated by the cloud font connector). Note that only families from the default collection can be reserved.- Parameters:
family
- the font family to reserve- Throws:
java.lang.NullPointerException
- if family is nulljava.lang.IllegalArgumentException
- if family is not from the default collection
-
removeReservedFamily
public static void removeReservedFamily(CloudFontFamily family)
Removes a font family from the user's reserved list. This method has no effect if the family is not reserved.- Parameters:
family
- the font family to remove- See Also:
addReservedFamily(ca.cgjennings.graphics.cloudfonts.CloudFontFamily)
-
-