Subject: Re: patch: SmartQuotesEnable preference item
From: WJCarpenter (bill-abisource@carpenter.ORG)
Date: Mon Jul 17 2000 - 15:50:59 CDT
sam> What we could do is have the glyphs remapped in memory to smart
sam> quotes, but stored in the .abw file as normal quotes. This would
sam> have the benifits I outlined earlier.
tf> While interesting, I think that you would need to have some state
tf> knowledge that you would have to maintain between calls to the
tf> remapGlyphs code. This state information would be a pain to have
tf> to maintain, and I'm almost certain that doing so would introduce
tf> some very subtle bugs.
That is certainly true as remapGlyphs() is implemented today because
it was meant to deal only with remapping a character in isolation,
modulo some user preference items. (Let's ignore for now that
remapGlyphs() is about weak font support, not about smart quotes.)
remapGlyphs() could be re-implemented to know some context, which
might be slightly less dodgy. I think you would only need to know
three things to decide (modulo user preference items):
1. current character ... is it one of the 3 ASCII quotes?
2. thing before
3. thing after
"Thing before" and "thing after" are either a specific character or an
indication of an interesting break (e.g., column break, paragraph
break, etc). This is all pretty easy if you're looking at a block of
existing text, or a block that is being pasted in. It's a bit
trickier to do as-the-user-types because "thing after" will soon
change. So, rather than carrying state in remapGlyphs(), you have to
carry it somewhere else to remember to go back and schedule the
previously drawn glyph for a redraw in the new context.
Perhaps that is the state stuff you had in mind. I agree there is a
risk there. Above, I just wanted to sketch out a plan whereby I think
it could be done. It is, in any case, tricky.
-- 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 : Mon Jul 17 2000 - 15:53:25 CDT