Package com.iizigo.font
Class CSSFontDefinition
java.lang.Object
com.iizigo.font.CSSFontDefinition
The CSS font definition containing all the icons.
The following CSS can be parsed: - FontAwsome - IcoMoon - Iconic (https://useiconic.com/open/)
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- final StringThe font family.The font files required.- final ArrayList<FontFormat>The font file formats, null entries when not found.The font files locals, null entries when not found (can be comma separated).The font files queries, null entries when not found.- final StringThe font stretch, null for default "normal".- final StringThe font style, null for default "normal".- final StringThe font weight, null for default "normal".- final LinkedHashMap<String,- CSSFontIcon> The map of available icons, sorted by name.At least one style declaration in one or more @FontFace.- final StringThe unicode range, null for default "U+0-10FFFF".
- Method SummaryModifier and TypeMethodDescription- static int- buildFromTTF- (CSSFontDefinition fd, File file) Builds the icons that are available in the TrueType font file as defined characters between ASCII 32 and less than 65535.Gets the icon CSS declaration string.Gets the font files required, relative the CSS document URL.- String[]Gets the file names to copy in absolute paths.- void- initializeFontFiles- (EditorFontFiles ff, String baseRef) Creates the font files definition.- static List<CSSFontDefinition>Processes a CSS file from a file.- static List<CSSFontDefinition>- parse- (CSSRuleList list, ArrayList<String> warnings, File dir, boolean doIcons) Parses all fond definitions found in a style sheet.
- Field Details- fontFamilyThe font family.
- fontStretchThe font stretch, null for default "normal".
- fontStyleThe font style, null for default "normal".
- fontWeightThe font weight, null for default "normal".
- unicodeRangeThe unicode range, null for default "U+0-10FFFF".
- iconStyleDeclsAt least one style declaration in one or more @FontFace.
- iconsThe map of available icons, sorted by name.
- fontFilesThe font files required.
- fontFormatsThe font file formats, null entries when not found.
- fontQueriesThe font files queries, null entries when not found.
- fontLocalsThe font files locals, null entries when not found (can be comma separated).
 
- Method Details- buildFromTTFpublic static int buildFromTTF- (CSSFontDefinition fd, File file) throws IOException, FontFormatException Builds the icons that are available in the TrueType font file as defined characters between ASCII 32 and less than 65535.- Parameters:
- fd- The font definition.
- file- The TrueType font file (*.ttf).
- Returns:
- count of icons found.
- Throws:
- IOException- For I/O errors.
- FontFormatException- For TrueType font format errors.
 
- parsepublic static List<CSSFontDefinition> parse- (File file, ArrayList<String> warnings, boolean doIcons) throws IOException Processes a CSS file from a file.- Parameters:
- file- The CSS file.
- warnings- Warnings array that gets filled in, null for none.
- doIcons- Parse the icons flag.
- Returns:
- The font definition.
- Throws:
- IOException- For I/O or parser errors.
 
- parsepublic static List<CSSFontDefinition> parse- (CSSRuleList list, ArrayList<String> warnings, File dir, boolean doIcons) throws IOException Parses all fond definitions found in a style sheet.- Parameters:
- list- The CSS rules list.
- warnings- Warnings array that gets filled in, null for none.
- dir- The directory of the CSS file.
- doIcons- Parse the icons flag.
- Throws:
- IOException- If the CSS definitions cannot be processed or a font definition is not found
 
- getRequiredFontFilesGets the font files required, relative the CSS document URL.- Returns:
- A list of files from the 'src' declarations.
 
- getRequireFontFileNamesGets the file names to copy in absolute paths.
- getIconCSSGets the icon CSS declaration string.
- initializeFontFilesCreates the font files definition.