use of com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader in project synopsys-detect by blackducksoftware.
the class FontLoaderTestIT method loadsCJKFont.
@Test
public void loadsCJKFont() {
DetectFontLoader fontLoader = new DetectFontLoader(detectFontLocator);
PDFont font = fontLoader.loadFont(new PDDocument());
Assertions.assertTrue(font.getName().contains("CJK"));
}
use of com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader in project synopsys-detect by blackducksoftware.
the class DetectFontLoaderFactory method detectFontLoader.
public DetectFontLoader detectFontLoader() {
DetectFontLocator locator;
Optional<File> fontAirGapPath = airGapInspectorPaths.getFontsAirGapDirectory();
if (fontAirGapPath.isPresent()) {
locator = new AirGapFontLocator(airGapInspectorPaths);
} else {
locator = new OnlineDetectFontLocator(new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator), directoryManager);
}
return new DetectFontLoader(locator);
}
use of com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader in project synopsys-detect by blackducksoftware.
the class FontLoaderTestIT method loadsCJKBoldFont.
@Test
public void loadsCJKBoldFont() {
DetectFontLoader fontLoader = new DetectFontLoader(detectFontLocator);
PDFont font = fontLoader.loadBoldFont(new PDDocument());
Assertions.assertTrue(font.getName().contains("CJK"));
}
use of com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader in project synopsys-detect by blackducksoftware.
the class FontLoaderTestIT method installOnceTestFont.
@Test
public void installOnceTestFont() {
DetectFontLoader fontLoader = new DetectFontLoader(detectFontLocator);
PDFont regularFont = fontLoader.loadFont(new PDDocument());
PDFont boldFont = fontLoader.loadBoldFont(new PDDocument());
Assertions.assertTrue(regularFont.getName().contains("CJK"));
Assertions.assertTrue(boldFont.getName().contains("CJK"));
}
use of com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader in project synopsys-detect by blackducksoftware.
the class OperationFactory method createRiskReportFile.
public File createRiskReportFile(BlackDuckRunData blackDuckRunData, ProjectVersionWrapper projectVersionWrapper, File reportDirectory) throws OperationException {
return auditLog.namedPublic("Create Risk Report File", "RiskReport", () -> {
DetectFontLoader detectFontLoader = detectFontLoaderFactory.detectFontLoader();
ReportService reportService = creatReportService(blackDuckRunData);
return reportService.createReportPdfFile(reportDirectory, projectVersionWrapper.getProjectView(), projectVersionWrapper.getProjectVersionView(), detectFontLoader::loadFont, detectFontLoader::loadBoldFont);
});
}
Aggregations