From f7a2f19b8bc0bacbee0c2c76d218cdc534d7d7bf Mon Sep 17 00:00:00 2001 From: Matthias Reischenbacher Date: Sat, 27 Jul 2019 13:57:02 +0000 Subject: FOP-2855: apply patch from Juan for fixing letter spacing of spaces inside white-space=pre text git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1863872 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/inline/TextLayoutManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'fop-core/src') diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 7d2c79fd6..8d9e9722c 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -844,8 +844,15 @@ public class TextLayoutManager extends LeafNodeLayoutManager { font.mapChar(ch); // preserved space or non-breaking space: // create the GlyphMapping object - mapping = new GlyphMapping(nextStart, nextStart + 1, 1, 0, wordSpaceIPD, false, true, - breakOpportunity, spaceFont, level, null); + MinOptMax areaIPD; + if (prevMapping != null && prevMapping.isSpace) { + areaIPD = wordSpaceIPD.minus(letterSpaceIPD); + } else { + areaIPD = wordSpaceIPD; + } + + mapping = new GlyphMapping(nextStart, nextStart + 1, 1, 0, areaIPD, false, true, + breakOpportunity, spaceFont, level, null); thisStart = nextStart + 1; } else if (CharUtilities.isFixedWidthSpace(ch) || CharUtilities.isZeroWidthSpace(ch)) { // create the GlyphMapping object -- cgit v1.2.3