Problems importing RTF files, with patch


Subject: Problems importing RTF files, with patch
From: Alan De Smet (chaos@highprogrammer.com)
Date: Wed Apr 19 2000 - 00:31:11 CDT


Hi,

I've been using AbiWord for a bit now, and I really like it.
Thanks to all who have gotten it this far. Unfortunately it
isn't yet to a state where it can completely replace Microsoft
Word for me, but it's getting there, and I'd like to help it
along. My personal itch is that I need to read and modify RTF
and Microsoft Word files from other people. So, in the interest
of reducing the number of times a day I have to reboot to Windows
98, I figured maybe I could help improve the importing
capabilities.

The RTF file at
http://www.highprogrammer.com/alan/abi/bad_font_table.rtf
confuses AbiWord and causes it to give up. The file is a valid
RTF (where valid == Word97 for Win32 loads it). It was created
on Word 5 for Mac, saved to doc, loaded in Word97 for Win32, and
saved to RTF.

The file has several unexpected blocks in it. The panose information
is in subblocks, which apparently isn't expected. In addition, it
has an \falt block after the font name, also confusing AbiWord.

The attached patch kinda hacks around the problem (basically by
flattening blocks when looking for panose information, and
totally skipping blocks after the font name). It's probably not
the "correct" solution, but it solved my problem and hopefully
will lead someone else to a more correct solution.

The patch was generated with "cvs diff -u" in the abi source
directory. Is this the best way to go about it?

-- 
Alan De Smet  -  chaos@highprogrammer.com  -  http://highprogrammer.com/alan




This archive was generated by hypermail 2b25 : Wed Apr 19 2000 - 00:31:15 CDT