diff options
author | Simon Steiner <ssteiner@apache.org> | 2022-01-14 13:16:03 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2022-01-14 13:16:03 +0000 |
commit | c21d1426d2bf612c24127c9ba1793bcaddded917 (patch) | |
tree | 69db281305cc333638f17d5ef908894d0754047a /fop-core/src | |
parent | 2babf53815259d4829c9a532a4711c524d7ddbf3 (diff) | |
download | xmlgraphics-fop-c21d1426d2bf612c24127c9ba1793bcaddded917.tar.gz xmlgraphics-fop-c21d1426d2bf612c24127c9ba1793bcaddded917.zip |
FOP-2910: Remove cidset for PDF/A-2
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1897033 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java | 2 | ||||
-rw-r--r-- | fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java index 1238d11a6..57f8a17a9 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java @@ -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); } diff --git a/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java b/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java index f7f8e26d1..d6d7c50c1 100644 --- a/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java @@ -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"; |