home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / acorn / 8371 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.1 KB

  1. Path: sparky!uunet!comp.vuw.ac.nz!waikato.ac.nz!bwc
  2. From: bwc@waikato.ac.nz (Ug!)
  3. Newsgroups: comp.sys.acorn
  4. Subject: Re: How *does* one write a good text editor?
  5. Message-ID: <1992Aug27.160053.10398@waikato.ac.nz>
  6. Date: 27 Aug 92 16:00:53 +1200
  7. References: <18053@acorn.co.uk>
  8. Organization: Vooniersity fo Kaiwato
  9. Lines: 21
  10.  
  11. Philip Colmer writes:
  12. > If you were writing a text editor which allowed text effects (eg font
  13. > changes, colour changes, etc) to be applied, how would you hold the
  14. > data? My initial thoughts are:
  15.  
  16. This is a *text* *editor*?  How do you save the effects without having
  17. some sort of formatting information added to the text?
  18.  
  19. >   * keep the text as one contiguous block of memory
  20. >   * keep a linked list of effects, specifying the effect to be applied
  21. >     and the start and end character offset for the effect
  22. >   * keep a linked list of line start offsets.
  23.  
  24. Or: embed the effects.  I'd imagine this would be slower.  Perhaps a
  25. combination of the two:
  26.  
  27.     <effect><text-length><text...>
  28.  
  29. Then to render it you would simple render what amounts to a list of
  30. effect/text combinations.
  31.                             Ug!
  32.