Re: Formatting Documents


Subject: Re: Formatting Documents
From: Paul Rohr (paul@abisource.com)
Date: Fri Aug 03 2001 - 15:39:13 CDT


Will,

It's great to see you tackling WordPerfect import.

What you're probably stumbling across is a conceptual mismatch between the
two file formats. As soon as you get the right mental mapping, things
should get a lot easier for you.

If you haven't figured this out already from wading through the code, our
native file format looks more like what HTML would be if you just used P and
SPAN tags with a bunch of CSS-like properties.

For any given span of text, *all* of its explicit properties are specified
at once. For example, if you have the following HTML example:

  <p>one
  <b>two
  <i>three</i>
  four</b>
  five</p>

We'd represent that as something like:

  <p>one
  <c props="font-weight:bold">two </c>
  <c props="font-weight:bold; font-style:italic">three</c>
  <c props="font-weight:bold"> four</c>
  five</p>

Likewise, the misnested, invalid, but still common HTML idiom of:

  <p>one
  <b>two
  <i>three</b>
  four</i>
  five</p>

would become:

  <p>one
  <c props="font-weight:bold">two </c>
  <c props="font-weight:bold; font-style:italic">three</c>
  <c props="font-weight:italic"> four</c>
  five</p>

Does that make sense? To see more examples of how the file format works, be
sure to look at the following test documents in your favorite text editor:

  abi/test/wp/*.abw

Of those, you'll especially want to consult Styles.abw when you get past
basic character-level formatting.

Enjoy!

Paul



This archive was generated by hypermail 2b25 : Fri Aug 03 2001 - 15:31:34 CDT