Browse Source

Fixed destructive data mangling while preparing text for small-caps

font variation. The fix is simplisitc and can cause small caps
text to be expensive in terms of memory consumption and processing
time.
PR: 1171


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196006 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_20_5rc3
Joerg Pietschmann 21 years ago
parent
commit
46f87864ab
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/org/apache/fop/fo/FOText.java

+ 5
- 2
src/org/apache/fop/fo/FOText.java View File

@@ -209,6 +209,7 @@ public class FOText extends FONode {

// parse text for upper/lower case and call addRealText
char c;
char newdata[] = new char[end];
boolean isLowerCase;
int caseStart;
FontState fontStateToUse;
@@ -221,7 +222,9 @@ public class FOText extends FONode {
== (java.lang.Character.isLetter(c)
&& java.lang.Character.isLowerCase(c))) {
if (isLowerCase) {
data[i] = java.lang.Character.toUpperCase(c);
newdata[i] = java.lang.Character.toUpperCase(c);
} else {
newdata[i] = c;
}
i++;
if (i == end)
@@ -235,7 +238,7 @@ public class FOText extends FONode {
}
int index = addRealText(ba, fontStateToUse, red, green, blue,
wrapOption, ls, whiteSpaceCollapse,
data, caseStart, i, textState,
newdata, caseStart, i, textState,
vAlign);
if (index != -1) {
return index;

Loading…
Cancel
Save