Hi,

here again a small patch to wv/text.c. First a small confession:
the 'case range' foul-up was mine. Realized too late it was a 
gnu-ism :-(.

It still contains an off-by-one error, which is fixed here.
I also moved a comment block.

Also code to handle "soft-hyphens" (i.e. preferred word break
indicators that become hyphens only on line breaks, and 
otherwise vanish; \- in LaTeX). It appears that the Word test 
files I have use 0x2013 for this, but also for "en-dash" (the 
official meaning), -- in LaTeX. Two completely different 
symbols using the same code. Word renders them correctly and
differently. What does Word know that wv doesn't?

I don't understand this.

Martin
--
Martin Vermeer                 [EMAIL PROTECTED]  [EMAIL PROTECTED]
-- Linux means: never having to delete your love letters
Index: text.c
===================================================================
RCS file: /cvsroot/wv/text.c,v
retrieving revision 1.42
diff -u -r1.42 text.c
--- text.c      2000/07/11 16:40:37     1.42
+++ text.c      2000/07/13 17:48:23
@@ -533,12 +533,28 @@
 
 int wvConvertUnicodeToLaTeX(U16 char16)
        {
-       if( (char16 >= 0x9f) && (char16 <= 0xff) ) 
-       { 
-               printf("%c", char16); 
-               return(1); 
-       } 
+       /* 
+       german and scandinavian characters, MV 1.7.2000 
+       See man iso_8859_1
+
+       This requires the inputencoding latin1 package,
+       see latin1.def. Chars in range 160...255 are just
+       put through as these are legal iso-8859-1 symbols.
+       (see above)
        
+       Best way to do it until LaTeX is Unicode enabled 
+       (Omega project).
+       -- MV 4.7.2000
+ 
+       We use a separate if-statement here ... the 'case range'
+       construct is gcc specific :-(  -- MV 13/07/2000
+       */
+
+       if ( (char16 >= 0xa0) && (char16 <= 0xff) ) 
+       {
+               printf("%c", char16);
+               return(1);
+       }
        switch(char16)
                {
                case 37:
@@ -551,7 +567,18 @@
                case 31:
                case 45:
                case 0x2013:
-                       printf("--"); /* en-dash */
+                       /* 
+                       soft-hyphen? Or en-dash? I find that making 
+                       this a soft-hyphen works very well, but makes
+                       the occasional "hard" word-connection hyphen 
+                       (like the "-" in roller-coaster) disappear.
+                       (Are these actually en-dashes? Dunno.)
+                       How does MS Word distinguish between the 0x2013's
+                       that signify soft hyphens and those that signify
+                       word-connection hyphens? wvware should be able
+                       to as well. -- MV 8.7.2000
+                       */
+                       printf("\\-"); 
                        return(1);
                case 12:
                case 13:
@@ -571,16 +598,6 @@
                        printf(">");
                        return(1);
 
-        /* 
-       german and scandinavian characters, MV 1.7.2000 
-       See man iso_8859_1
-
-       This requires the inputencoding latin1 package,
-       see latin1.def. Chars in range 159...255 are just
-       put through as these are legal iso-8859-1 symbols.
-       -- MV 4.7.2000
-       */
-
                case 0x2019:
                        printf("'");  /* Right single quote, Win */
                        return(1);
@@ -657,7 +674,7 @@
                case 31:
                case 45:
                case 0x2013:
-                       printf("--"); /* en-dash */
+                       printf("-"); /* en-dash */
                        return(1);
                case 12:
                case 13:

Reply via email to