@Test public void rotatedText() throws Exception { Workbook workbook = _testDataProvider.createWorkbook(); fixFonts(workbook); Sheet sheet = workbook.createSheet(); Row row = sheet.createRow(0); CellStyle style1 = workbook.createCellStyle(); style1.setRotation((short) 90); Cell cell0 = row.createCell(0); cell0.setCellValue("Apache Software Foundation"); cell0.setCellStyle(style1); Cell cell1 = row.createCell(1); cell1.setCellValue("Apache Software Foundation"); for (int i = 0; i < 2; i++) sheet.autoSizeColumn(i); int w0 = sheet.getColumnWidth(0); int w1 = sheet.getColumnWidth(1); assertTrue( w0 * 5 < w1); // rotated text occupies at least five times less horizontal space than normal // text workbook.close(); }