Class CSSFontDefinition

java.lang.Object
com.iizigo.font.CSSFontDefinition

public class CSSFontDefinition extends Object
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 Details Link icon

    • fontFamily Link icon

      public final String fontFamily
      The font family.
    • fontStretch Link icon

      public final String fontStretch
      The font stretch, null for default "normal".
    • fontStyle Link icon

      public final String fontStyle
      The font style, null for default "normal".
    • fontWeight Link icon

      public final String fontWeight
      The font weight, null for default "normal".
    • unicodeRange Link icon

      public final String unicodeRange
      The unicode range, null for default "U+0-10FFFF".
    • iconStyleDecls Link icon

      public final ArrayList<String> iconStyleDecls
      At least one style declaration in one or more @FontFace.
    • icons Link icon

      public final LinkedHashMap<String,CSSFontIcon> icons
      The map of available icons, sorted by name.
    • fontFiles Link icon

      public final ArrayList<File> fontFiles
      The font files required.
    • fontFormats Link icon

      public final ArrayList<FontFormat> fontFormats
      The font file formats, null entries when not found.
    • fontQueries Link icon

      public final ArrayList<String> fontQueries
      The font files queries, null entries when not found.
    • fontLocals Link icon

      public final ArrayList<String> fontLocals
      The font files locals, null entries when not found (can be comma separated).
  • Method Details Link icon

    • buildFromTTF Link icon

      public 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.
    • parse Link icon

      public 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.
    • parse Link icon

      public 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
    • getRequiredFontFiles Link icon

      public List<File> getRequiredFontFiles()
      Gets the font files required, relative the CSS document URL.
      Returns:
      A list of files from the 'src' declarations.
    • getRequireFontFileNames Link icon

      public String[] getRequireFontFileNames()
      Gets the file names to copy in absolute paths.
    • getIconCSS Link icon

      public String getIconCSS()
      Gets the icon CSS declaration string.
    • initializeFontFiles Link icon

      public void initializeFontFiles(EditorFontFiles ff, String baseRef)
      Creates the font files definition.