Class SvgTextProperties
- java.lang.Object
-
- com.itextpdf.svg.utils.SvgTextProperties
-
public class SvgTextProperties extends java.lang.ObjectThis class representstextandtspanSVG elements properties identifying their graphics state. Created for internal usage.
-
-
Field Summary
Fields Modifier and Type Field Description private float[]dashArrayprivate floatdashPhaseprivate ColorfillColorprivate floatfillOpacityprivate floatlineWidthprivate ColorstrokeColorprivate floatstrokeOpacityprivate java.util.List<Underline>textDecoration
-
Constructor Summary
Constructors Constructor Description SvgTextProperties()Creates newSvgTextPropertiesinstance.SvgTextProperties(SvgTextProperties textProperties)Creates copy of the providedSvgTextPropertiesinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]getDashArray()Gets dash array part of the dash pattern to be used when paths are stroked.floatgetDashPhase()Gets dash phase part of the dash pattern to be used when paths are stroked.ColorgetFillColor()Gets text fill color.floatgetFillOpacity()Gets text fill opacity.floatgetLineWidth()Gets text line (or stroke) width.ColorgetStrokeColor()Gets text stroke color.floatgetStrokeOpacity()Gets text stroke opacity.java.util.List<Underline>getTextDecoration()Gets the list ofUnderlinevalues representing text-decoration horizontal lines that can be an underline, strikethrough or overline.SvgTextPropertiessetDashPattern(float[] dashArray, float dashPhase)Sets a description of the dash pattern to be used when paths are stroked.SvgTextPropertiessetFillColor(Color fillColor)Sets text fill color.SvgTextPropertiessetFillOpacity(float fillOpacity)Sets text fill opacity.SvgTextPropertiessetLineWidth(float lineWidth)Sets text line (or stroke) width.SvgTextPropertiessetStrokeColor(Color strokeColor)Sets text stroke color.SvgTextPropertiessetStrokeOpacity(float strokeOpacity)Sets text stroke opacity.SvgTextPropertiessetTextDecoration(java.util.List<Underline> underlineList)Sets the list ofUnderlinevalues representing text-decoration horizontal lines that can be an underline, strikethrough or overline.
-
-
-
Field Detail
-
fillColor
private Color fillColor
-
strokeColor
private Color strokeColor
-
fillOpacity
private float fillOpacity
-
strokeOpacity
private float strokeOpacity
-
dashArray
private float[] dashArray
-
dashPhase
private float dashPhase
-
lineWidth
private float lineWidth
-
textDecoration
private java.util.List<Underline> textDecoration
-
-
Constructor Detail
-
SvgTextProperties
public SvgTextProperties()
Creates newSvgTextPropertiesinstance.
-
SvgTextProperties
public SvgTextProperties(SvgTextProperties textProperties)
Creates copy of the providedSvgTextPropertiesinstance.- Parameters:
textProperties-SvgTextPropertiesinstance to copy
-
-
Method Detail
-
getStrokeColor
public Color getStrokeColor()
Gets text stroke color.- Returns:
- stroke color
-
setStrokeColor
public SvgTextProperties setStrokeColor(Color strokeColor)
Sets text stroke color.- Parameters:
strokeColor- stroke color to set- Returns:
- this same
SvgTextPropertiesinstance
-
getFillColor
public Color getFillColor()
Gets text fill color.- Returns:
- fill color
-
setFillColor
public SvgTextProperties setFillColor(Color fillColor)
Sets text fill color.- Parameters:
fillColor- fill color to set- Returns:
- this same
SvgTextPropertiesinstance
-
getLineWidth
public float getLineWidth()
Gets text line (or stroke) width.- Returns:
- text line width
-
setLineWidth
public SvgTextProperties setLineWidth(float lineWidth)
Sets text line (or stroke) width.- Parameters:
lineWidth- text line width- Returns:
- this same
SvgTextPropertiesinstance
-
getStrokeOpacity
public float getStrokeOpacity()
Gets text stroke opacity.- Returns:
- stroke opacity
-
setStrokeOpacity
public SvgTextProperties setStrokeOpacity(float strokeOpacity)
Sets text stroke opacity.- Parameters:
strokeOpacity- stroke opacity to set- Returns:
- this same
SvgTextPropertiesinstance
-
getFillOpacity
public float getFillOpacity()
Gets text fill opacity.- Returns:
- fill opacity
-
setFillOpacity
public SvgTextProperties setFillOpacity(float fillOpacity)
Sets text fill opacity.- Parameters:
fillOpacity- fill opacity to set- Returns:
- this same
SvgTextPropertiesinstance
-
getTextDecoration
public java.util.List<Underline> getTextDecoration()
Gets the list ofUnderlinevalues representing text-decoration horizontal lines that can be an underline, strikethrough or overline.- Returns:
- the list of
Underlinevalues
-
setTextDecoration
public SvgTextProperties setTextDecoration(java.util.List<Underline> underlineList)
Sets the list ofUnderlinevalues representing text-decoration horizontal lines that can be an underline, strikethrough or overline.- Parameters:
underlineList- the list ofUnderlinevalues to set- Returns:
- this same
SvgTextPropertiesinstance
-
getDashArray
public float[] getDashArray()
Gets dash array part of the dash pattern to be used when paths are stroked. Default value is solid line.The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is an integer.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
- Returns:
- float dash array
-
getDashPhase
public float getDashPhase()
Gets dash phase part of the dash pattern to be used when paths are stroked. Default value is solid line.The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is an integer.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
- Returns:
- float dash array
-
setDashPattern
public SvgTextProperties setDashPattern(float[] dashArray, float dashPhase)
Sets a description of the dash pattern to be used when paths are stroked. Default value is solid line.The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is a number.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
- Parameters:
dashArray- dash arraydashPhase- dash phase value- Returns:
- this same
SvgTextPropertiesinstance
-
-