Package org.zkoss.poi.ss.usermodel

Examples of org.zkoss.poi.ss.usermodel.Font


 
  public static void setFontUnderline(Worksheet sheet,int row,int col, byte underline){
    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final Book book = (Book) sheet.getWorkbook();
    final short fontIdx = cell.getCellStyle().getFontIndex();
    final Font font = book.getFontAt(fontIdx);
    final byte orgUnderline = font.getUnderline();
    if (orgUnderline == underline) { //no change, skip
      return;
    }
    final short boldWeight = font.getBoldweight();
    final Color color = BookHelper.getFontColor(book, font);
    final short fontHeight = font.getFontHeight();
    final String name = font.getFontName();
    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
    final CellStyle style = cloneCellStyle(cell);
    style.setFont(newFont);
    cell.setCellStyle(style);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.usermodel.Font

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.