org.apache.poi.ss.usermodel.CellStyle.getFontIndexAsInt()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(380)

本文整理了Java中org.apache.poi.ss.usermodel.CellStyle.getFontIndexAsInt()方法的一些代码示例,展示了CellStyle.getFontIndexAsInt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CellStyle.getFontIndexAsInt()方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.CellStyle
类名称:CellStyle
方法名:getFontIndexAsInt

CellStyle.getFontIndexAsInt介绍

[英]gets the index of the font for this style
[中]获取此样式的字体索引

代码示例

代码示例来源:origin: org.apache.poi/poi

cellType = cell.getCachedFormulaResultType();
Font font = wb.getFontAt(style.getFontIndexAsInt());

代码示例来源:origin: org.apache.poi/poi

put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
put(properties, FONT, style.getFontIndexAsInt());
put(properties, HIDDEN, style.getHidden());
put(properties, INDENTION, style.getIndention());

代码示例来源:origin: org.apache.poi/poi-examples

private void fontStyle(CellStyle style) {
  Font font = wb.getFontAt(style.getFontIndexAsInt());
  if (font.getBold()) {
    out.format("  font-weight: bold;%n");
  }
  if (font.getItalic()) {
    out.format("  font-style: italic;%n");
  }
  int fontheight = font.getFontHeightInPoints();
  if (fontheight == 9) {
    //fix for stupid ol Windows
    fontheight = 10;
  }
  out.format("  font-size: %dpt;%n", fontheight);
  // Font color is handled with the other colors
}

代码示例来源:origin: openl-tablets/openl-tablets

@Override
public ICellFont getFont(int row, int column) {
  Font font = workbook.getFontAt(getCell(row, column).getCellStyle().getFontIndexAsInt());
  return new XlsCellFont(font, workbook);
}

代码示例来源:origin: openl-tablets/openl-tablets

public static Font getCellFont(Cell cell) {
  Font font = null;
  if (cell != null) {
    CellStyle style = cell.getCellStyle();
    int fontIndex = style.getFontIndexAsInt();
    font = cell.getSheet().getWorkbook().getFontAt(fontIndex);
  }
  return font;
}

代码示例来源:origin: org.apache.poi/poi-examples

System.out.print("BG=" + renderColor(style.getFillBackgroundColorColor()) + " ");
Font font = wb.getFontAt(style.getFontIndexAsInt());
System.out.print("Font=" + font.getFontName() + " ");
System.out.print("FontColor=");

代码示例来源:origin: openl-tablets/openl-tablets

public ICellFont getFont() {
  Cell cell = getCell();
  if (cell == null) return null;
  Font font = gridModel.getSheetSource().getSheet().getWorkbook().getFontAt(cell.getCellStyle().getFontIndexAsInt());
  return new XlsCellFont(font, gridModel.getSheetSource().getSheet().getWorkbook());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

cellType = cell.getCachedFormulaResultType();
Font font = wb.getFontAt(style.getFontIndexAsInt());

代码示例来源:origin: apache/metamodel

final int fontIndex = cellStyle.getFontIndexAsInt();
final Font font = workbook.getFontAt(fontIndex);
final StyleBuilder styleBuilder = new StyleBuilder();

代码示例来源:origin: org.apache.metamodel/MetaModel-excel

final int fontIndex = cellStyle.getFontIndexAsInt();
final Font font = workbook.getFontAt(fontIndex);
final StyleBuilder styleBuilder = new StyleBuilder();

代码示例来源:origin: openl-tablets/openl-tablets

public static Font cloneFontFrom(Cell cell) {
  Font newFont = null;
  if (cell != null) {
    Workbook workbook = cell.getSheet().getWorkbook();
    newFont = workbook.createFont();
    int fontIndex = cell.getCellStyle().getFontIndexAsInt();
    Font fromFont = workbook.getFontAt(fontIndex);
    newFont.setBold(fromFont.getBold());
    newFont.setColor(fromFont.getColor());
    newFont.setFontHeight(fromFont.getFontHeight());
    newFont.setFontName(fromFont.getFontName());
    newFont.setItalic(fromFont.getItalic());
    newFont.setStrikeout(fromFont.getStrikeout());
    newFont.setTypeOffset(fromFont.getTypeOffset());
    newFont.setUnderline(fromFont.getUnderline());
    newFont.setCharSet(fromFont.getCharSet());
  }
  return newFont;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
put(properties, FONT, style.getFontIndexAsInt());
put(properties, HIDDEN, style.getHidden());
put(properties, INDENTION, style.getIndention());

相关文章

微信公众号

最新文章

更多