public class Underline extends Object
Property.UNDERLINE
Modifier and Type | Field and Description |
---|---|
protected int |
lineCapStyle |
protected float |
thickness |
protected float |
thicknessMul |
protected TransparentColor |
transparentColor |
protected float |
yPosition |
protected float |
yPositionMul |
Constructor and Description |
---|
Underline(Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
Creates an Underline.
|
Underline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
Creates an Underline.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor()
Gets the color of the underline.
|
int |
getLineCapStyle()
Gets the PdfCanvasConstants.LineCapStyle of the text underline.
|
float |
getOpacity()
Gets the opacity of the underline color.
|
float |
getThickness(float fontSize)
Gets the total thickness of the underline (fixed + variable part).
|
float |
getYPosition(float fontSize)
Gets the vertical position of the underline (fixed + variable part).
|
float |
getYPositionMul()
Gets the multiplier for the vertical positioning of the text underline.
|
protected TransparentColor transparentColor
protected float thickness
protected float thicknessMul
protected float yPosition
protected float yPositionMul
protected int lineCapStyle
public Underline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
thicknessMul
to 0; if you want a thickness solely dependent on the font size, set thickness
to 0. Mutatis mutandis for the y-position.
color
- the Color
of the underline
thickness
- a float defining the minimum thickness in points of the underline
thicknessMul
- a float defining the font size dependent component of the thickness of the underline
yPosition
- a float defining the default absolute vertical distance in points from the text's base line
yPositionMul
- a float defining the font size dependent component of the vertical positioning of the underline
lineCapStyle
- the way the underline finishes at its edges. PdfCanvasConstants.LineCapStyle
public Underline(Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
thicknessMul
to 0; if you want a thickness solely dependent on the font size, set thickness
to 0. Mutatis mutandis for the y-position.
color
- the Color
of the underline
opacity
- a float defining the opacity of the underline; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
thickness
- a float defining the minimum thickness in points of the underline
thicknessMul
- a float defining the font size dependent component of the thickness of the underline
yPosition
- a float defining the default absolute vertical distance in points from the text's base line
yPositionMul
- a float defining the font size dependent component of the vertical positioning of the underline
lineCapStyle
- the way the underline finishes at its edges. PdfCanvasConstants.LineCapStyle
public float getOpacity()
public float getThickness(float fontSize)
fontSize
- the font size for which to calculate the variable thickness
float
, in points
public float getYPosition(float fontSize)
fontSize
- the font size for which to calculate the variable position
float
, in points
public float getYPositionMul()
float
public int getLineCapStyle()
PdfCanvasConstants.LineCapStyle
of the text underline.
int
referring to the values of PdfCanvasConstants.LineCapStyle
Copyright © 1998–2018 iText Group NV. All rights reserved.