]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-3023: Simulated bold error in Adobe Reader thanks to Nicholas Moser
authorSimon Steiner <ssteiner@apache.org>
Fri, 21 Jan 2022 09:55:14 +0000 (09:55 +0000)
committerSimon Steiner <ssteiner@apache.org>
Fri, 21 Jan 2022 09:55:14 +0000 (09:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1897288 13f79535-47bb-0310-9956-ffa450edef68

fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java
fop-core/src/test/java/org/apache/fop/render/pdf/PDFPainterTestCase.java

index cae8973ace3505daee3ff01a03f566ebddfb699b..b2c7a0d179571a17ffdc07b1b30949856e125878 100644 (file)
@@ -473,7 +473,6 @@ public class PDFPainter extends AbstractIFPainter<PDFDocumentHandler> {
         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<PDFDocumentHandler> {
         }
         textutil.writeTJ();
         if (simulateStyle && triplet.getWeight() == 700) {
-            generator.add("Q\n");
+            generator.add("0 Tr\n");
         }
     }
 
index 59766c985458856676677f4cbaabe56b91cf398e..f72e227db4770c767c89f75dace6a7a359073598 100644 (file)
@@ -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