RE: Styles again.


Subject: RE: Styles again.
From: Paul Rohr (paul@abisource.com)
Date: Wed May 16 2001 - 16:24:15 CDT


At 10:39 AM 5/14/01 +1000, Martin Sevior wrote:
>It would not be sophisticated enough to do stacking. Changing the color
>property would only affect the color property of the text. The paragraph
>would have the most recent color property only. If the color property was
>deleted from the style then the paragraph would just have the recently set
>value for color.

To help minimize confusion about the original implementation, it's worth
making a distinction between:

  - C (character) properties
  - P (paragraph) properties

The lookup algorithm for a specific property is pretty simple (the code os
*quite* terse, actually). You can have at most five sources of property
information for a given span of text:

  - C style (referenced by name)
  - P style (referenced by name)
  - explicit C properties
  - explicit P properties
  - hardwired defaults

A few notes.

1. There can only be *one* relevant C style per character, and only one
relevant P style per paragraph. Anything other than that would be chaos.

2. Note that for lookup of P properties, all of the C-level stuff can be
ignored, so long as the UI doesn't allow you to set P-level properties for
C-level styles. (I assume this happens already.)

3. As Martin mentions, styles can be basedon others of the same type, using
the obvious cascading logic.

4. A style definition should, inherently, be incomplete. There's no point
in specifying values for all properties, only the ones of interest.

Finally, I should note that none of the above addresses what should happen
in the UI when using the properties on an existing selection to define or
update styles. I spec-ed some of the needed behavior as TODO #1 in the
styles test document, but more work and thought is probably needed there.

Hope that helps.

Paul



This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:04 CDT