Show invisible characters (tab, space, return) in field

hh hh at hyperhh.de
Sat Dec 8 11:23:42 EST 2018


> Kaveh wrote:
> On the live conversion, you are adding a unicode character before
> a space, say. That means two characters and therefore two character
> widths. Is there a way of making spaces zero width, or the new characters
> overlapping the space etc? Ideally I want the text widths of lines to be
> the same with and without the visible chars.

No. I don't replace a space with a unicode char and a space but with a
unicode char and *the smallest word-breaking space in unicode (hair space)*.

You could try to use an accent to a space but this isn't word breaking any
more.

The zero width space is non word-breaking in LC and an opportunity of word
breaking elsewhere.
What you should have also in mind with these solutions is that it must be
clear for the user what he is selecting, so inserting zero width chars will
make selecting random down to 2 chars.

The only char with a negative space in unicode I know of is the
MONGOLIAN VOWEL SEPARATOR, see http://jkorpela.fi/chars/spaces.html
All these spaces are possible if someone copies text from a UTF-8 web page
and pastes into your field!!

As you don't have access to a word break table you have to write your own
word-breaking algorithm ...






More information about the Use-livecode mailing list