|
|
|
@ -50,6 +50,7 @@
|
|
|
|
|
package com.fr.third.v2.lowagie.text; |
|
|
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.FontMetrics; |
|
|
|
|
import java.net.URL; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
@ -59,6 +60,7 @@ import com.fr.third.v2.lowagie.text.pdf.PdfAction;
|
|
|
|
|
import com.fr.third.v2.lowagie.text.pdf.PdfAnnotation; |
|
|
|
|
import com.fr.third.v2.lowagie.text.pdf.PdfContentByte; |
|
|
|
|
import com.fr.third.v2.lowagie.text.pdf.draw.DrawInterface; |
|
|
|
|
import sun.font.FontDesignMetrics; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This is the smallest significant part of text that can be added to a |
|
|
|
@ -394,9 +396,9 @@ public class Chunk implements Element {
|
|
|
|
|
if (getImage() != null) { |
|
|
|
|
return getImage().getScaledWidth(); |
|
|
|
|
} |
|
|
|
|
return font.getCalculatedBaseFont(true).getWidthPoint(getContent(), |
|
|
|
|
font.getCalculatedSize()) |
|
|
|
|
* getHorizontalScaling(); |
|
|
|
|
java.awt.Font awtFont = new java.awt.Font(font.getFontName(), font.getStyle(), (int)font.getSize()); |
|
|
|
|
FontMetrics metrics = FontDesignMetrics.getMetrics(awtFont); |
|
|
|
|
return metrics.stringWidth(getContent())* getHorizontalScaling(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// attributes
|
|
|
|
|