A Style handling proposal for OpenOffice.org

Purpose of this document

This is my opinion how styles should be handled in OpenOffice.org. My idea is that everything is done only once. When a style has been defined it does not have to be done again. At the moment, handling styles in OOo and in MS Office is not accurate. I could say it is not even professional. Styles can be done badly in many different ways, and you cannot always see, what you have really done.

    An example

    There is a style Default, which has the default font face and font size. Then I create new two styles based on Default, called Text body and Heading. In both I want to use font face but different font size. I write my text, and eventually I come with an idea of changing the font face for both Text body and Heading. So I change the Default font face. This is the critical point. How can I be sure that changing the Default style will change the font face for Text body and Heading? At least with MS Office changing does not always work and I have to make explicit changes for each style by hand.

This is the one thing that should be more accurate than it is now. And thats why I want to change things. I start it by defining an object called Style object.

Style object

Style object is the very basis of each style. Each style is an style object even though they may have different properties.

Style object consist following properties

Name differences style objects from each other.

Native properties are those properties which are handled straight by style object. For instance Color style object handles RGB values straight.

Inherited properties are those properties which are already handled by another style object. Property values cannot be changed straight. For instance Gradient style object has inherited style properties from Color style object. Inherited styles are handled only by their name. If user wants to change the properties of inherited style, he must change the corresponding style, where the properties are native.

This convention is used through the whole document.

Graphical styles

Now I define few graphical styles. This isnít definately a complete list and the style properties are not complete, but gives you a hint what Iím getting at.

Basic graphical style objects

These are the style objects which have only native properties

    Color

      Native style properties: RGB-values

    Bitmap

      Native style properties: The embedded bitmap

    Transparency

      Native style properties: Amount of transparency

Advanced graphical style objects

These style objects begin to have inherited properties.

    Gradient

      Native style properties: gradient properties

      Inherited style properties: Color style(s)

    Hatching

      Native style properties: Hatching properties

      Inherited style properties: Color style(s)

    Shadow

      Native style properties: Shadow properties

      Inherited style properties: Color style, Transparency style

Graphical styles

These styles begin to be more usable than the styles above, but still these are only styles, not graphical objects.

    Line (style)

      Native style properties: Line width, arrows, etc.

      Inherited style properties: Color style

    Background (style)

      Native style properties: none

      Inherited style properties: Color style / Bitmap style / Gradient style / Hatching style

Graphical objects

Ok now, this is the thing I have been defining those graphical styles. Now making objects is quite easy.

    Line

      Native properties: size, position etc.

      Inherited style properties: Line style, Shadow style, Transparency style

    Any closed surface object

      Native properties: size, position, etc.

      Inherited style properties: Line style / none, Background style / none, Shadow style, Transparency style

A comment about transparency. As we can now see, transparency is defined in two places, in Graphical object and in Shadow style. Now we should define that how does the transparency of an object affect to its shadowís transparency, or does it. Here I think that shadows and objectís transparency does not affect each other. But this should be discussed about.

Text

Text is obviously other thing, and after thinking about it, It seems to me, that it is an mistake to combine everything in a same "text style" because it forces to combine things that does not belong together. So, I define styles needed be text

Text styles

    Character style

      This is the style for handling everything about font

      Native style properties: font face, font size, weight, enhancements etcÖ

      Inherited style properties: Color (foreground and background), (Transparency), (Shadow)

      Iím not sure if transparency or shadow should be inherited at all, but that should be discussed about.

    Paragraph style

      This is the style for handling everything about the context of text

      Native style properties: Borders, linespacing, etcÖ

      Inherited style properties: Donít know yet

      Other style properties: defaults for character, bullet and ruler styles

    Bullet style

      Native style properties: Bullet marker etc.

      Inherited style properties: donít know yet

    Ruler style

      This is new style. It is a collection of jump points used by tabulation, indenting and bullets

      Native style properties: collection of jump points

      Inherited style properties: none

Using text styles

This is how to use them. The main thing is the paragraph style. When user selects paragaph, a default character style, bullet style, and ruler style are assigned for use from the paragraph style. Then within the paragraph, user can change the character, bullet and ruler for more individual use, without compromising the paragraph handling.

    An example

    The following text is wanted

    The santa claus is Coming.

      • Are the Reindeers coming too?
        1. Yes they are.

    As code it would be presented something like this in xml-pseudo-code

    <prg.style1><ruler.syle1><chr.style2>The santa claus is </chr><chr.style3>Coming.</chr></ruler></prg>

    <prg.style1><ruler.style1><indent><bullet.style1><chr.style2>
    Are the </chr><chr.style3>Reindeers </chr><chr.style2>coming </chr><chr.style4>too?</chr></bullet></indent></ruler></prg>

    <prg.style1><ruler.style1><indent><indent><bullet.style2><chr.style2>Yes they are.</chr></bullet></indent></indent><ruler></prg>

Hopefully you understand what Iím getting at.

Inheriting from other text styles

This is not real inheriting as in graphics, but here I mean that a character style can be made based on some other character style, or paragraph style can be made based on some othen paragraph style, etc.

It is already used in OOo and MS Office, but it lacks with accuracy. User must know what property the new style is inheriting. So, for each style, there is a property which tells, from which style it is based on. And then for each style property, there is an option which tells, whether the property is inherited or not. Naturally, if style isnít based on anything, inheriting is impossible.

 

The Stylist

First of all, I think stylist should be able to dock on the side of the window. At least in my monitor, Stylist is many times so big, that it goes over the text Iím writing. Of course, I can close it, but then I cannot use it well. It should be in use, but not above the text Iím handling.

So, all the graphical styles, and text styles are categorized in Stylist with handy popup menus etc.

    An Example

    When adding text, the contents of stylist could look something like this.

    Paragraph         
    Default
    Heading
    Heading 1
    Heading 2
    Heading 3
    Cite
    Address
    Character         
    Default
    Text body
    Enhancehed text body
    Heading 1
    Heading 2
    Heading 3
    Cite
    Address
    Bullet         
    Unnumbered bullet
    Numbered bullet
    Ruler         
    Default ruler

The end

As I told you earlier, this is not complete but these are my ideas, hopefully you like them.