// 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',
'\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...
/* 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'))
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);
} 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) {
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 {
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(' ');
* 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;
* 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;
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();