Subject: Re: Commit: fonts part 2 & 3
From: Paul Rohr (paul@abisource.com)
Date: Mon Mar 19 2001 - 11:16:13 CST
At 11:58 AM 3/18/01 +0100, Jesper Skov wrote:
>The alternative implementation I'm after will not be less powerful -
>it simply moves all the properties into special property objects which
>are maintained on a separate list.
>
>So we get something like:
>
>Property                 Att_0  Att_1  ...  Att_N
>-------------------------------------------------
>font                       .      .    ...    .
>ascent                     .      .    ...    .
>descent	                   .      .    ...    .
>superscript                .      .    ...    .
>subscript                  .      .    ...    .
>underline                  .      .    ...    .
>overline                   .      .    ...    .
>strikethrough              .      .    ...    .
>FG color                   .      .    ...    .
>(other properties...)
>
>and the matching
>
>Property                 Run_0  Run_1  Run_2  Run_3  ...  Run_N
>---------------------------------------------------------------
>attributes               Att_0  Att_0  Att_1  Att_0  ...  Att_x
Jesper, 
You've just described Jeff's underlying attrprop mechanism as used in the 
Piece Table.  As an experiment, why not try profiling some mods which do 
lookups against the AP directly, instead of from the cached copies in each 
Run?
Off the cuff, I'm not sure you'll see the kind of impact you want.  Consider 
which operation is more common:
  - drawing or doing other calculations from an existing run
  - splitting runs due to edit operations
The idea of caching run-level props is to mimimize the amount of code it 
takes to draw, which ought to be the most common operation in a GUI app.  Or 
are you seeing nasty delays during typing?  
On a related note, one of the chief sources of run bloat today is the fact 
that runs aren't properly coalesced when typing.  When Jeff and I originally 
implemented editing, we did all the work necessary to make sure that 
additional characters typed with the same property would be appended to the 
same run, and runs would only be split by the line breaker.  (We also 
thought about rejoining such runs when the content got reflowed, but I don't 
think we bothered implementing that.)
However, quite a while ago either Eric or Bruce introduced a change to force 
every character typed into its own run.  (Ick.)  IIRC, this might have been 
part of the effort to fix character overhang problems, but I'm not sure.  
You'll have to ask them.  :-)
If you're concerned about run bloat, you might want to look at what would 
happen if we *did* go back to coalescing runs properly instead.
Paul
This archive was generated by hypermail 2b25 : Mon Mar 19 2001 - 11:09:18 CST