Files changed (5)
+The ```LineBreakMeasurerTest``` application provokes a contract violation in the Oracle implementation of ```java.awt.font.TextMeasurer#getLineBreakIndex(int, float)```. The method escapes with a ```java.lang.ArrayIndexOutOfBoundsException``` where [the JavaDoc only mentions](http://docs.oracle.com/javase/6/docs/api/java/awt/font/TextMeasurer.html#getLineBreakIndex(int, float\)) that it might escape with a ```java.lang.IllegalArgumentException```. The exception originates from ```sun.font.ExtendedTextSourceLabel.createCharinfo()```, and is only provoked for the ```Calibri```, ```Calibri Bold```, ```Calibri Bold Italic```, ```Calibri Italic``` and ```Cambria Bold``` fonts on the 1.6.0u45 and 1.7.0u21 JVMs for Windows.
+```LineBreakMeasurerTest``` will try to calculate a ```TextLayout``` on a given canvas for all available fonts, ```java.awt.GraphicsEnvironment#getLocalGraphicsEnvironment()#getAllFonts()```, thus provoking the issue for the above mentioned fonts. You can prepare it with ```mkdir -p target/classes;cp src/main/resources/run.bat target/classes;javac src/main/java/LineBreakMeasurerTest.java -d target/classes``` or use [Maven 3](http://maven.apache.org/download.cgi), e.g. ```mvn package```, and then execute it via ```java -cp target\classes LineBreakMeasurerTest``` with your default JVM. The script ```target\classes\run.bat jdk1.7.0_21``` makes it easier to run the program against several JVM installations, assuming that they are installed under ```C:\Program Files\Java\``` and where ```jdk1.7.0_21``` denotes the subdirectory of the JVM to be used.
+Unfortunately, 1.6.0u45 was the last public update since 6 is now EOL. I couldn't get hold off the [1.6.0u51](http://en.wikipedia.org/wiki/Java_version_history#cite_ref-6u51_79-0) JVM as it is only available through the Java SE Support program. Given that the issue is fixed in 1.7.0u25, I assume it's fixed in 1.6.0u51 as well as they [share the same baseline](http://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html). 1.6.0u45 and 1.7.0u21 were [both released on 2013-04-16](http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29), so I assume that what has happened is that the regression was introduced on the 6 branch and then merged upstream for the 7 release. The issue must have been identified or fixed by accident internally given that I could not find any relevant bug report or public documentation for the involved frames.
+```LineBreakMeasurerTest``` succeeds in the ```TextLayout``` calculation for all fonts, including the above mentioned ones, on
+The problem was originally hit by the viewfile macro from [Confluence's Office Connector](https://confluence.atlassian.com/display/DOC/Embedding+PowerPoint+Presentations+in+a+Page) using a PowerPoint presentation (.ppt) containing text in the Calibri font. The stack trace looked like this
+2013-07-23 11:02:05,493 ERROR [DefaultSlideCacheManager:thread-3] [com.benryan.conversion.AbstractSlideConversionTask] call problem while converting testing.pptx
+ -- url: /confluence/plugins/servlet/pptslide | userName: admin | referer: http://localhost:1990/confluence/s/en_GB/3280/1/2.1.4/_/download/resources/com.atlassian.confluence.extra.officeconnector:pptslideservlet/co
+ at com.benryan.conversion.PPtDocumentConversionTask.convertFile(PPtDocumentConversionTask.java:54)
+ at com.benryan.conversion.PPtDocumentConversionTask.convertFile(PPtDocumentConversionTask.java:15)
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ Graphics2D canvas = (Graphics2D) new BufferedImage(960, 720, BufferedImage.TYPE_INT_RGB).getGraphics();
+ LineBreakMeasurer measurer = new LineBreakMeasurer(testString.getIterator(), canvas.getFontRenderContext());
+ System.err.println(String.format("ERROR: Layout calculation escaped with [%s] for font %s", e.getClass().getName(), font));