Class FontUtils
java.lang.Object
me.m64diamondstar.dialoguemaster.api.utils.FontUtils
Utilities for fonts. Primarily used for importing fonts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFontFormatFromUrl
(String urlString) Gets the font format of a URL.static boolean
isSupportedFormat
(String format) Checks if a format is supported.static boolean
isValidFont
(String url) Checks if a font URL is valid and supported.static boolean
isValidURL
(String url) Checks if a URL is valid.
-
Constructor Details
-
FontUtils
public FontUtils()
-
-
Method Details
-
getFontFormatFromUrl
Gets the font format of a URL.- Parameters:
urlString
- The URL to get the format from.- Returns:
- The font format (either "ttf" or "otf").
- Throws:
IOException
-
isSupportedFormat
Checks if a format is supported. (Supported formats are ttf and otf)- Parameters:
format
- The format to check.- Returns:
- True if the format is supported, false otherwise.
-
isValidURL
Checks if a URL is valid.- Parameters:
url
- The URL to check.- Returns:
- True if the URL is valid, false otherwise.
-
isValidFont
Checks if a font URL is valid and supported.- Parameters:
url
- The URL to check.- Returns:
- True if the font URL is valid and supported, false otherwise.
-