public class CSSFontDefinition extends Object
The following CSS can be parsed: - FontAwsome - IcoMoon - Iconic (https://useiconic.com/open/)
Modifier and Type | Field and Description |
---|---|
String |
fontFamily
The font family.
|
ArrayList<File> |
fontFiles
The font files required.
|
ArrayList<FontFormat> |
fontFormats
The font file formats, null entries when not found.
|
ArrayList<String> |
fontLocals
The font files locals, null entries when not found (can be comma separated).
|
ArrayList<String> |
fontQueries
The font files queries, null entries when not found.
|
String |
fontStretch
The font stretch, null for default "normal".
|
String |
fontStyle
The font style, null for default "normal".
|
String |
fontWeight
The font weight, null for default "normal".
|
LinkedHashMap<String,CSSFontIcon> |
icons
The map of available icons, sorted by name.
|
ArrayList<String> |
iconStyleDecls
At least one style declaration in one or more @FontFace.
|
String |
unicodeRange
The unicode range, null for default "U+0-10FFFF".
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getIconCSS()
Gets the icon CSS declaration string.
|
List<File> |
getRequiredFontFiles()
Gets the font files required, relative the CSS document URL.
|
String[] |
getRequireFontFileNames()
Gets the file names to copy in absolute paths.
|
void |
initializeFontFiles(EditorFontFiles ff,
String baseRef)
Creates the font files definition.
|
static void |
main(String[] args)
Stand-alone parsing of a CSS file for icons with output to stdout.
|
static List<CSSFontDefinition> |
parse(org.w3c.dom.css.CSSRuleList list,
ArrayList<String> warnings,
File dir,
boolean doIcons)
Parses all fond definitions found in a style sheet.
|
static List<CSSFontDefinition> |
parse(File file,
ArrayList<String> warnings,
boolean doIcons)
Processes a CSS file from a file.
|
public final String fontFamily
public final String fontStretch
public final String fontStyle
public final String fontWeight
public final String unicodeRange
public final ArrayList<String> iconStyleDecls
public final LinkedHashMap<String,CSSFontIcon> icons
public final ArrayList<FontFormat> fontFormats
public final ArrayList<String> fontQueries
public static void main(String[] args)
public static int buildFromTTF(CSSFontDefinition fd, File file) throws IOException, FontFormatException
fd
- The font definition.file
- The TrueType font file (*.ttf).IOException
- For I/O errors.FontFormatException
- For TrueType font format errors.public static List<CSSFontDefinition> parse(File file, ArrayList<String> warnings, boolean doIcons) throws IOException
file
- The CSS file.warnings
- Warnings array that gets filled in, null for none.doIcons
- Parse the icons flag.IOException
- For I/O or parser errors.public static List<CSSFontDefinition> parse(org.w3c.dom.css.CSSRuleList list, ArrayList<String> warnings, File dir, boolean doIcons) throws IOException
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.IOException
- If the CSS definitions cannot be processed or a font definition is not foundpublic List<File> getRequiredFontFiles()
public String[] getRequireFontFileNames()
public String getIconCSS()
public void initializeFontFiles(EditorFontFiles ff, String baseRef)
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.