From: Simon Steiner Date: Fri, 21 Jan 2022 09:55:14 +0000 (+0000) Subject: FOP-3023: Simulated bold error in Adobe Reader thanks to Nicholas Moser X-Git-Tag: fop-2_8~2^2~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=99601efc607d50f491d8f08c56d14f01d9a5fb82;p=xmlgraphics-fop.git FOP-3023: Simulated bold error in Adobe Reader thanks to Nicholas Moser git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1897288 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java index cae8973ac..b2c7a0d17 100644 --- a/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java +++ b/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java @@ -473,7 +473,6 @@ public class PDFPainter extends AbstractIFPainter { boolean simulateStyle = tf instanceof CustomFont && ((CustomFont) tf).getSimulateStyle(); if (simulateStyle) { if (triplet.getWeight() == 700) { - generator.add("q\n"); generator.add("2 Tr 0.31543 w\n"); } if (triplet.getStyle().equals("italic")) { @@ -533,7 +532,7 @@ public class PDFPainter extends AbstractIFPainter { } textutil.writeTJ(); if (simulateStyle && triplet.getWeight() == 700) { - generator.add("Q\n"); + generator.add("0 Tr\n"); } } diff --git a/fop-core/src/test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java b/fop-core/src/test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java index 59766c985..f72e227db 100644 --- a/fop-core/src/test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java @@ -167,9 +167,8 @@ public class PDFPainterTestCase { pdfPainter.drawText(0, 0, 0, 0, null, "test"); assertEquals(sb.toString(), "BT\n/f1 0.012 Tf\n1 0 0.3333 -1 0 0 Tm [<0000000000000000>] TJ\n"); - verify(pdfContentGenerator).add("q\n"); verify(pdfContentGenerator).add("2 Tr 0.31543 w\n"); - verify(pdfContentGenerator).add("Q\n"); + verify(pdfContentGenerator).add("0 Tr\n"); } @Test