From 85176cd9f35fb5ae0f333c723dbdd2fe2c0ec770 Mon Sep 17 00:00:00 2001 From: dchandler Date: Fri, 11 Jul 2003 13:30:22 +0000 Subject: [PATCH] Put in a fix for a new bug in Swing's RTF support. This bug is w.r.t. escapes like \bullet, \emdash, etc., and this fix only works for Windows or OS/2 RTF files, not for Mac RTF files. So if you want a TM->TMW conversion to work, use MS Word for Windows, not for the Mac. --- .../org/thdl/tib/text/TibetanMachineWeb.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/source/org/thdl/tib/text/TibetanMachineWeb.java b/source/org/thdl/tib/text/TibetanMachineWeb.java index 32dbcdc..c352d5e 100644 --- a/source/org/thdl/tib/text/TibetanMachineWeb.java +++ b/source/org/thdl/tib/text/TibetanMachineWeb.java @@ -1166,7 +1166,7 @@ public static DuffCode mapTMtoTMW(int font, int ordinal, int suggestedFont) { return null; if (ordinal >= 255) { DuffCode rv = getUnusualTMtoTMW(font, ordinal); - if (null != rv && !ThdlOptions.getBooleanOption("thdl.do.not.fix.rtf.hex.escapes")) + if (false && /* DLC FIXME: we now have \bullet issues, etc. */ null != rv && !ThdlOptions.getBooleanOption("thdl.do.not.fix.rtf.hex.escapes")) throw new Error("oddballs still found after fixing RTF hex escapes"); return rv; } @@ -1393,9 +1393,33 @@ private static DuffCode getUnusualTMtoTMW(int font, int code) { case 8126: // 0=r-w return TMtoTMW[font][149 - 32]; + case 8211: // \endash, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][150 - 32]; + + case 8212: // \emdash, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][151 - 32]; + + case 8216: // \lquote, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][145 - 32]; + + case 8217: // \rquote, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][146 - 32]; + case 8218: // 0=s-b-y 2=n-y return TMtoTMW[font][130 - 32]; + case 8220: // \ldblquote, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][147 - 32]; + + case 8221: // \rdblquote, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][148 - 32]; + case 8222: // 0=s-k-r return TMtoTMW[font][132 - 32]; @@ -1405,6 +1429,10 @@ private static DuffCode getUnusualTMtoTMW(int font, int code) { case 8225: // 0=s-p-r return TMtoTMW[font][135 - 32]; + case 8226: // \bullet, following number assumes this is a + // Windows or OS/2 RTF file, not a Mac RTF file: + return TMtoTMW[font][149 - 32]; + case 8230: // 0=s-g-r return TMtoTMW[font][133 - 32];