Kaixo!

On Thu, Mar 17, 2005 at 09:24:23AM +0100, Werner LEMBERG wrote:
 
> Most importantly: If I have a wide character at position p which is
> followed by `\b' (at position p+2), is the final position p again?
> With other words, is the width of `\b' dependent on the width of the
> previous character?

It is supposed to be like that, yes.

But backspace is for interactive editing only, and different of
delete: backspace removes the previous *character*, while delete
removes the whole set of characters that form a column or ligature
conjunct.
A simple example, say that you have <g> followed by <combining tilde>,
that's two characters, first is of width=1, second of width=0;
the result should be a single column glyph g with tilde above.
Now, if you are after that column and hit backspace key, only
the combining tilde sould be removed, that is, the cursor keeps at
his place, bug "g with tilde" becomes a simple "g".
And if you have the cursor before the "g with tilde" and hit delete
key, the whole "g with tilde" (that is, two characters) is removed.

In groff what is needed is not interactive editing but positioning,
in such case I think that if the previous char is of zero width
then the positioning should start again iteratively, until a non zero
width char (or the begining of the line) is found.
eg, in the previous example, as the <combining tilde> is zero width
it is not enough to just "go back for 0 columns", as it will keep
the position after the "g with tilde", which is not the desired thing;
the thing to do is look the previous char, and so until a non-zero
width one is found;
so, the previous is <combining tilde>, it's zero width, so look
at the one previous to that one, it is <g>, of widh=1, so that means
the position has to go 1 column to to the left to be at the right
position to do whatever you want to do with the "g with tilde"
(like underlining it for example).

It's a bit more complex that just looking at the previous char, as
what matters for display are not chars, but rather "columns".

(and that is only for scripts that are simple, with a neat layout
of glyphs in columns; for indic scripts that is much more complex,
with chars doing ligatures, but groff is probably unable to handle
that anyway)

-- 
Ki �a vos v�ye b�n,
Pablo Saratxaga

http://chanae.walon.org/pablo/          PGP Key available, key ID: 0xD9B85466
[you can write me in Walloon, Spanish, French, English, Catalan or Esperanto]
[min povas skribi en valona, esperanta, angla aux latinidaj lingvoj]

Attachment: pgpN2WiGPTWk5.pgp
Description: PGP signature

Reply via email to