[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: less & composing characters - fix



Thanks Nadim.

That definitely makes sense, but I'm not sure if it's right to
incorporate these changes at this stage.  Because of a few
reasons.

  * Most important one is that we don't know how a bidi-enabled
terminal should act.  Should it make ligatures or not?  Should it
only make LA ligature or some optional ones?  A solution is to
make a double-width LA ligature.

  * About Non-Spacing Marks like Fatha it makes more sense.  But
again, the problem is that:  Terminals like xterm and probably
mlterm, put the mark on top of the character, so no width
allocated for the mark.  But what we're gonna do in Linux
console?  There (as done by BiCon now), a non-spacing mark still
occupies a single width.  So how's less gonna handle this case?


The best I can suggest is to simply use the de facto standard
wcwidth function by Markus Kuhn and do not handle special cases
any more.  At least until we have a consensus on how to handle
this kind of things.

behdad



On Mon, 23 Feb 2004, Nadim Shaikli wrote:

> --- Behdad Esfahbod <behdad at cs dot toronto dot edu> wrote:
> > Can you briefly tell us what kind of fixes do you mean?
>
> I believe it had to do with composing characters and how 'less'
> treated the line.  If my memory is correct, while using mlterm
> (where shaping and bidi is taken care of for you), the line
> length would count each character as a character that is taking
> up a single character width which is not necessarily true.  In
> other words if I had (assume L is for LAM and A for Alef)
>
>  LALALALALALALALA
>
> The line width that less would calculate would be as noted above
> when in reality (and visually) it needs to be (assume X for LAA,
> the combined LAM+ALEF glyph),
>
>  XXXXXXXX
>
> and so a line with lots of LAA's in it would spill over visually
> in less's mind and would not look right (try it) and I simply
> corrected that problem (and there were a few other minor things
> which I don't remember of the top of my head - its been a LONG
> time now).
>
> Hope that makes sense.
>
> Salam.
>
>  - Nadim