TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Peter Fitzsimmons
date: 1997-02-07 15:13:56
subject: terminal emualtor class

PC> For example, how does a color syntax-highlighting editor know to print
 PC> a word in blue in the middle of the page, and print everything before
 PC> and after it in different colors (and then be able to scroll it off and
 PC> back onto the screen.

I recently had to code something like this (it was for printing,  not for
displaying -- the the issue was not colours but different fonts (which is
even worse than colours because the fonts can have a different highest, 
yet still be in the same line).

What I had to do was loose the concept of a "line",  and work
with a linked-list of "text runs".  A line becomes a linked-list
of runs (the line ends when the list ends).

Each run has a style (part of which can be colour), typeface, x coordinate,
and pel-width.  The pel-height has to be calculated by scanning the whole
run to find the tallest font.


--- Maximus/2 3.00
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 259/414 99 2424/38 11 10 12/12 396/1 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.