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