Author: ssteiner Date: Fri Jan 14 13:16:03 2022 New Revision: 1897033 URL: http://svn.apache.org/viewvc?rev=1897033&view=rev Log: FOP-2910: Remove cidset for PDF/A-2
Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java?rev=1897033&r1=1897032&r2=1897033&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java Fri Jan 14 13:16:03 2022 @@ -1328,7 +1328,7 @@ public class PDFFactory { getDocument().registerObject(stream); } CustomFont font = getCustomFont(desc); - if (font instanceof CIDFont) { + if (font instanceof CIDFont && document.getProfile().pdfAMode.getPart() < 2) { CIDFont cidFont = (CIDFont)font; buildCIDSet(descriptor, cidFont); } Modified: xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java?rev=1897033&r1=1897032&r2=1897033&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java Fri Jan 14 13:16:03 2022 @@ -30,6 +30,7 @@ import java.net.URI; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.apache.xmlgraphics.io.ResourceResolver; @@ -170,6 +171,25 @@ public class PDFFactoryTestCase { } @Test + public void testMakeOTFFontPDFA() throws IOException { + InternalResourceResolver rr = + ResourceResolverFactory.createDefaultInternalResourceResolver(new File(".").toURI()); + PDFDocument doc = new PDFDocument(""); + doc.getProfile().setPDFAMode(PDFAMode.PDFA_2A); + PDFFactory pdfFactory = new PDFFactory(doc); + URI uri = new File("test/resources/fonts/otf/SourceSansProBold.otf").toURI(); + CustomFont sb = OFFontLoader.loadFont(new FontUris(uri, null), + null, true, EmbeddingMode.SUBSET, null, false, false, rr, false, false, true); + for (char c = 0; c < 512; c++) { + sb.mapChar(c); + } + pdfFactory.makeFont("a", "a", "WinAnsiEncoding", sb, sb); + PDFFont pdfFont = pdfFactory.getDocument().getFontMap().get("a_1"); + PDFFontDescriptor fontDescriptor = (PDFFontDescriptor) pdfFont.get("FontDescriptor"); + assertNull(fontDescriptor.getCIDSet()); + } + + @Test public void testGetExternalAction() { String germanAe = "\u00E4"; --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org