Class CssFontFace.CssFontFaceSrc

java.lang.Object
com.itextpdf.styledxmlparser.css.font.CssFontFace.CssFontFaceSrc
Enclosing class:
CssFontFace

public static class CssFontFace.CssFontFaceSrc extends Object
Class that defines a font face source.
  • Field Details

    • UrlPattern

      public static final Pattern UrlPattern
      The UrlPattern used to compose a source path.
    • TypeGroup

      public static final int TypeGroup
      The Constant TypeGroup.
      See Also:
    • UrlGroup

      public static final int UrlGroup
      The Constant UrlGroup.
      See Also:
    • FormatGroup

      public static final int FormatGroup
      The Constant FormatGroup.
      See Also:
  • Method Details

    • getFormat

      public CssFontFace.FontFormat getFormat()
      Gets the font format.
      Returns:
      the font format
    • getSrc

      public String getSrc()
      Gets the source path.
      Returns:
      the source path
    • isLocal

      public boolean isLocal()
      Checks if the font is local.
      Returns:
      true if the font is local, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • create

      public static CssFontFace.CssFontFaceSrc create (String src)
      Creates a CssFontFace.CssFontFaceSrc object by parsing a String trying to match patterns that reveal the font name, whether that font is local, and which format the font is in.
      Parameters:
      src - a string containing information about a font
      Returns:
      the font in the form of a CssFontFace.CssFontFaceSrc object
    • parseFormat

      public static CssFontFace.FontFormat parseFormat (String formatStr)
      Parses a String to a font format.
      Parameters:
      formatStr - a string
      Returns:
      a font format
    • unquote

      public static String unquote (String quotedString)
      Removes single and double quotes at the start and the end of a String.
      Parameters:
      quotedString - a String that might be between quotes
      Returns:
      the String without the quotes