Class CssFontFace.CssFontFaceSrc
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.font.CssFontFace.CssFontFaceSrc
-
- Enclosing class:
- CssFontFace
public static class CssFontFace.CssFontFaceSrc extends java.lang.ObjectClass that defines a font face source.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CssFontFace.FontFormatformatThe font format.static intFormatGroupThe Constant FormatGroup.(package private) booleanisLocalIndicates if the font is local.(package private) java.lang.StringsrcThe source path.static intTypeGroupThe Constant TypeGroup.static intUrlGroupThe Constant UrlGroup.static java.util.regex.PatternUrlPatternThe UrlPattern used to compose a source path.
-
Constructor Summary
Constructors Modifier Constructor Description privateCssFontFaceSrc(java.lang.String src, boolean isLocal, CssFontFace.FontFormat format)Instantiates a newCssFontFace.CssFontFaceSrcinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CssFontFace.CssFontFaceSrccreate(java.lang.String src)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.CssFontFace.FontFormatgetFormat()Gets the font format.java.lang.StringgetSrc()Gets the source path.booleanisLocal()Checks if the font is local.static CssFontFace.FontFormatparseFormat(java.lang.String formatStr)Parses aStringto a font format.java.lang.StringtoString()static java.lang.Stringunquote(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.CssFontFaceSrcinstance.- 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()
Gets the font format.- Returns:
- the font format
-
getSrc
public java.lang.String getSrc()
Gets the source path.- Returns:
- the source path
-
isLocal
public boolean isLocal()
Checks if the font is local.- Returns:
trueif the font is local,falseotherwise
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
create
public static CssFontFace.CssFontFaceSrc create(java.lang.String src)
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
public static CssFontFace.FontFormat parseFormat(java.lang.String formatStr)
Parses aStringto 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- aStringthat might be between quotes- Returns:
- the
Stringwithout the quotes
-
-