diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java index e258dbd9ff..085252eedd 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPage.java @@ -462,6 +462,8 @@ private void drawText(String text, float textX, float textY, FontInfo fontInfo, contentByte.setColorStroke(color); } BaseFont font = getBaseFont(fontInfo); + font.setIncludeCidSet(this.pageDevice.isIncludeCidSet()); + float fontSize = fontInfo.getFontSize(); try { // PDF/A: if font not embeddable then use the configured PDF/A fallback font diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java index 2aa012158a..0379e7ae6c 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/PDFPageDevice.java @@ -166,6 +166,8 @@ public class PDFPageDevice implements IPageDevice { private final static String PDFA_FALLBACK_FONT = "PdfEmitter.PDFA.FallbackFont"; + private final static String PDF_FONT_CID_SET = "PdfEmitter.IncludeCidSet"; + protected Map userProperties; private char pdfVersion = '0'; @@ -178,6 +180,8 @@ public class PDFPageDevice implements IPageDevice { private String defaultFontPdfA = null; + private boolean includeFontCidSet = true; + /** * * Constructor to define the PDF @@ -207,6 +211,8 @@ public PDFPageDevice(OutputStream output, String title, String author, String su this.setPdfConformance(); // PDF/A, set the default font of not embeddable fonts this.setDefaultFontPdfA(); + // PDF include font CID set stream + this.setIncludeCidSet(); // PDF/A (A1A, A1B), avoid compression and transparency if (!this.isPdfAFormat) { @@ -867,4 +873,33 @@ public void setDefaultFontPdfA(String defaultFont) { public String getDefaultFontPdfA() { return this.defaultFontPdfA; } + + /** + * Set the including of a font CIDSet stream the document. When set to true, a + * CIDSet stream will be included in the document. When set to false, no CIDSet + * stream will be included. + */ + private void setIncludeCidSet() { + if (this.userProperties != null && this.userProperties.containsKey(PDFPageDevice.PDF_FONT_CID_SET)) + this.includeFontCidSet = Boolean + .parseBoolean(this.userProperties.get(PDFPageDevice.PDF_FONT_CID_SET).toString()); + } + + /** + * Set the including of a font CIDSet stream the document + * + * @param includeFontCidSet include CIDSet stream of a font to the document + */ + public void setIncludeCidSet(boolean includeFontCidSet) { + this.includeFontCidSet = includeFontCidSet; + } + + /** + * Get the instruction to include CIDSet stream of fonts + * + * @return the CIDSet shall be included + */ + public boolean isIncludeCidSet() { + return this.includeFontCidSet; + } } diff --git a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md index 49b724b06a..fa95b6e44f 100644 --- a/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md +++ b/engine/org.eclipse.birt.report.engine.emitter.pdf/src/org/eclipse/birt/report/engine/emitter/pdf/README.md @@ -63,6 +63,17 @@ The following list get an overview of all supported user properties, the content Values file name with full path or list of file names Default empty (null) + +**PdfEmitter.IncludeCidSet** + + Content include the CIDSet stream of a font into the document + Location report + Data type boolean + Values true, CIDSet will be included + false, CIDSet won't be included + Default true + Since 4.17 + **PdfEmitter.PDFA.FallbackFont** Content fall back font to create the pdf/a document correctly,