Search in sources :

Example 1 with DetectFontLoader

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"));
}
Also used : PDFont(org.apache.pdfbox.pdmodel.font.PDFont) DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) PDDocument(org.apache.pdfbox.pdmodel.PDDocument) Test(org.junit.jupiter.api.Test)

Example 2 with DetectFontLoader

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);
}
Also used : DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) DetectFontInstaller(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) AirGapFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.AirGapFontLocator) DetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontLocator) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) File(java.io.File)

Example 3 with DetectFontLoader

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"));
}
Also used : PDFont(org.apache.pdfbox.pdmodel.font.PDFont) DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) PDDocument(org.apache.pdfbox.pdmodel.PDDocument) Test(org.junit.jupiter.api.Test)

Example 4 with DetectFontLoader

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"));
}
Also used : PDFont(org.apache.pdfbox.pdmodel.font.PDFont) DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) PDDocument(org.apache.pdfbox.pdmodel.PDDocument) Test(org.junit.jupiter.api.Test)

Example 5 with DetectFontLoader

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);
    });
}
Also used : DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) ReportService(com.synopsys.integration.detect.workflow.blackduck.report.service.ReportService)

Aggregations

DetectFontLoader (com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader)5 PDDocument (org.apache.pdfbox.pdmodel.PDDocument)3 PDFont (org.apache.pdfbox.pdmodel.font.PDFont)3 Test (org.junit.jupiter.api.Test)3 AirGapFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.AirGapFontLocator)1 DetectFontInstaller (com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller)1 DetectFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.DetectFontLocator)1 OnlineDetectFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator)1 ReportService (com.synopsys.integration.detect.workflow.blackduck.report.service.ReportService)1 File (java.io.File)1