protected SFont toZssFont(Font poiFont) { if (poiFont == null) return null; // ZSS-1138 SFont font = null; final short fontIndex = poiFont.getIndex(); if (importedFont.containsKey(fontIndex)) { font = importedFont.get(fontIndex); } else { font = createZssFont(poiFont); importedFont.put(fontIndex, font); // ZSS-677 } return font; }
protected SFont createZssFont(Font poiFont) { SFont font = book.createFont(true); // font font.setName(poiFont.getFontName()); font.setBoldweight(PoiEnumConversion.toBoldweight(poiFont.getBoldweight())); font.setItalic(poiFont.getItalic()); font.setStrikeout(poiFont.getStrikeout()); font.setUnderline(PoiEnumConversion.toUnderline(poiFont.getUnderline())); font.setHeightPoints(poiFont.getFontHeightInPoints()); font.setTypeOffset(PoiEnumConversion.toTypeOffset(poiFont.getTypeOffset())); font.setColor(book.createColor(BookHelper.getFontHTMLColor(workbook, poiFont))); return font; }