Re: [patch] "normal" layout

Paul Rohr (paul@abisource.com)
Tue, 15 Jun 1999 10:24:24 -0700


At 11:55 PM 6/11/99 +0000, Aaron Lehmann wrote:
>The rest of the work involved on a "normal" layout is probably
>beyond me, but I'll take a look. Maybe today I'll figure out some of the
>interface code and make menu items for switching between views or maybe a
>dialog that hasn't been written yet.

Cool. There are many places in the code where you can have an immediate
impact, so feel free to pick whatever suits your fancy.

>Another feature that I'd be interested in trying to implement is
>displaying of invisible characters. Word has an option that lets you
>display paragraph signs after every line break and small grey dots for
>spaces. How difficult would this be? Would it be smart to just paint PNG's
>of these symbols in the appropriate areas, or would that be too heavy on
>memory and speed?

That's be a nice project, and it'd be a great way to start learning how
documents and views interact.

I haven't thought through this feature much, but if you take a look at the
existing run-drawing code, it should be reasonably obvious what's going on.
We draw the background (potentially selected), the spell-check squiggles (if
any), and the text itself.

To begin with, you'll need to enable the View/Show Paragraphs menu item to
toggle the view's drawing mode between showing invisibles and not.

Right now, we don't draw tabs or breaks at all, but there is a special run
type for each, so optionally implementing drawing logic there should be
easy.
Likewise, spaces are easy to detect inside text runs, so adding invisibles
there shouldn't be bad either.

Rather than blitting PNGs, you can probably use defined characters in the
current font for this purpose.

The one thing you'll probably need to add is a special run type for
paragraph breaks (the funky backwards P). Save this one for later, because
it's more involved. Essentially, we want those breaks to be selectable
whether they're drawn or not, but this will involve updating the document's
notion of PT_DocPosition notion a bit, since paragraph breaks currently have
a "width" of zero, and this will need to change to 1, instead.

If you need a hand when you get to this point, let us know.

Paul



This archive was generated by hypermail 1.03b2.