|
|
|
@ -103,6 +103,10 @@ public class PdfChunk {
|
|
|
|
|
return height; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public float getTextDescent() { |
|
|
|
|
return textDescent; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setHeight(float height) { |
|
|
|
|
this.height = height; |
|
|
|
|
} |
|
|
|
@ -112,6 +116,8 @@ public class PdfChunk {
|
|
|
|
|
|
|
|
|
|
private float height = 0; |
|
|
|
|
|
|
|
|
|
private float textDescent = 0; |
|
|
|
|
|
|
|
|
|
private IndentAttribute indent = new IndentAttribute(); |
|
|
|
|
|
|
|
|
|
public Map<String, String> background ; |
|
|
|
@ -228,6 +234,7 @@ public class PdfChunk {
|
|
|
|
|
if (splitCharacter == null) |
|
|
|
|
splitCharacter = DefaultSplitCharacter.DEFAULT; |
|
|
|
|
this.height = other.getHeight(); |
|
|
|
|
this.textDescent = other.getTextDescent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -240,6 +247,7 @@ public class PdfChunk {
|
|
|
|
|
public PdfChunk(Chunk chunk, PdfAction action) { |
|
|
|
|
thisChunk[0] = this; |
|
|
|
|
value = chunk.getContent(); |
|
|
|
|
|
|
|
|
|
updateBreakTag(); |
|
|
|
|
Font f = chunk.getFont(); |
|
|
|
|
float size = f.getSize(); |
|
|
|
@ -278,7 +286,9 @@ public class PdfChunk {
|
|
|
|
|
int fontSize = (int) (f.getSize() * FONT_SCALE * (getTextRise() != 0 ? SUB_PERCENT : 1)); |
|
|
|
|
FontMetrics metrics = FontDesignMetrics.getMetrics(new java.awt.Font(f.getFontName(), f.getStyle(), fontSize)); |
|
|
|
|
font = new PdfFont(f, f.getSize()); |
|
|
|
|
|
|
|
|
|
height = metrics.getHeight() / FONT_SCALE + indent.getTop() + indent.getBottom(); |
|
|
|
|
textDescent = metrics.getDescent() / FONT_SCALE; |
|
|
|
|
if (f.isUnderlined()) { |
|
|
|
|
Object obj[] = {null, new float[]{0, 1f / 15, 0, -1f / 3, 0}}; |
|
|
|
|
Object unders[][] = Utilities.addToArray((Object[][])attributes.get(Chunk.UNDERLINE), obj); |
|
|
|
|