diff --git a/build.xml b/build.xml index 73ebd5de2..512a15b3a 100644 --- a/build.xml +++ b/build.xml @@ -89,7 +89,7 @@ - + diff --git a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java index 58aaee8d7..546978814 100644 --- a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java +++ b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java @@ -269,9 +269,9 @@ public class EscherGraphics excelFont = new Font( font.getName(), font.getStyle(), (int) ( font.getSize() / verticalPixelsPerPoint )); } FontDetails d = StaticFontMetrics.getFontDetails( excelFont ); - int width = (int) ( (d.getStringWidth( str ) * 2.5) + 12 ); - int height = (int) ( ( font.getSize() * 2.0 * verticalPixelsPerPoint ) + 6 ); - y -= ( font.getSize() * verticalPixelsPerPoint ); // we want to draw the shape from the top-left + int width = (int) ( (d.getStringWidth( str ) * 8) + 12 ); + int height = (int) ( ( font.getSize() / verticalPixelsPerPoint ) + 6 ) * 2; + y -= ( font.getSize() / verticalPixelsPerPoint ) + 2 * verticalPixelsPerPoint; // we want to draw the shape from the top-left HSSFTextbox textbox = escherGroup.createTextbox( new HSSFChildAnchor( x, y, x + width, y + height ) ); textbox.setNoFill( true ); textbox.setLineStyle( HSSFShape.LINESTYLE_NONE );