Re: Bidirectional support


Subject: Re: Bidirectional support
From: WJCarpenter (bill-abisource@carpenter.ORG)
Date: Fri Dec 15 2000 - 13:36:28 CST


>> The problem is that those strings of text have to be converted for
>> the "smart quote replacement" dohicky thingamabob.

lr> This happens EVERY TIME we draw?? Why isn't this just done once,
lr> during the "run coalescer" (as Martin called it). If the run
lr> isn't changing, there is no reason to constantly "smart quote
lr> replace" it.

That could certainly be done. The downsides are (1) storing the text
another time (since it's really remapGlyphs [not the SmartQuotes
feature], and that doesn't change the real text, just what is
displayed), and (2) a bit more complexity because you would have to
make sure that any change happening to the text in the run also
recomputed the remapGlyph'd text. Both of these downsides might be
acceptable if someone wanted to step up to doing the implementation
work.

>> then most of us end up having to convert the UCS2 characters to a
>> multibyte stream of UTF-8 characters.

lr> Given that memory is cheap, why not consider adding another field
lr> to the run structure to (optionally) store the UTF-8 version of
lr> the stream, so that, again, you only have to do this once?

This could be done per-platform, since some need it and some don't.
Actually, you could combine this with the previous suggestion to "save
another copy of the text" to make the save be in the platform-specific
preferred drawing format.

lr> Why? When you scroll, you don't need to be doing any recalc -
lr> just repainting already calc'd information.

Currently, I don't think AbiWord remembers the calculated stuff. It
uses it for immediate rendering and then forgets most of it.

lr> Not only that, but it prevents proper future handling of kerning
lr> pairs, ligatures, etc.

AFAIR, all of the platforms has width-calculating code that tallied up
the widths of all the individual characters and took the total as
AbiWord's idea of the width of the string. If any platform's renderer
did kerning, ligatures, etc, that could make that assumption false.
So, such platforms would have to start having a real string width
function. Not a big deal, but something to remember.

(I was the one who originally made the string width function into XP
and implemented in terms of a platform-specific character width
function. I think all the platform-specific string width calculators
that got replaced just iterated over the characters and got a total
anyhow. Hope I'm not misremembering.)

-- 
bill@carpenter.ORG (WJCarpenter)    PGP 0x91865119
38 95 1B 69 C9 C6 3D 25    73 46 32 04 69 D6 ED F3



This archive was generated by hypermail 2b25 : Fri Dec 15 2000 - 13:36:22 CST