At 04:55 AM 9/19/99 -0500, Justin Bradford wrote:
>1. style import from Word?
> We need to define a style mapping from Word to Abiword.
> (Should these map to normal Abiword styles, or just
> create special Word styles in Abiword?)
Does Word always store the complete style definition separately?
If so, and I'm assuming it does, then your best bet would be to import the
complete style definitions as defined in the Word document. AbiWord has a
few hardcoded style definitions as a fallback, but it always prefers to use
whatever style definitions are explicitly defined in the file. For details,
peek at and mess with the following document:
abi/test/wp/Styles.abw
think my implementation of property overriding and style chaining is pretty
sound. In particular, I tried to do enough to allow lossless import and
export from other document formats -- especially Word and RTF. However,
without a UI for editing styles, nobody else has given it much testing
attention yet, so I may have missed a few spots beyond what's mentioned at
the bottom of the document.
If I did things properly, it should be quite easy to set up a one-to-one
mapping between Word / RTF styles and AbiWord styles. In other words, just
import them exactly as defined (Normal is blah, Heading 1 is blah, etc.),
and ignore the fact that AbiWord might have had some other hardwired
default. They don't need to be special styles; just use the existing
namespace defined in the Word document.
If things don't work as advertised in that code, by all means let me know.
:-)
> Also (assuming we map to normal Abiword styles), should I apply
> properties exactly from Word or just the differences from the style?
> If I just did differences (say the font size was different),
> but the Abiword style mapped to from the Word style had a
> different font, then Abiword would render it with a font
> differently than Word.
Oh, definitely do the differences. For imported documents, the Word and
AbiWord style definitions should be identical.
That way, we'll have enough information to be able to do a better job in the
UI, letting the user know which properties came from the style and which
were explicitly set.
> If I applied exact Word properties, then setting the style in Abiword
> is mostly pointless (since they're always overriden), except possibly for
> preserving information for export.
Yep. As you suggest, this would be pointless. Worse, it would
*drastically* increase document bloat (both on disk and in memory). One of
the very nice things about styles from a design standpoint is that they can
greatly reduce the number of places where you need to explicitly list out
all those verbose CSS properties. :-)
Paul
PS: One final note. There's currently an optimization in the native
AbiWord exporter to not emit builtin styles unless they got overridden. I
did this on the theory that all default style definitions should eventually
come from templates, rather than hardwired defaults. (Plus which it holds
down the bloat a bit.) However, this may not turn out to be the right
design choice, and I'm certainly willing to revisit it later.