summaryrefslogtreecommitdiffstats
path: root/fop-core
diff options
context:
space:
mode:
authorMatthias Reischenbacher <matthias@apache.org>2019-07-27 13:57:02 +0000
committerMatthias Reischenbacher <matthias@apache.org>2019-07-27 13:57:02 +0000
commitf7a2f19b8bc0bacbee0c2c76d218cdc534d7d7bf (patch)
tree3bce02eca16382861564012250a93bf8b1cfe964 /fop-core
parentfacedd4e045d1f26ca008b7a4e7e02f5c80d18da (diff)
downloadxmlgraphics-fop-f7a2f19b8bc0bacbee0c2c76d218cdc534d7d7bf.tar.gz
xmlgraphics-fop-f7a2f19b8bc0bacbee0c2c76d218cdc534d7d7bf.zip
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
Diffstat (limited to 'fop-core')
-rw-r--r--fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java11
1 files changed, 9 insertions, 2 deletions
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