Filed on: [Indigo]<Documentation>StyleToolDoc.tioga
Last Edit: December 7, 1982 9:26 am by Michael Plass
Style Tool
Introduction
This is a description of how to use the Style Tool for creating new Tioga styles and editing existing styles. Currently Tioga styles are expressed in modified JaM code. The Style Tool is an attempt to move away from having to understand JaM in order to write a style. The tool itself is a menu selection / form fill-in representation of all the options available in Tioga. It was designed so that someone with relatively little or no knowledge of programming languages could create and modify a style.
The Style Tool has two basic functions: It allows users to examine and modify existing styles and it enables them to create new styles. It is important to note that designing a style is a separate process from applying a style to a document. The Style Tool is not meant to replace the Edit Tool which is used for applying styles to documents. Instead, the Style Tool is meant to be an aid to the style designer.
Overview of the Basic Operation of the Style Tool
In order that the following descriptions make more sense, I recommend that you have the Style Tool running while reading this. (See section below on "How to get the Style Tool running." ) The Style Tool has two separate parts: (1) a set of commands which are in a menu at the top of the Style Tool viewer (which I will refer to as the "command menu") and (2) a menu selection / form fill in section for displaying the rendering information that is used in styles (which I will refer to as the "rendering information").
Aside from having the standard commands associated with any viewer (Close, Grow, <-->, Destroy) the command menu also contains several commands which are unique to the Style Tool. Some of these commands require the user to make a text selection in some other viewer on the screen before "clicking" at that particular command. These commands are "ShowFormatOnly," "ShowLooks," and "ApplyToSelection."
As I mentioned above, the rendering information is a collection of menu selection and fill in fields which are modifiable. There are basically four types of fields which are modified in different ways. One is a "form fill in" field, whereby the user types in a name or a number depending upon the context. For example, one would fill in the "Style Name:" field with a name such as "Cedar" and one would fill in the "Page Break Penalty:" field with a number. Another field type is very similar to the form fill in type but in addition to having a text fill in field, it also has a units field associated with it. The "Font Size:" field is an example of this. Next to the number field is the units field which should be currently represented by the word "points." This units field is actually a button which changes units everytime it is selected. Try selecting the word "points" and see what happens. You will notice that the units change from points to picas and the number field changes as well (unless the number was zero). The Style Tool will automatically convert units for you. Selecting the units button with the left mouse button caused the units to progress "forward" (i.e. - points -> picas -> inches, etc) while selecting with the right mouse button causes the units to progress "backwards" (i.e. - inches -> picas -> points, etc). The third type of field is a menu selection of items such as the "Font Family:" field. Only one of the items in the "Font Family:" field can be selected at one time. Finally there is a field consisting of "tri-state" buttons whereby each button has 3 states: on, off, and default. Each button can be set to the desired state and is independent of the state of the other buttons. Currently white text on a black background means "on", black on white means "off" and black on gray means "default". An example of this type of field is the "Font Face: " field.
How to get the Style Tool running:
Currently the files necessary for running the style tool are stored on [ivy]<gass>StyleTool>. Typing the following to the user executive will retrieve everything you need:

bringover /p [indigo]<ISL>Top>StyleTool.df
Then just type "run StyleTool" to the user executive. This will register a command "StyleTool" with the user executive which will allow you to create as many instantiations of the Style Tool as you wish. Creating multiple Style Tools may be useful for comparing styles.
Examining and Modifying Styles
A style is a collection of looks and formats which provide the rendering information for a document. Looks are applied to characters of text in a document and formats are applied to nodes in a document. One does not examine or modify a style as a whole with the Style Tool but instead one examines and modifies the individual looks and formats within a style.
Examining a style and modifying a style really go hand in hand since one cannot modify a style without examining it first. In order to examine a style, you must have a document which already has an existing style "applied" to it. That is, prior to the use of the Style Tool, a style in JaM code form has already been created and this style has been "applied" to a document using the Edit Tool. (If this process sounds foreign to you, please read the section in the Tioga Editor documentation on the Edit Tool, especially the subsection entitled "Looks, Formats, Styles, and Properties"). After making a selection in the document with the mouse, click one of the two command menu buttons "ShowFormatOnly" or "ShowLooks," depending on whether you wanted to examine the format of a node or the looks attached to certain characters. The Style Tool will then update the rendering information to reflect the particular look or format of the selection. After the rendering information fields have been updated, you can modify those fields anyway you wish. Once the fields have been modified, you can test out the modifications by selecting the "ApplyToSample" command (See the section below on "Getting Feedback."). When the modifcations are satisfactory, you can get the JaM code representation of the rendering information by selecting the "WriteFormatOnly" or "WriteLook" commands (See section below on "Writing out Looks and Formats").
A note on making selections: You may either select an entire node in the document or a portion of text when examining a look or format; the Style Tool will complain if you have made a selection which contains different looks or formats and it will use the first look or format it encounters in the selection.
Creating New Styles
Just as the Style Tool allows the user to examine and modify looks and formats one at a time, it allows the user to create looks and formats one at a time. A style is created by successively creating individual looks and formats and then editing them into the same file. When I refer to creating a look or format, I really mean the process of choosing the desired rendering information and then obtaining the JaM code representation using the "WriteLook" or "WriteFormatOnly" commands.
The file containing the style must obey the following rules. The first item in the file, aside from comments, must be the keyword "BeginStyle." Then all the looks and formats follow. They can be in any order. The last item to appear in the file is the keyword "EndStyle." Comments begin with a percent sign ("%") and continue until the end of the line.
When the Style Tool is started up, it displays the default style format in the rendering information section. Every node in a document created with Tioga automatically has this default format applied to it. After modifying the fields of the rendering information, it's possible to get back to the default by selecting the "SetToDefault" menu command.
Writing Out Looks and Formats
After filling in the various fields and selecting the desired menu items in the rendering information of the Style Tool, the user can have the look or format converted into JaM code by selecting the "WriteLook" or "WriteFormatOnly" button in the command menu. This causes the JaM code to appear in a viewer at the bottom of the Style Tool entitled "JaM CODE CORRESPONDING TO ABOVE STYLE".
There are actually two modes which affect how much JaM code is written. The modes can be changed using the "SetCreateMode" and "SetChangesMode" commands in the command menu. Only one of these two modes can be in effect at any one given time. CreateMode is particularly useful when you are creating new looks and formats. It causes the Style Tool to write out any rendering information which is different from the default displayed initially. The portion of code written out is a syntactically complete look or format which can be edited into another file.
ChangesMode is more useful for when you are modifying an existing style. It causes the Style Tool to write out only those changes which are different from the existing look or format. This means if you begin with the default style, make a few changes and then wind up changing everything back to what the default style parameters were, the Style Tool will not write out any JaM code. This same rule applies if you have used the "ShowFormatOnly" or "ShowLook" command before making changes. If the sequence of changes you have made take you back to the original look or format, no JaM code will be written. The portion of code written out this time is not syntactically complete. It only contains those parts of the code which need replacing in the original style code.
Getting FeedBack
There are two different ways of interactively finding out what the effects of a look or format will be. One is to apply the look or format to a sample piece of text provided by the Style Tool and the other is to apply it to a selection of text in another viewer.
Applying To the Sample
After filling in the fields of the rendering information, one can apply this information to a sample piece of text by selecting the "ApplyToSample" command in the command menu. This causes a new viewer to be opened with a sample piece of text in it. The text reflects the effects of the rendering information. The sample viewer has three commands associated with it: "Destroy", "Close" and "SampleText." Destroy and Close are the standard viewer operations. SampleText causes the original sample text to be redisplayed in the viewer. (Note that you can edit the sample text in any way you wish).
Applying To a Selection
This is useful for finding out how the looks and formats will look when they are applied to the actual document; it can give you an indication of how various formats will interact with each other as well. I will repeat that the Style Tool is not a substitute for the Edit Tool so please do not use this feature for applying the style to the document as you will be defeating the purpose of having a style. Always use a copy of the actual document when applying the rendering information to a selection. First make a selection in the document and then click the "ApplyToSelection" command in the command menu. This will cause the selection to reflect the specific rendering information. Because of various technical problems, when you are applying a look to a selection of text, the entire node of the selection will reflect the rendering information rather than just the span of text in the selection.
Detailed Description of Fields
ScreenRules, PrintRules and StyleRules
Each look or format in a style must be a screen rule, print rule or style rule. Just as their names suggest, print rules are used by the typesetter when printing the document and screen rules are used by Tioga when displaying the document on the screen. Most of the time, the printed appearance and the screen appearance of a document are identical; this is why style rules exist. If a look or format is a style rule then the same information will be used while printing the document and while displaying it on the screen.
In the top right corner of the Style Tool Viewer there are three buttons labeled "ScreenRule", "PrintRule" and "StyleRule." Only one of these buttons may be selected at one time. The Style Tool will display different information according to which button has been selected. For example, if the ScreenRule button has been selected, the Style Tool will not display Page Break Penalty information or Page Layout information since this information is ignored when displaying a document on the screen; it does not make sense to specify a page break penalty on the screen as there are no real "pages" on the screen, etc. If either the PrintRule or StyleRule button has been selected, all the information is displayed.
Font Information
Font Family: The user has three options available in choosing a font family:
(1) one of the "standard" font families listed can be chosen
(2) If a "non-standard" font family is desired, the "other" button may be selected. This causes a type-in field to be displayed and the user can type in the name of the font family.
A note on valid font names: It is the user's responsibility to supply a name corresponding to an existing font family. No error checking is done. If the font happens to be non-existent, then most likely the default, Tioga 10, will be used. Occasionally the font lookup algorithm will try to find another font with the same size first but this is not guaranteed.
(3) The user may select the "none" button in which case, no font family is specified and therefore the font family will be defaulted.
Font Face: The font face field is composed of two tri-state buttons (see description above in Overview section), one for bold and one for italic. If both buttons are off (black text on white background) then the face will be "Regular", that is, un-bold and un-italic. If one of the buttons is "on" while the other is set to off or default then the font face will take on the characteristic of the button which is "on." (eg- if the Bold button is on while the Italic button is set to default, the font face will be Bold.) If both buttons are "on" then the face will be set to "BoldItalic." All other conditions will be considered the default. (eg - one button off and one button default or both buttons default).
Font Size: The font size specified can be any real number and it may be specified in any units (points, picas, etc). Ideally, fonts will be synthesized so that a font size such as 19.5 is perfectly valid. Unfortunately this is not true in the real world. When specifying font sizes for printing, keep in mind that the print server may not have all sizes in all fonts. When specifying font sizes for the screen, keep in mind that the Tioga font synthesizer is limited in ability and gives up easily. To avoid unexpected results with screen fonts, you can always use one of the fonts in [indigo]<Tioga>StrikeFonts>.
GENERAL RULE: Stick to reasonable values.
Font Alphabets: The font alphabet chosen can be Upper and Lower case, Caps and small caps, Lower case only or Upper case only. The default is Upper and Lower case.
Font Underlining: The font underlining chosen can be one of: (1) None - do not underline (2) LettersAndDigits - will only underline letters and digits (3) Visible - Will underline all visible characters (not spaces, tabs and carriage returns) (4) All - will underline everything
Indent Information
There are six different indenting parameters which may be set. The indents may be a real number and may be specified in any units.
left indent: how much to indent all lines from the left margin
right indent: how much to indent all lines from the right margin
first indent:
how much more to indent first line from the left
rest indent: how much more to indent other lines from the left
top indent: how much to indent top line from top of viewer/page
bottom indent:
how much to indent bottom baseline from bottom of page
Leading Information
There are basically three different types of leading: between-line spacing (otherwise known as just plain leading), top leading and bottom leading. For generality, I will refer to all three different types of leading here as just "leading." There are two different ways of specifying the leading: one is to specify a fixed leading and the other is to specify leading "glue." In order to specify the leading as a fixed quantity, simply fill in the appropriate field and set the units accordingly. Ignore the stretch and shrink fields. If you wish to specify leading "glue", set the units, and then fill in the corresponding leading, stretch and shrink fields. You will notice that when the units field changes, the leading, stretch and shrink fields all change at the same time.
A note on leading: When specifying the between-line spacing (ordinary leading) keep in mind that the value you assign to it must be at least as big as the font size.
Miscellaneous Information
Minimum distance between tops and bottoms of lines: distance between line top and previous bottom (can be negative)
Distance to raise text above baseline: (can be negative)
Number of spaces equivalent to one tab: (uses the current font)
Line formatting: The user must choose one of "FlushLeft", "FlushRight", "Justified" or "Centered," where the default is FlushLeft.
Page Break Penalties
Currently there is no set meaning to the values for the various penalties. To get an idea for what are reasonable values to assign, it might be helpful to look at Cedar.Style. For an average "paragraph" body, it is reasonable to have a page-break-penalty of 10, a page-break-after-first-line-penalty and a page-break-before-last-line-penalty of 20. For a major section heading, a page-break-after-last-line-penalty of 100 is reasonable and for a title a page-break-after-first-line-penalty of 200 is reasonable.
Page Layout Information
Page layout information is normally kept hidden under the assumption that one only wants to set this information once in a style. Therefore it's not the type of information we need to have visible every time we design a look or format. There are two different ways to set the page layout parameters. You will notice that there are two buttons on the "Page Layout Information" label. One is titled "Parameters" and the other is titled "Graphics." Clicking at the Parameters button will cause several form fill-in fields to appear below the Page Layout Information label. It also causes the Parameters button to be displayed in black. You can fill in these fields in the same manner as any other form fill-in field in the Style Tool. Clicking the Parameters button again causes these parameters to become "invisible" although it does not change their values; the Parameters button is then displayed in white again.
Page Layout Graphics
Clicking the "Graphics" button causes a new viewer to be created which displays a grid with a page drawn on it. This feature allows you to set the page layout parameters graphically. Because of its interactive visual nature, it will (hopefully) give you a better indication of how the page will look. You will notice that the page layout viewer is divided into two sections: a section displaying all the parameters and a section displaying a grid with the page drawn on it.
In the section displaying the parameters, there are two buttons, "units" and "Set," which have special functions. The default units are inches, but you can change to any units you wish by clicking the units button. (Notice that clicking the units button also causes the parameters to be automatically converted). Now in order to get the grid converted to the units you have chosen, you must click the Set button.
There are two ways to change the parameters using the graphical page layout tool. One way is to type a number next to the appropriate parameter and click the Set button. The other way is to use the mouse. To change margins, point at the desired margin with the mouse and hold down the left mouse button. The margin will move with the mouse. Notice that it is not possible to overlap the left and right margins, nor is it possible to overlap the top and bottom margins. Also notice that the value of the margin in the form fill-in section is constantly updated while the margin is been adjusted. The page width and page length are changed in much the same way except that the right mouse button is used instead of the left mouse button.
Once you have a satisfactory page layout, you must click the Set button in order to notify the Style Tool of the changes.
Edited October 1, 1982 2:57 pm by Linda Gass.
Edit: December 7, 1982 9:26 am by Michael Plass. For ISL release.