use of org.apache.poi.hwpf.converter.FontReplacer.Triplet in project poi by apache.
the class ExcelToFoConverter method processCellStyleFont.
protected void processCellStyleFont(HSSFWorkbook workbook, Element blockTarget, HSSFFont font) {
Triplet triplet = new Triplet();
triplet.fontName = font.getFontName();
switch(font.getBoldweight()) {
case HSSFFont.BOLDWEIGHT_BOLD:
triplet.bold = true;
break;
case HSSFFont.BOLDWEIGHT_NORMAL:
default:
triplet.bold = false;
break;
}
if (font.getItalic()) {
triplet.italic = true;
}
getFontReplacer().update(triplet);
setBlockProperties(blockTarget, triplet);
final HSSFColor fontColor = workbook.getCustomPalette().getColor(font.getColor());
if (fontColor != null)
blockTarget.setAttribute("color", ExcelToHtmlUtils.getColor(fontColor));
if (font.getFontHeightInPoints() != 0)
blockTarget.setAttribute("font-size", font.getFontHeightInPoints() + "pt");
}
Aggregations