Page 133 Table of Contents Index Page 135
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 15. EXTENDED STREAM OUTPUT

the bottom of the previous line plus the stream's vertical spacing), a baseline, a bottom, and a
"cursor position". The cursor position is defined to be at the top of the line, not at the baseline.
The reason for this is that the baseline can move, but the top is relative to the previous line,
which has been completed and therefore doesn't move. If text is drawn on the current line whose
ascent is greater than the current ascent of the line, then the line is moved down to make room.
This can be done easily using the output records for the existing text on the line. When there
is enough room, the reference point for the text is the x position of the cursor at the baseline,
and the cursor position is adjusted by the displacement.

The following figures show this in action before and after each of three characters are drawn. In
all three figure, the small circle is the "cursor position". At first, there is nothing on the line.
The first character establishes the initial baseline, and is then drawn. The upper left corner of
the character is where the cursor was (as in the traditional model), but this will not remain
the case. Drawing the second character, which is larger than the first, requires moving the first
character down in order to get the baselines to align; during this time, the top of the line remains
the same. Again, the upper left of the second character is where the cursor was, but that is no
longer the case for the first character (which has moved down). The third character is smaller
than the second, so no moving of characters needs to be done. However, the character is drawn
to align the baselines, which in this case means the upper left is not where the cursor was. Nor
is the cursor at the upper right of the character as it was for the previous two characters. It is,
however, at the upper right of the collective line.


Page 133 Table of Contents Index Page 135
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E