Author: cbowditch
Date: Mon Sep  3 15:03:53 2018
New Revision: 1839970

URL: http://svn.apache.org/viewvc?rev=1839970&view=rev
Log:
FOP-2810; fix

Modified:
    
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java

Modified: 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java?rev=1839970&r1=1839969&r2=1839970&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java
 (original)
+++ 
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java
 Mon Sep  3 15:03:53 2018
@@ -544,7 +544,22 @@ public class PDFPainter extends Abstract
             double      xoLast          = 0f;
             double      yoLast          = 0f;
             double      wox             = wordSpacing;
-            tu.writeTextMatrix(new AffineTransform(1, 0, 0, -1, x / 1000f, y / 
1000f));
+
+            // FOP-2810
+            boolean simulateStyle = tf instanceof CustomFont && ((CustomFont) 
tf).getSimulateStyle();
+            double shear = 0;
+
+            if (simulateStyle) {
+                if (triplet.getWeight() == 700) {
+                    generator.add("q\n");
+                    generator.add("2 Tr 0.31543 w\n");
+                }
+                if (triplet.getStyle().equals("italic")) {
+                    shear = 0.3333;
+                }
+            }
+
+            tu.writeTextMatrix(new AffineTransform(1, 0, shear, -1, x / 1000f, 
y / 1000f));
             tu.updateTf(fk, fsPoints, tf.isMultiByte(), true);
             generator.updateCharacterSpacing(letterSpacing / 1000f);
             for (int i = 0, n = text.length(); i < n; i++) {



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org

Reply via email to