use of com.itextpdf.text.Font in project bamboobsc by billchen198318.
the class OrganizationReportPdfCommand method getFont.
private Font getFont(String color, boolean bold) throws Exception {
Font font = FontFactory.getFont(BscConstants.PDF_ITEXT_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
int[] rgb = SimpleUtils.getColorRGB2(color);
BaseColor baseColor = new BaseColor(rgb[0], rgb[1], rgb[2]);
font.setSize(9);
font.setColor(baseColor);
return font;
}
use of com.itextpdf.text.Font in project saga by timurstrekalov.
the class PdfReporter method addFileStatsRows.
private void addFileStatsRows(final TestRunCoverageStatistics runStats, final PdfPTable table) {
final List<ScriptCoverageStatistics> allFileStats = runStats.getFileStats();
for (int i = 0; i < allFileStats.size(); i++) {
final ScriptCoverageStatistics scriptCoverageStatistics = allFileStats.get(i);
final boolean hasStatements = scriptCoverageStatistics.getHasStatements();
final Phrase fileName = new Phrase();
if (scriptCoverageStatistics.getParentName() != null) {
fileName.add(new Chunk(scriptCoverageStatistics.getParentName() + "/", hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD_BOLD : FONT_TD_BOLD_EMPTY_FILE));
} else {
fileName.add(new Chunk(scriptCoverageStatistics.getFileName(), hasStatements ? FONT_TD : FONT_TD_EMPTY_FILE));
}
final BaseColor bgColor = (i % 2 == 1) ? COLOR_ROW_ODD : COLOR_ROW_EVEN;
final Font font = FONT_TD;
table.addCell(createCell(fileName, 0, bgColor));
table.addCell(createCell(String.valueOf(scriptCoverageStatistics.getStatements()), font, 1, bgColor));
table.addCell(createCell(String.valueOf(scriptCoverageStatistics.getExecuted()), font, 2, bgColor));
table.addCell(createCell(scriptCoverageStatistics.getCoverage() + "%", FONT_TD, 3, bgColor));
}
}
use of com.itextpdf.text.Font in project bamboobsc by billchen198318.
the class KpiReportPdfCommand method getFont.
private Font getFont(String color, boolean bold) throws Exception {
Font font = FontFactory.getFont(BscConstants.PDF_ITEXT_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
int[] rgb = SimpleUtils.getColorRGB2(color);
BaseColor baseColor = new BaseColor(rgb[0], rgb[1], rgb[2]);
font.setSize(9);
if (bold) {
font.setSize(14);
font.setStyle(Font.BOLD);
}
font.setColor(baseColor);
return font;
}
use of com.itextpdf.text.Font in project bamboobsc by billchen198318.
the class PersonalReportPdfCommand method getFont.
private Font getFont(String color, boolean bold) throws Exception {
Font font = FontFactory.getFont(BscConstants.PDF_ITEXT_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
int[] rgb = SimpleUtils.getColorRGB2(color);
BaseColor baseColor = new BaseColor(rgb[0], rgb[1], rgb[2]);
font.setSize(9);
font.setColor(baseColor);
return font;
}