Example usage for org.apache.poi.ss.usermodel Font setFontName

List of usage examples for org.apache.poi.ss.usermodel Font setFontName

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Font setFontName.

Prototype


void setFontName(String name);

Source Link

Document

set the name for the font (i.e.

Usage

From source file:com.github.svrtm.xlreport.Font_p.java

License:Apache License

public void copyTo(final org.apache.poi.ss.usermodel.Font poiFont) {
    if (fontHeightInPoints != null)
        poiFont.setFontHeightInPoints(fontHeightInPoints);
    if (xssfColor == null) {
        if (color != null)
            poiFont.setColor(color);/*from w  w  w .ja  v a 2 s .co m*/
    } else
        ((XSSFFont) poiFont).setColor(xssfColor);
    if (italic != null)
        poiFont.setItalic(italic);
    if (boldweight != null)
        poiFont.setBoldweight(boldweight);
    if (name != null)
        poiFont.setFontName(name);
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private void addTitle(Workbook p_workBook, Sheet p_sheet) throws Exception {
    Font titleFont = p_workBook.createFont();
    titleFont.setUnderline(Font.U_NONE);
    titleFont.setFontName("Times");
    titleFont.setFontHeightInPoints((short) 14);
    titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
    CellStyle cs = p_workBook.createCellStyle();
    cs.setFont(titleFont);//from  ww  w.j  a v  a 2  s  . c o  m

    Row titleRow = getRow(p_sheet, 0);
    Cell titleCell = getCell(titleRow, 0);
    titleCell.setCellValue("DITA QA Report");
    titleCell.setCellStyle(cs);
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getHeaderStyle(Workbook p_workbook) throws Exception {
    if (headerStyle == null) {
        Font font = p_workbook.createFont();
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        font.setColor(IndexedColors.BLACK.getIndex());
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 11);

        CellStyle cs = p_workbook.createCellStyle();
        cs.setFont(font);/*from  w w  w. j  ava 2s.c  om*/
        cs.setWrapText(true);
        cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
        cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        cs.setBorderTop(CellStyle.BORDER_THIN);
        cs.setBorderRight(CellStyle.BORDER_THIN);
        cs.setBorderBottom(CellStyle.BORDER_THIN);
        cs.setBorderLeft(CellStyle.BORDER_THIN);

        headerStyle = cs;
    }

    return headerStyle;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getContentStyle(Workbook p_workbook) throws Exception {
    if (contentStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);//from w  w w .  ja va  2 s.c o  m
        style.setWrapText(true);
        style.setAlignment(CellStyle.ALIGN_LEFT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        contentStyle = style;
    }

    return contentStyle;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getNoWrapContentStyle(Workbook p_workbook) throws Exception {
    if (noWrapContentStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);/*from w ww  .j  a v a 2s .  c  om*/
        style.setWrapText(false);
        style.setAlignment(CellStyle.ALIGN_LEFT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        noWrapContentStyle = style;
    }

    return noWrapContentStyle;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getRtlContentStyle(Workbook p_workbook) throws Exception {
    if (rtlContentStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);//from w  w w.j  a va2 s  . c  o  m
        style.setWrapText(true);
        style.setAlignment(CellStyle.ALIGN_RIGHT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        rtlContentStyle = style;
    }

    return rtlContentStyle;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private CellStyle getUnlockedStyle(Workbook p_workbook) throws Exception {
    if (unlockedStyle == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        CellStyle style = p_workbook.createCellStyle();
        style.setFont(font);/*ww w  .  j a v  a 2 s .c  o m*/
        style.setLocked(false);
        style.setWrapText(true);
        style.setAlignment(CellStyle.ALIGN_LEFT);
        style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

        unlockedStyle = style;
    }

    return unlockedStyle;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private Font getNormalFont(Workbook p_workbook) {
    if (normalFont == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);

        normalFont = font;//w w w  . jav a 2 s  .  c om
    }

    return normalFont;
}

From source file:com.globalsight.everest.qachecks.DITAQAChecker.java

License:Apache License

private Font getRedFont(Workbook p_workbook) {
    if (redFont == null) {
        Font font = p_workbook.createFont();
        font.setFontName("Arial");
        font.setFontHeightInPoints((short) 10);
        font.setColor(HSSFColor.RED.index);
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        redFont = font;//from   www  .j a  va2 s .com
    }

    return redFont;
}

From source file:com.globalsight.everest.qachecks.QAChecker.java

License:Apache License

private CellStyle getTitleStyle(Workbook p_workbook) {
    if (m_titleStyle == null) {
        CellStyle style = p_workbook.createCellStyle();
        Font font = p_workbook.createFont();
        font.setUnderline(Font.U_NONE);
        font.setFontName("Times");
        font.setFontHeightInPoints((short) 14);
        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
        style.setFont(font);// w ww .  jav  a  2 s. c o  m

        m_titleStyle = style;
    }

    return m_titleStyle;
}