[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit and StyleIte



Brian Hammack writes ...
> 
>  Jeff outgassed these fumes:
> 
>  CN(| I have to pick a nit here.  :-)
> 
> You can attract more flies with honey than with vinegar, but what you do
> in your spare time is your own business.  :)
>

     And, then, there's that bogus advice: "Time flies." (Okay; but,
where do you send your data?)

 
>  CN(| It is greater than 1023 STYLE changes.  This includes changing
>     | the foreground colour, background colour, font, font size, font
>     | style (bold, italic, etc) or justification.
> 
> Okay, noted (and I think Nathan had used the word "style" too).  Pardon
> for my specifying only "color" but y'all know what I mean -- who expects
> 2^10 changes of ANY sort in a text?  Two dozen in a 30k Teach document
> is all the average person not content to using none at all would use...
>

     Even so, it brings up an interesting question. Wouldn't the Text
Tool be faster, more versatile, and less bomb-prone if it dealt with
each character as an independent element?

     For example, suppose we assign 16 bits to each character-- 8 for
the char 'Name' ("A", "+", etc.) and 8 for 'Styling': the char's Font,
Size, Style, color, and background color.

    8 bits gives us 256 possible Styling combinations which would be
retained in a 256-element array. The elements array would be updated
whenever a new Styling is created or a current Styling is eliminated.

    Very, very few documents will employ anything close to 256 different
Styling combinations. For example, Antoine's trick of alternating
character color would add just one new element to the Styling array.

    Should a user make the attempt-- as in displaying 100 different
Fonts in all available styles-- it would be easy for Text Tool to detect
and deal with. It could display an Error msg and refuse to accept an
additional Styling; or, better, it could offer the user a choice of
possible adjustments, such as Font, background color, etc. mods.

    The most user-friendly solution would be to offer to enlarge the
Styling array to 64k elements. If we stick with a 'keep it simple'
approach, the cost would be another 8 bits per character of document
storage.

    Text Edit's current approach, which appears to involve serial
encoding, is, probably, pretty good at conserving memory; but, it is
prone to overflow in relatively common situations-- i.e. wishing to have
characters show up in alternately colored columns is not especially
weird. Text Edit would be likely to strangle on a document displaying
positions for any of the major chess openings.


Rubywand






    

    




 
>  * 2qwk! 2.04 * The proctologist called; they found your head.
> --                                                                   --
> yet another annoying post by brian.hammack@rook.wa.com -- deal with it.

-- 
Rubywand