Rendering rules and styles



[Next] [Up] [Previous]
Next: Rendering styles Up: Rendering rules and Previous: Rendering rules and

Rendering rules and styles

  AsTeR renders document objects by calling generic function read-aloud. Primary methods[+] can be defined on this function for objects that appear in the document model described in s:high-level-models.

The body of such a read-aloud method consists of AFL statements that set AFL state and execute audio events. For instance, the read-aloud method for object string is:

[LVerbatim1246]

Here is a slightly more complex example:

[LVerbatim1248]

Function read-aloud, as described so far, can produce only one view of a document -it can render it in only one way. To enable different views of the same object, we now introduce the notion of rendering rules and styles. This makes function read-aloud more involved.

A rendering rule associates a name with a set of actions that are to be executed when an instance of a given object type is rendered. The format of a rendering rule is

[displaymath5610]

The body of the rule consists of AFL statements that modify AFL state and execute audio events -it is the same as the body of an instance of method read-aloud.

Named rendering rules permit the user to define several rules for the same object, but now, a mechanism is needed to determine which rule to use when rendering instances of an object [tex2html_wrap5612]. At any time, only one rendering rule is active for object [tex2html_wrap5614], and this active rule is used by read-aloud.

Rules can be activated and deactivated interactively by executing (activate-rule object-name rule-name)

and (deactivate-rule object-name)

Each rule presents a different audio view of the object. AsTeR provides a collection of default rendering rules (in the form of primary methods on read-aloud) that are used when no rule has been explicitly activated for a particular object type.

Within the body of a rendering rule, we recommend that sub-objects be rendered only by calling function read-aloud. This ensures that if a listener activates a new rendering rule for an object [tex2html_wrap5616], then all instances of [tex2html_wrap5618] will be rendered using this rule. For example, after activating a rendering rule for fractions, a summation that contains a fraction as the summand gets rendered as expected, i.e., the summation is rendered as before, but the fraction in the summand is rendered using the newly activated rule. Of course, a rendering rule is free to activate and deactivate other rules. Note, however, that this will hard-wire a particular type of rendering into such a rule.





[Next] [Up] [Previous]
Next: Rendering styles Up: Rendering rules and Previous: Rendering rules and



TV Raman
Thu Mar 9 20:10:41 EST 1995