/** * 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; }
private void appendFontStyle(StringBuilder buffer, XSSFCellStyle style) { XSSFFont font = style.getFont(); buffer.append("font-size:").append(font.getFontHeightInPoints()).append("pt;"); if(font.getBold() || font.getBoldweight() == Font.BOLDWEIGHT_BOLD){ buffer.append( FONT_WEIGHT_BOLD ); } if(font.getItalic()){ buffer.append( FONT_STYLE_ITALIC ); } if(font.getUnderline() != Font.U_NONE){ buffer.append( TEXT_DECORATION_UNDERLINE ); } }
public byte getUnderline() { return cell.getCellStyle().getFont().getUnderline(); }
/** * Checks if cell under line matches. */ private void isCellUnderLineMatches(Locator loc1, Locator loc2) { // TOOO: distinguish underline type if (!(loc1.cell instanceof XSSFCell)) return; byte b1 = ((XSSFCell)loc1.cell).getCellStyle().getFont().getUnderline(); byte b2 = ((XSSFCell)loc2.cell).getCellStyle().getFont().getUnderline(); if (b1 != b2) { addMessage(loc1, loc2, CELL_FONT_ATTRIBUTES_DOES_NOT_MATCH, (b1 == 1 ? "" : "NOT ")+"UNDERLINE", (b2 == 1 ? "" : "NOT ")+"UNDERLINE" ); } } }
/** * 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.setStrikeout(fontOld.getStrikeout()); fontNew.setTypeOffset(fontOld.getTypeOffset()); fontNew.setUnderline(fontOld.getUnderline()); return fontNew;
_style.italic(); if (font.getUnderline() != FontUnderline.NONE.getByteValue()) { _style.underline();
_style.italic(); if (font.getUnderline() != FontUnderline.NONE.getByteValue()) { _style.underline();
_style.italic(); if (font.getUnderline() != FontUnderline.NONE.getByteValue()) { _style.underline();
style.setItalic(true); if(font.getUnderline()!=Font.U_NONE){ style.setUnderline(true);