diff options
author | Chris Bowditch <cbowditch@apache.org> | 2018-09-03 15:03:53 +0000 |
---|---|---|
committer | Chris Bowditch <cbowditch@apache.org> | 2018-09-03 15:03:53 +0000 |
commit | 51ef3fa6bd23b1231ad2f7935a4c303fd106a252 (patch) | |
tree | dcc019b8d810fe9a0f7c63bc59a281411de52129 | |
parent | cd502c7a5bcbcfe6126117cd8c461b06482c7d21 (diff) | |
download | xmlgraphics-fop-51ef3fa6bd23b1231ad2f7935a4c303fd106a252.tar.gz xmlgraphics-fop-51ef3fa6bd23b1231ad2f7935a4c303fd106a252.zip |
FOP-2810; fix
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1839970 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/render/pdf/PDFPainter.java | 17 |
1 files changed, 16 insertions, 1 deletions
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 a47203d53..de8b42aec 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 @@ -544,7 +544,22 @@ public class PDFPainter extends AbstractIFPainter<PDFDocumentHandler> { 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++) { |