On Tue, May 6, 2014 at 11:06 AM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
>
> 04/05/2014 22:14, Vincent van Ravesteijn:
>
>> When selecting the first character, I see two things:
>>
>> 1) the connection between characters is lost (in master this is not the
>> case)
>> 2) the first character actually moves to the right on selection (while
>> you would expect that the rest of the word moves to the left because the
>> first character became wider on selection)
>
>
> OK, I have an idea for having correct selections without loosing the 
> Color_selectiontext enum: we could draw the complete string as selected and 
> non-selected, but use clipping to make sure that only the right part of the 
> selection is visible. It will be a bit tricky, but it is doable.
>
> However, the question is: do we want to keep this Color_selectiontext thing? 
> It makes all selection lose color, which is not very helpful. Therefore, we 
> could just decide to forget about that and just use Color_selection for the 
> background. Actually, I haven't found any wordprocessor-like application that 
> uses a selection background color.
>
> Pavel, Enrico, as users of weird color schemes, I need your input on that.
>
> The bigger problem will be cursor positioning, but I need more information 
> from people who understand Arabic writing to progress on that.
>
> I just noticed that we have no Arabic document (just a farsi splash.lyx) in 
> our doc. This is not very encouraging. Do we even have Arabic writers as 
> users?


I checked this morning. What looks very helpful is:

int QFontMetrics::width ( const QString & text, int len = -1 ) const

This function takes the whole string, like "coffee", and returns the
width up to the nth character. This takes into account the ligatures.
A problem though is that a ligature is taken as a single glyph. This
means for the coffee example, that the ff ligature causes the 3rd and
4rd position to return the same value. In this case it makes sense to
position the cursor in between, but there are of course ligatures
which change the shape of two characters completely, and then putting
the cursor in the middle is strange. See the first example in my
previous mail.

So, for the arabic characters, you'll get the width corresponding to
the actual glyph in the context. So, as an example, a standalone
character might return a width 30, and when the character is connected
to the next it might return 10.

Vincent

Reply via email to