Class CssFontFace.CssFontFaceSrc
java.lang.Object
com.itextpdf.styledxmlparser.css.font.CssFontFace.CssFontFaceSrc
- Enclosing class:
CssFontFace
Class that defines a font face source.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CssFontFace.FontFormat
The font format.static final int
The Constant FormatGroup.(package private) final boolean
Indicates if the font is local.(package private) final String
The source path.static final int
The Constant TypeGroup.static final int
The Constant UrlGroup.static final Pattern
The UrlPattern used to compose a source path. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CssFontFaceSrc
(String src, boolean isLocal, CssFontFace.FontFormat format) Instantiates a newCssFontFace.CssFontFaceSrc
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic CssFontFace.CssFontFaceSrc
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.getSrc()
boolean
isLocal()
static CssFontFace.FontFormat
parseFormat
(String formatStr) Parses aString
to a font format.toString()
static String
Removes single and double quotes at the start and the end of aString
.
-
Field Details
-
UrlPattern
The UrlPattern used to compose a source path. -
TypeGroup
public static final int TypeGroupThe Constant TypeGroup.- See Also:
-
UrlGroup
public static final int UrlGroupThe Constant UrlGroup.- See Also:
-
FormatGroup
public static final int FormatGroupThe Constant FormatGroup.- See Also:
-
format
The font format. -
src
The source path. -
isLocal
final boolean isLocalIndicates if the font is local.
-
-
Constructor Details
-
CssFontFaceSrc
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 Details
-
getFormat
-
getSrc
-
isLocal
public boolean isLocal() -
toString
-
create
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
Parses aString
to a font format.- Parameters:
formatStr
- a string- Returns:
- a font format
-
unquote
Removes single and double quotes at the start and the end of aString
.
-