diff options
author | Tore Engvig <tore@apache.org> | 2001-08-01 09:52:43 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-08-01 09:52:43 +0000 |
commit | a5bc30d4a3977d60f0e70c2792bc4e3a37913a3d (patch) | |
tree | 7aa991823f7bc7843c3f7db415eb5503004e8447 /src | |
parent | 167aeaca5378fef7058b40ba21483a0f678fcb2a (diff) | |
download | xmlgraphics-fop-a5bc30d4a3977d60f0e70c2792bc4e3a37913a3d.tar.gz xmlgraphics-fop-a5bc30d4a3977d60f0e70c2792bc4e3a37913a3d.zip |
Submitted by: Sasaki Suguru (s-sasaki@hkg.odn.ne.jp)
Fixes for unicode escapes that were removed during code formatting
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194384 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/fonts/Glyphs.java | 6 | ||||
-rw-r--r-- | src/org/apache/fop/layout/LineArea.java | 74 | ||||
-rw-r--r-- | src/org/apache/fop/layout/hyphenation/TernaryTree.java | 2 |
3 files changed, 41 insertions, 41 deletions
diff --git a/src/org/apache/fop/fonts/Glyphs.java b/src/org/apache/fop/fonts/Glyphs.java index 8f30bd995..e5944031e 100644 --- a/src/org/apache/fop/fonts/Glyphs.java +++ b/src/org/apache/fop/fonts/Glyphs.java @@ -131,14 +131,14 @@ public class Glyphs { // not used until char 32 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x20 - ' ', '\0021', '\"', '\u0023', '$', '%', '&', '\'', '(', ')', '*', '+', ',', + ' ', '\u0021', '\"', '\u0023', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '\u002d', '\u002e', '/', // 0x30 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', // 0x40 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', // 0x50 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\u005b', '\\', - '\u005e', '^', '_', // 0x60 + '\u005d', '^', '_', // 0x60 '\u2018', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', // 0x70 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\u007b', '\u007c', '\u007d', @@ -156,7 +156,7 @@ public class Glyphs { '\u0161', '\u203a', '\u0153', '\u2022', '\u017e', '\u0178', // 0xA0 ' ', '\u00a1', '\u00a2', '\u00a3', '\u00a4', '\u00a5', '\u00a6', '\u00a7', '\u00a8', '\u00a9', '\u00aa', '\u00ab', - '\u00ac', '\u00ad', '\u00ad', '\u00af', // 0xb0 + '\u00ac', '\u00ad', '\u00ae', '\u00af', // 0xb0 '\u00b0', '\u00b1', '\u00b2', '\u00b3', '\u00b4', '\u00b5', // This is hand-coded, the rest is assumption '\u00b6', // and *might* not be correct... diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index fd9009512..ef16becef 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -217,11 +217,11 @@ public class LineArea extends Area { /* get the character */ char c = data[i]; if (!(isSpace(c) || (c == '\n') || (c == '\r') || (c == '\t') - || (c == '?'))) { + || (c == '\u2028'))) { charWidth = getCharWidth(c); isText = true; // Add support for zero-width spaces - if (charWidth <= 0 && c != '?' && c != '?') + if (charWidth <= 0 && c != '\u200B' && c != '\uFEFF') charWidth = whitespaceWidth; } else { if ((c == '\n') || (c == '\r') || (c == '\t')) @@ -238,7 +238,7 @@ public class LineArea extends Area { if (this.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE) { if (isSpace(c)) { spaceWidth += getCharWidth(c); - } else if (c == '\n' || c == '?') { + } else if (c == '\n' || c == '\u2028') { // force line break if (spaceWidth > 0) { InlineSpace is = new InlineSpace(spaceWidth); @@ -253,7 +253,7 @@ public class LineArea extends Area { } else if (c == '\t') { spaceWidth += 8 * whitespaceWidth; } - } else if (c == '?') { + } else if (c == '\u2028') { // Line separator // Breaks line even if WhiteSpaceCollapse = True if (spaceWidth > 0) { @@ -350,13 +350,13 @@ public class LineArea extends Area { if (this.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE) { - if (c == '\n' || c == '?') { + if (c == '\n' || c == '\u2028') { // force a line break return i + 1; } else if (c == '\t') { spaceWidth = whitespaceWidth; } - } else if (c == '?') { + } else if (c == '\u2028') { return i + 1; } } else { @@ -1178,35 +1178,35 @@ public class LineArea extends Area { if (c == ' ') width = em; - if (c == '?') + if (c == '\u2000') width = en; - if (c == '?') + if (c == '\u2001') width = em; - if (c == '?') + if (c == '\u2002') width = em / 2; - if (c == '?') + if (c == '\u2003') width = currentFontState.getFontSize(); - if (c == '?') + if (c == '\u2004') width = em / 3; - if (c == '?') + if (c == '\u2005') width = em / 4; - if (c == '?') + if (c == '\u2006') width = em / 6; - if (c == '?') + if (c == '\u2007') width = getCharWidth(' '); - if (c == '?') + if (c == '\u2008') width = getCharWidth('.'); - if (c == '?') + if (c == '\u2009') width = em / 5; - if (c == '?') + if (c == '\u200A') width = 5; - if (c == '?') + if (c == '\u200B') width = 100; - if (c == ' ') + if (c == '\u00A0') width = getCharWidth(' '); - if (c == '?') + if (c == '\u202F') width = getCharWidth(' ') / 2; - if (c == '?') + if (c == '\u3000') width = getCharWidth(' ') * 2; if ((c == '\n') || (c == '\r') || (c == '\t')) width = getCharWidth(' '); @@ -1222,18 +1222,18 @@ public class LineArea extends Area { * it's not non-breaking */ private boolean isSpace(char c) { - if (c == ' ' || c == '?' || // en quad - c == '?' || // em quad - c == '?' || // en space - c == '?' || // em space - c == '?' || // three-per-em space - c == '?' || // four--per-em space - c == '?' || // six-per-em space - c == '?' || // figure space - c == '?' || // punctuation space - c == '?' || // thin space - c == '?' || // hair space - c == '?') // zero width space + if (c == ' ' || c == '\u2000' || // en quad + c == '\u2001' || // em quad + c == '\u2002' || // en space + c == '\u2003' || // em space + c == '\u2004' || // three-per-em space + c == '\u2005' || // four--per-em space + c == '\u2006' || // six-per-em space + c == '\u2007' || // figure space + c == '\u2008' || // punctuation space + c == '\u2009' || // thin space + c == '\u200A' || // hair space + c == '\u200B') // zero width space return true; else return false; @@ -1245,9 +1245,9 @@ public class LineArea extends Area { * space. */ private boolean isNBSP(char c) { - if (c == ' ' || c == '?' || // narrow no-break space - c == '?' || // ideographic space - c == '?') { // zero width no-break space + if (c == '\u00A0' || c == '\u202F' || // narrow no-break space + c == '\u3000' || // ideographic space + c == '\uFEFF') { // zero width no-break space return true; } else return false; @@ -1269,7 +1269,7 @@ public class LineArea extends Area { private void addSpacedWord(String word, LinkSet ls, int startw, int spacew, TextState textState, boolean addToPending) { - StringTokenizer st = new StringTokenizer(word, " ???", true); + StringTokenizer st = new StringTokenizer(word, "\u00A0\u202F\u3000\uFEFF", true); int extraw = 0; while (st.hasMoreTokens()) { String currentWord = st.nextToken(); diff --git a/src/org/apache/fop/layout/hyphenation/TernaryTree.java b/src/org/apache/fop/layout/hyphenation/TernaryTree.java index b6ad6120a..25dd7005c 100644 --- a/src/org/apache/fop/layout/hyphenation/TernaryTree.java +++ b/src/org/apache/fop/layout/hyphenation/TernaryTree.java @@ -568,7 +568,7 @@ public class TernaryTree implements Cloneable, Serializable { leaf = true; break; } - ns.push(new Item((char)cur, ' + ns.push(new Item((char)cur, '\u0000')); if (sc[cur] == 0) { leaf = true; break; |