Browse Source

#60656 - Support export file that contains emf and render it correctly

git-svn-id: https://svn.apache.org/repos/asf/poi/branches/hemf@1842059 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_4_1_0
Andreas Beeker 5 years ago
parent
commit
93b7cb0bc7
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java

+ 4
- 2
src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java View File

@@ -351,7 +351,7 @@ public class HwmfGraphics {
}
}

String textString = new String(text, charset);
String textString = new String(text, charset).trim();
AttributedString as = new AttributedString(textString);
if (dx == null || dx.isEmpty()) {
addAttributes(as, font);
@@ -388,7 +388,9 @@ public class HwmfGraphics {
offset += Character.charCount(chars[0]);
}
}
for (int i = 0; i < dxNormed.size(); i++) {

int cps = textString.codePointCount(0, textString.length());
for (int i = 0; i < Math.min(dxNormed.size(),cps-1); i++) {
addAttributes(as, font);
// Tracking works as a prefix/advance space on characters whereas
// dx[...] is the complete width of the current char

Loading…
Cancel
Save