You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2013/04/29 15:47:22 UTC

[Bug 54904] New: autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or 1.7.21

https://issues.apache.org/bugzilla/show_bug.cgi?id=54904

            Bug ID: 54904
           Summary: autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or
                    1.7.21
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: jens.popp@process-relations.com
    Classification: Unclassified

Since the last update of the JRE the autoSizeColumn method in
org.apache.poi.xssf.usermodel.XSSFSheet doesn't work anymore. 

It uses the method getCellWidth in org.apache.poi.ss.util.SheetUtil. This
method uses the getBounds() Method of java.awt.font.TextLayout. And this
delivers different values for JDK 1.6.43 and JDK 1.6.45

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 54904] autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or 1.7.21

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54904

--- Comment #4 from jens.popp@process-relations.com ---
To test your JRE use this bit of code. It prints the font name and a number. If
the number is 0.0 than autosize won't work for that font.


final java.awt.GraphicsEnvironment gEnv =
    java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
final String envfonts[] = gEnv.getAvailableFontFamilyNames();
for(String font : envfonts) {
    final String txt = "Test";
    final java.text.AttributedString str = new java.text.AttributedString(txt);
    str.addAttribute(java.awt.font.TextAttribute.FAMILY, font, 0,
txt.length());
    str.addAttribute(java.awt.font.TextAttribute.SIZE, (float) 14.0);
    str.addAttribute(java.awt.font.TextAttribute.WEIGHT,
java.awt.font.TextAttribute.WEIGHT_BOLD, 0, txt.length());
    final java.awt.font.FontRenderContext fontRenderContext = new
java.awt.font.FontRenderContext(null, true, true);
    final java.awt.font.TextLayout layout = new
java.awt.font.TextLayout(str.getIterator(), fontRenderContext);
    System.out.println(font + " : " + layout.getBounds().getWidth());
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 54904] autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or 1.7.21

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54904

jens.popp@process-relations.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from jens.popp@process-relations.com ---
The problem is only with the fonts Calibri and Cambria.

Exchanging the fontmanager.dll in jre/bin with an older version also solves the
problem. So it is a JRE problem with Oracle JRE 1.6.0_45 and 1.7.0_21.

I filed a bug at oracle (30.4.) but it is still invisible (at least for me)

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=9002214

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 54904] autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or 1.7.21

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54904

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
This sounds like it might be a JRE bug not a POI bug, in which case you'd need
to report it to OpenJDK or Oracle (depending on who's JRE you use)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 54904] autoSizeColumn doesn't work with new JDK/JRE 1.6.45 or 1.7.21

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54904

--- Comment #2 from anonymous <iy...@cajo.de> ---
I had the same effect. It vanished when I set the font name to "Arial"
explicitly in the CellStyle I use for the header row of my table.

...
Font font = workbook.createFont();
font.setFontName("Arial");
style.setFont(font);
...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org