You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by to...@apache.org on 2001/08/01 11:52:43 UTC

cvs commit: xml-fop/src/org/apache/fop/layout/hyphenation TernaryTree.java

tore        01/08/01 02:52:43

  Modified:    src/org/apache/fop/fonts Glyphs.java
               src/org/apache/fop/layout LineArea.java
               src/org/apache/fop/layout/hyphenation TernaryTree.java
  Log:
  Submitted by:	Sasaki Suguru (s-sasaki@hkg.odn.ne.jp)
  
  Fixes for unicode escapes that were removed during code formatting
  
  Revision  Changes    Path
  1.7       +4 -4      xml-fop/src/org/apache/fop/fonts/Glyphs.java
  
  Index: Glyphs.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/Glyphs.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Glyphs.java	2001/07/31 21:27:28	1.6
  +++ Glyphs.java	2001/08/01 09:52:43	1.7
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Glyphs.java,v 1.6 2001/07/31 21:27:28 gears Exp $
  + * $Id: Glyphs.java,v 1.7 2001/08/01 09:52:43 tore Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -131,14 +131,14 @@
           // 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 @@
           '\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...
  
  
  
  1.48      +38 -38    xml-fop/src/org/apache/fop/layout/LineArea.java
  
  Index: LineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/LineArea.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- LineArea.java	2001/07/30 20:29:27	1.47
  +++ LineArea.java	2001/08/01 09:52:43	1.48
  @@ -1,5 +1,5 @@
   /*
  - * $Id: LineArea.java,v 1.47 2001/07/30 20:29:27 tore Exp $
  + * $Id: LineArea.java,v 1.48 2001/08/01 09:52:43 tore Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -217,11 +217,11 @@
               /* 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 @@
                       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 @@
                           } 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 @@
   
   
                       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 @@
   
               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 @@
        * 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 @@
        * 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 @@
       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();
  
  
  
  1.5       +2 -2      xml-fop/src/org/apache/fop/layout/hyphenation/TernaryTree.java
  
  Index: TernaryTree.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/hyphenation/TernaryTree.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TernaryTree.java	2001/07/30 20:29:28	1.4
  +++ TernaryTree.java	2001/08/01 09:52:43	1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: TernaryTree.java,v 1.4 2001/07/30 20:29:28 tore Exp $
  + * $Id: TernaryTree.java,v 1.5 2001/08/01 09:52:43 tore Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -568,7 +568,7 @@
                           leaf = true;
                           break;
                       }
  -                    ns.push(new Item((char)cur, ''));
  +                    ns.push(new Item((char)cur, '\u0000'));
                       if (sc[cur] == 0) {
                           leaf = true;
                           break;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org