/** * Finds a font that matches the one with the supplied attributes, * where color is the indexed-value, not the actual color. */ public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { if ( (font.getBold() == bold) && font.getColor() == color && font.getFontHeight() == fontHeight && font.getFontName().equals(name) && font.getItalic() == italic && font.getStrikeout() == strikeout && font.getTypeOffset() == typeOffset && font.getUnderline() == underline) { return font; } } return null; }
System.out.println("Font FontHeight : " + font.getFontHeight());
/** * Finds a font that matches the one with the supplied attributes, * where color is the actual Color-value, not the indexed color */ public XSSFFont findFont(boolean bold, Color color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { if ( (font.getBold() == bold) && font.getXSSFColor().equals(color) && font.getFontHeight() == fontHeight && font.getFontName().equals(name) && font.getItalic() == italic && font.getStrikeout() == strikeout && font.getTypeOffset() == typeOffset && font.getUnderline() == underline) { return font; } } return null; }
/** * @see #getFontHeight() */ public short getFontHeightInPoints() { return (short)(getFontHeight()/20); }
/** * Finds a font that matches the one with the supplied attributes */ public XSSFFont findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { if ( (font.getBoldweight() == boldWeight) && font.getColor() == color && font.getFontHeight() == fontHeight && font.getFontName().equals(name) && font.getItalic() == italic && font.getStrikeout() == strikeout && font.getTypeOffset() == typeOffset && font.getUnderline() == underline) { return font; } } return null; } }
/** * Finds a font that matches the one with the supplied attributes, * where color is the indexed-value, not the actual color. */ public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { if ( (font.getBold() == bold) && font.getColor() == color && font.getFontHeight() == fontHeight && font.getFontName().equals(name) && font.getItalic() == italic && font.getStrikeout() == strikeout && font.getTypeOffset() == typeOffset && font.getUnderline() == underline) { return font; } } return null; }
/** * Finds a font that matches the one with the supplied attributes, * where color is the actual Color-value, not the indexed color */ public XSSFFont findFont(boolean bold, Color color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { for (XSSFFont font : fonts) { if ( (font.getBold() == bold) && font.getXSSFColor().equals(color) && font.getFontHeight() == fontHeight && font.getFontName().equals(name) && font.getItalic() == italic && font.getStrikeout() == strikeout && font.getTypeOffset() == typeOffset && font.getUnderline() == underline) { return font; } } return null; }
fontNew.setColor(fontOld.getColor()); fontNew.setFontName(fontOld.getFontName()); fontNew.setFontHeight(fontOld.getFontHeight()); fontNew.setItalic(fontOld.getItalic()); fontNew.setStrikeout(fontOld.getStrikeout());
int fontSize=font.getFontHeight()/20; style.setFontSize(fontSize); BorderStyle borderStyle=cellStyle.getBorderLeftEnum();