Re: Caret

From: Philippe Verdy <>
Date: Tue, 13 Nov 2012 18:29:33 +0100

2012/11/13 George W Gerrity <>

> Red and Green are NOT good colours to use, since the most common form of
> colour blindness (from memory, 7% of the male population, 0.3% of the
> female population) is red-green confusion, and the two cursors will appear
> as slightly different brightnesses of the same colour. The next most common
> (quite rare!) is blue-yellow confusion, and the least common is total
> colour blindness. Yellow is always a bad colour to choose, because it
> cannot be seen easily against a white background, so if you wish to use a
> colour queue, you are limited to red and blue. A better choice is cursors
> of either distinct shape or different thickness.

Also I don't like colors for this type of display.

I think tht appropriate caret forms can disambiguate things: a small
arrowhead attached at the top or bottom of the "vertical" line (or attached
to one side of a block caret), pointing in the correct left or right
direction is much better, and less ambiguous to read and interpret. Also
more accessible.

The caret anyway will be displayed in the same color as the text when it
covers a bank area, but will better work if it reverses the background and
foreground color. If there's no background color defined, it should still
work as if the background was transparent, still in XOR mode (using an RGBA
color schme and not just RGB). But the caret will remain a glyph to adjust
depending on fonts to which they are attached.

Normally single carets are attached to a font style matching the style of
the character that will be typed if you insert one, so it has a style by
itself, even if it can be using several forms depending on working mode
(basically the insert mode or overwrite mode, some editors only support one
of these modes and may choose one of these forms or another : insert carets
are typically thin vertical lines, but they can still add a small arrow
head; overwrite modes are typically block-forms, either covering the whole
character composition block, or just a small underline, but here also an
arrow head can be displayed where needed).

Then Eli Zaretskii wrote :
> As an example, consider the following well-known gotcha. Logical
> order:
> Visual order:
> ^
> Now, as soon as you type X, a strong RTL character, at the caret
> (making the logical order HEBREW-Xa), you get this on the screen:

This is not the case where two carets are needed. Sorry I reformulate his
text because positioning carets in plain-text on another line does not work
properly. He speaks about the case where the current text is "HEBREW-a"
with the insertion point between the weak hyphen "-" and Latin "a".

Only one caret is still needed in this case ir appears as:


(where I not the single caret with "|"). You cannot position a second caret
to the left of the displayed letter W. simply because the weak hyphen is no
longer RTL but LTR just like the letter "a" that follows to the right. The
insertion caret is then pointing to the right if you display an arrow head
on it.

But if you type another hebrew letter, it will change the direction of the
weak hyphen, which will then be "moved" visually. It you type a Latin
letter, it will not move. But the same would be true if this was a space
instead of an hyphen. The rationale is that we are on the separation
between two words, and the caret if nearer from the Latin word than the
Hebrew word. The direction indicated by the caret arrow head is then
correctly showing the *current* status. The editor cannot predict if you'll
type here a Latin letter or an Hebrew letter, but the visual rendering has
*already* chosen to apply an LTR visual ordering for the weak hyphen or
space, simply by applying the BiDi algorithm.

  * If you type another weak character (e.g. another hyphen), you'll get a
single caret:

  * If you type a Latin letter there (e.g. "y") you'll still get a single

  * If you type a Euro-Arabic digit (say "0" here), you'll get a single
caret because the UBA does not indicate any change of direction at the
insertion point:

  * If you type an Hebrew letter there (noted X here), you'll get two
carets because this time we weill be between two characters with opposite
strong directions:

  * If you type a Perso-Arabic digit (say "4" here), you'll get two carets
for the same reason (two strong directions):

(with "^" being the left-pointing insertion caret and "_" being the
right-pointing insertion caret : their direction ***should*** be made
visible with an arrow head, unlike the cases where a single caret "|" is
enough, and where the arrowhead is not absolutely needed, but if there is
one, it should be pointing in the correct direction which is the same
visual direction determined by the UBA for the previous and the next
Received on Tue Nov 13 2012 - 11:38:52 CST

This archive was generated by hypermail 2.2.0 : Tue Nov 13 2012 - 11:39:00 CST