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.FontFormatThe font format.static final intThe Constant FormatGroup.(package private) final booleanIndicates if the font is local.(package private) final StringThe source path.static final intThe Constant TypeGroup.static final intThe Constant UrlGroup.static final PatternThe UrlPattern used to compose a source path. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCssFontFaceSrc(String src, boolean isLocal, CssFontFace.FontFormat format) Instantiates a newCssFontFace.CssFontFaceSrcinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic CssFontFace.CssFontFaceSrcCreates aCssFontFace.CssFontFaceSrcobject by parsing aStringtrying to match patterns that reveal the font name, whether that font is local, and which format the font is in.Gets the font format.getSrc()Gets the source path.booleanisLocal()Checks if the font is local.static CssFontFace.FontFormatparseFormat(String formatStr) Parses aStringto a font format.toString()static StringRemoves 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.CssFontFaceSrcinstance.- 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()Checks if the font is local.- Returns:
trueif the font is local,falseotherwise
-
toString
-
create
Creates aCssFontFace.CssFontFaceSrcobject by parsing aStringtrying 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.CssFontFaceSrcobject
-
parseFormat
Parses aStringto a font format.- Parameters:
formatStr- a string- Returns:
- a font format
-
unquote
-