Class CssFontFace.CssFontFaceSrc
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.font.CssFontFace.CssFontFaceSrc
-
- Enclosing class:
- CssFontFace
public static class CssFontFace.CssFontFaceSrc extends java.lang.Object
Class that defines a font face source.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CssFontFace.FontFormat
format
The font format.static int
FormatGroup
The Constant FormatGroup.(package private) boolean
isLocal
Indicates if the font is local.(package private) java.lang.String
src
The source path.static int
TypeGroup
The Constant TypeGroup.static int
UrlGroup
The Constant UrlGroup.static java.util.regex.Pattern
UrlPattern
The UrlPattern used to compose a source path.
-
Constructor Summary
Constructors Modifier Constructor Description private
CssFontFaceSrc(java.lang.String src, boolean isLocal, CssFontFace.FontFormat format)
Instantiates a newCssFontFace.CssFontFaceSrc
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CssFontFace.CssFontFaceSrc
create(java.lang.String src)
Creates aCssFontFace.CssFontFaceSrc
object by parsing aString
trying to match patterns that reveal the font name, whether that font is local, and which format the font is in.CssFontFace.FontFormat
getFormat()
java.lang.String
getSrc()
boolean
isLocal()
static CssFontFace.FontFormat
parseFormat(java.lang.String formatStr)
Parses aString
to a font format.java.lang.String
toString()
static java.lang.String
unquote(java.lang.String quotedString)
Removes single and double quotes at the start and the end of aString
.
-
-
-
Field Detail
-
UrlPattern
public static final java.util.regex.Pattern UrlPattern
The UrlPattern used to compose a source path.
-
TypeGroup
public static final int TypeGroup
The Constant TypeGroup.- See Also:
- Constant Field Values
-
UrlGroup
public static final int UrlGroup
The Constant UrlGroup.- See Also:
- Constant Field Values
-
FormatGroup
public static final int FormatGroup
The Constant FormatGroup.- See Also:
- Constant Field Values
-
format
final CssFontFace.FontFormat format
The font format.
-
src
final java.lang.String src
The source path.
-
isLocal
final boolean isLocal
Indicates if the font is local.
-
-
Constructor Detail
-
CssFontFaceSrc
private CssFontFaceSrc(java.lang.String src, boolean isLocal, CssFontFace.FontFormat format)
Instantiates a newCssFontFace.CssFontFaceSrc
instance.- Parameters:
src
- a source pathisLocal
- indicates if the font is localformat
- the font format (true type, open type, woff,...)
-
-
Method Detail
-
getFormat
public CssFontFace.FontFormat getFormat()
-
getSrc
public java.lang.String getSrc()
-
isLocal
public boolean isLocal()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
create
public static CssFontFace.CssFontFaceSrc create(java.lang.String src)
Creates aCssFontFace.CssFontFaceSrc
object by parsing aString
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(java.lang.String formatStr)
Parses aString
to a font format.- Parameters:
formatStr
- a string- Returns:
- a font format
-
unquote
public static java.lang.String unquote(java.lang.String quotedString)
Removes single and double quotes at the start and the end of aString
.- Parameters:
quotedString
- aString
that might be between quotes- Returns:
- the
String
without the quotes
-
-