Re: Commit: fonts part 2 & 3


Subject: Re: Commit: fonts part 2 & 3
From: Paul Rohr (paul@abisource.com)
Date: Mon Mar 19 2001 - 17:01:32 CST


At 07:38 PM 3/19/01 +0100, Jesper Skov wrote:
>Ah! These are cached copies of properties. I'm sorry if I offend, but
>I just have to say: how incredibly crude :)
>
>So there's a nice indexed property array with all the info needed to
>render a Run. To speed up rendering, instead of improve the way to
>access this information, it gets copied to each and every Run.
>
>That's like reverse-caching (assuming "normal" caching is a way of
>concentrating the information you access often in the same location -
>here it gets spread out :)

Not quite. Before your design sensibilities get too offended, please read
the code in question. ;-)

To lookup a specific property for a given run, you have to do a
PP_EvalProperty on *three* attrprops -- span, block, and section. Inside
the implementation of that function, you'll see that real work gets done,
deciding whether to use an explicit property, or a style, or a basedon
style, etc. and pulling the appropriate entry out of the correct hash.

The thought was that you don't want to be doing all this lookup activity at
draw time, so the results of that lookup are "cached" in the run. It's a
space vs. time tradeoff that I made when runs worked more sanely.

>I've always been puzzled by this. Seeing as the undo information is
>represented as indexes in the PT it seems obvious to to continuous
>coalescelation(?) of Runs while typing - that (undo) is the only thing
>I could think of that would have wanted single-char Runs.

As I said, I forget who did this or why, but I've never been thrilled about
it. Jeff and I worked hard to make sure that typing would *not* produce
unnecessary single-char runs.

>Hm... I think I've just canned all plans for hacking more on the
>existing implementation. As has just been demonstrated (again) there
>are too many design decisions / hacks to the code which is not
>documented - and as I'm not paid to work on AbiWord there's just too
>little time for me to discover all this by reading the code and piece
>it together from that. *sigh*

Sorry. All I can do is explain the original design. I can't explain why it
got hacked. There must have been a reason, I trust, but I don't know what
it was, or whether it was a good idea.

By now, it ought to be crystal clear to anyone reading this list that I can
get pretty finicky about people taking shortcuts without understanding what
a complete solution would entail. Too much so, at times, no? ;-)

>I'll stick to fixing the odd interesting bug and look at integrating
>Pango support.

Anything you can do to help will be welcome.

>Thanks for the info, Paul!

That's what I'm here for.

Paul
motto -- set a breakpoint, step through the code, *then* complain



This archive was generated by hypermail 2b25 : Mon Mar 19 2001 - 16:53:56 CST