Package com.iizix.prop.font
Enum Class BrowserFontFormat
- All Implemented Interfaces:
- Serializable,- Comparable<BrowserFontFormat>,- Constable
The various browsers and font formats to choose.
* IE: The font format only works when set to be "installable".
* Old Firefox: Disabled by default, but can be enabled (need to set a flag to "true" to use WOFF2).
The numbers in the table specifies the first browser version that fully supports the font format.
Font format IE Chrome Firefox Safari Opera Android ------------ --- ------ ------- ------ ----- ------- WOFF2 no 36 39 no 26.0 Android 5.x (or better) TTF/OTF 9.0* 4.0 3.5 3.1 10.0 WOFF 9.0 5.0 3.6 5.1 11.1 SVG no 4.0 no 3.2 9.0 EOT 6.0 no no no no
* IE: The font format only works when set to be "installable".
* Old Firefox: Disabled by default, but can be enabled (need to set a flag to "true" to use WOFF2).
Verified on "caniuse.com" for WOFF2, WOFF, etc support.
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from class java.lang.Enum- Enum.EnumDesc<E extends Enum<E>>
- Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionAll formats supported.Android 4.4+.Android 5.x+, browser version 40 +.Android, before 4.4.Chrome, before version 36.Chrome, version 36+Firefox, version 38-Firefox, version 39+.Internet Explorer 9+.Oper (Opera Mini doesn't support FontFace at all).All other browsers, to use WOFF and then TrueTypeSafari 12+.
- Field SummaryFieldsModifier and TypeFieldDescription- final List- <FontFormat> Unmodifiable list of the font formats possible, in priority order.
- Method SummaryModifier and TypeMethodDescription- static BrowserFontFormat- fromParsedUserAgent- (ua_parser.Client client) Finds the browser font format from the parsed client user agent.- static BrowserFontFormatReturns the enum constant of this class with the specified name.- static BrowserFontFormat[]- values()Returns an array containing the constants of this enum class, in the order they are declared.
- Enum Constant Details- MSIEInternet Explorer 9+.
- Chrome2Chrome, version 36+
- ChromeChrome, before version 36.
- Android5Android 5.x+, browser version 40 +.
- Android4_4Android 4.4+.
- AndroidOlderAndroid, before 4.4.
- Safari2Safari 12+.
- Firefox2Firefox, version 39+.
- FirefoxFirefox, version 38-
- OperaOper (Opera Mini doesn't support FontFace at all).
- OTHERAll other browsers, to use WOFF and then TrueType
- ALLAll formats supported.
 
- Field Details- formatsUnmodifiable list of the font formats possible, in priority order.
 
- Method Details- valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- fromParsedUserAgentFinds the browser font format from the parsed client user agent.- Parameters:
- client- The parsed client user agent instance.
- Returns:
- The matching browser font format.