Jump to Navigation

Layout Codes

Layout Codes

There are two kinds of layout codes: those which always modify a whole pragraph, and those which modify one or more characters. They are always kept strictly separate. A layout code consists of a type byte, followed by one or more modifier bytes. All rcognized codes are listed below.

Paragraph Layout List

A Paragraph Layout List is a LListB of Paragraph Layout Codes. Paragraph Layout Codes are almost always found in this form.

Paragraph Layout Codes

As explained above, a Paragraph Layout Code consists of a type byte, telling what kind of layout code this is, followed by a type-dependent amount of data.

Type Size Data  Description

01 3B Color Background color
02 L , Length Indent left
03 L Length Indent right
04 L Length (Un)indent first line (length relative to indent left setting)
05 B Hor. justify left (00), centre (01), right (02) or full (03)
06 B Vert. justify top (00) centre (01) or bottom (02)
07 L Size Interline distance
08 B Interline distance is minimum (00) or exact (01)
09 L Size Line distance before paragraph start
0A L Size Line distance after paragraph end
0B B Line distance options: Keep on one page on (01) or off (00)
0C B Line distance options: Keep together with on (01) or off (00)
0D B Line distance options: On next page on (01) or off (00)
0E B Protection vs. single lines on pages disable (01) or enable (00)
0F B Wrap data to fill sheet cell limits on (01) or off (00)
10 L Length Distance of borders from text
11 9B Border Top border
12 9B Border Bottom border
13 9B Border Left border
14 9B Border Right border
15 * Bullet Bullets
16 L Length Set standard (left) tabs interval
17 5B Tab Set extra tab

Some comments. The first line of a paragraph can have a different indentation than the other lines. This indentation length is always relative to the normal indentation, and can be positive (more to the right) or negative (more to the left). Combined with bulltes, things are slightly different (see there).

Borders can be made to be drawn beyond the standard margins, by specifying the amount of space between them and the text. This is always a positive value.

There always standard tab positions; they are placed at regular interfals as specified. These are always left tabs. Additional tabs can also be specified, but these are always in addition to the standard tab positions.

Borders

The four possible borders are specified separately, through initial type bytes 11 to 14. The border structure is shown below.

 Offset Data Description

0000 B Type (see below)
0001 L Thickness (always 01 for types 02 to 06)
0005 Color Color of border
0008 B Unknown (always 00 or 01 ?)
0009

The border type can have the following values:

 Border Type  Description

00 None
01 Solid single line
02 Solid double line
03 Dotted line
04 Dashed line
05 Dotsdashed line
06 Dotdotdashed line

The thickness can only be defined for solid lines. It is expressed in units of 1/14 point (1/20 decimal), just like Sizes and Lengths. The three Unknown bytes may be another color code, or something completely different. The function of the final byte is also unclear.

Bullets

A Bullet description is a BListB. The complete structure is given below, including the initial length byte excluding the initial type byte 15.

 Offset Data  Description

0000 B Size of the remainder of this section in bytes
0001 Size Font size of bullet in points
0005 B Character used for bullet in ASCII
0006 B Indent after bullet on (01) or off (00)
0007 Color Color of bullet
0008 Font Font from which the bullet is taken (always Swiss?)

The combination of indents and bullets is somewhat involved. If Indent After Bullet is off, everything works as expected: the bullet is located at the first line indent, and the text starts right after it. If it is on, the bullet is located at the minmum of first line indent and left indent; the text (including the first line) is located at the maximum of first line indent and left indent.

Tabs

In addition to the default left tabs, which are found at regular intervals, more tabs can be defined. Each additional tab is specified in its own structure. Below this structure is shown, excluding the initial type byte 17.

 Offset Data  Description

0000 Length Location of the tab, relative to the left margin
0004 B Tab type (see below)
0005

There are three kinds of tabs. They specify the anchoring of the text just after the tab: either the first character, the centre character or the last character.

 Tab type  Kind

1 Left
2 Centre
3 Right

Character Layout List

A Character Layout List is a LListB of Character Layout Codes. Character Layout Codes are almost always found in this form.

Character Layout Codes

As explained above, a Character Layout Code consists of a type byte, telling what kind of layout code this is, followed by a type-dependent amount of data.

Type Size Data  Description

18 B Set ??? on (01) or off (00)
19 3B Color Set text color
1A 3B Color Set ??? color (background?)
1B B Set ??? on (01) or off (00). Displayed with black background.
1C L Size Change character point size
1D B Italic on (01) or off (00)
1E B Bold on (01) or off (00
1F B Superscript (01) or subscipt (02) or off (00)
20 B Underline on (01) or off (00)
21 B Strikethrough on (01) or off (00)
22 * Font Change character font
23 B Unknown
24 B Unknown (5MX only): always 00 ?

Some remarks: several of the above codes are sometimes found in Word documents (especially after a clipboard copy from another program), but seem te be ignored by Word. This is more or less true for codes 18, 1A, 1B, 23 and 24. None of them can be generated directly by a Word user.



Psifiles | by Dr. Radut