List of usage examples for org.apache.poi.xssf.usermodel XSSFCellStyle getFontIndex
@Override @Deprecated public short getFontIndex()
From source file:de.escnet.ExcelTable.java
License:Open Source License
private String styleFont(Map<String, String> styles, XSSFCell cell) { XSSFCellStyle cellStyle = cell.getCellStyle(); if (cellStyle != null) { short fontIndex = cellStyle.getFontIndex(); XSSFFont font = sheet.getWorkbook().getFontAt(fontIndex); if (font.getItalic()) { styles.put("font-style", "italic"); }/* w w w . j av a 2s . c om*/ if (font.getBoldweight() == Font.BOLDWEIGHT_BOLD) { styles.put("font-weight", "bold"); } styles.put("font", "" + font.getFontHeightInPoints() + "px " + font.getFontName()); if (FONT_COLORS) { String color = getHtmlColor(font.getXSSFColor()); if (color != null && !color.equals("#000000")) { return color; } } } return null; }