Class SvgTextProperties
- java.lang.Object
-
- com.itextpdf.svg.utils.SvgTextProperties
-
public class SvgTextProperties extends java.lang.Object
This class representstext
andtspan
SVG elements properties identifying their graphics state. Created for internal usage.
-
-
Field Summary
Fields Modifier and Type Field Description private float[]
dashArray
private float
dashPhase
private Color
fillColor
private float
fillOpacity
private float
lineWidth
private Color
strokeColor
private float
strokeOpacity
private java.util.List<Underline>
textDecoration
-
Constructor Summary
Constructors Constructor Description SvgTextProperties()
Creates newSvgTextProperties
instance.SvgTextProperties(SvgTextProperties textProperties)
Creates copy of the providedSvgTextProperties
instance.
-
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.float
getDashPhase()
Gets dash phase part of the dash pattern to be used when paths are stroked.Color
getFillColor()
Gets text fill color.float
getFillOpacity()
Gets text fill opacity.float
getLineWidth()
Gets text line (or stroke) width.Color
getStrokeColor()
Gets text stroke color.float
getStrokeOpacity()
Gets text stroke opacity.java.util.List<Underline>
getTextDecoration()
Gets the list ofUnderline
values representing text-decoration horizontal lines that can be an underline, strikethrough or overline.SvgTextProperties
setDashPattern(float[] dashArray, float dashPhase)
Sets a description of the dash pattern to be used when paths are stroked.SvgTextProperties
setFillColor(Color fillColor)
Sets text fill color.SvgTextProperties
setFillOpacity(float fillOpacity)
Sets text fill opacity.SvgTextProperties
setLineWidth(float lineWidth)
Sets text line (or stroke) width.SvgTextProperties
setStrokeColor(Color strokeColor)
Sets text stroke color.SvgTextProperties
setStrokeOpacity(float strokeOpacity)
Sets text stroke opacity.SvgTextProperties
setTextDecoration(java.util.List<Underline> underlineList)
Sets the list ofUnderline
values 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 newSvgTextProperties
instance.
-
SvgTextProperties
public SvgTextProperties(SvgTextProperties textProperties)
Creates copy of the providedSvgTextProperties
instance.- Parameters:
textProperties
-SvgTextProperties
instance 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
SvgTextProperties
instance
-
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
SvgTextProperties
instance
-
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
SvgTextProperties
instance
-
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
SvgTextProperties
instance
-
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
SvgTextProperties
instance
-
getTextDecoration
public java.util.List<Underline> getTextDecoration()
Gets the list ofUnderline
values representing text-decoration horizontal lines that can be an underline, strikethrough or overline.- Returns:
- the list of
Underline
values
-
setTextDecoration
public SvgTextProperties setTextDecoration(java.util.List<Underline> underlineList)
Sets the list ofUnderline
values representing text-decoration horizontal lines that can be an underline, strikethrough or overline.- Parameters:
underlineList
- the list ofUnderline
values to set- Returns:
- this same
SvgTextProperties
instance
-
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
SvgTextProperties
instance
-
-