emacs-devel
[Top][All Lists]
Advanced

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

Re: Can watermarking Unicode text using invisible differences sneak thro


From: Eli Zaretskii
Subject: Re: Can watermarking Unicode text using invisible differences sneak through Emacs, or can Emacs detect it?
Date: Mon, 24 Jan 2022 14:14:06 +0200

> From: Richard Stallman <rms@gnu.org>
> Cc: psainty@orcon.net.nz, luangruo@yahoo.com, emacs-devel@gnu.org
> Date: Sun, 23 Jan 2022 23:33:59 -0500
> 
>   > We don't have a way of determining whether a terminal can display
>   > ligatures.
> 
> Could we do it via terminfo?  We can define any capabilities we like.

I don't think this is feasible.  But before we discuss this, I think
we need to clear some fundamental misunderstanding about this, see
below.

>   > > I doubt any user wants to see a diamond instead of `fi'.
> 
>   > Is this what really happens for you, on your terminal?
> 
> Yes.  A few days ago I put point on a diamond, typed C-u C-x =,
> and was told it was a ligature for `fi'.

How did that ligature get written to the screen?  Was it present
literally in some text that Emacs displayed?  If not, how did it come
into existence, in the form of a diamond?  Emacs doesn't produce such
ligatures on TTY frames.

> I didn't save details of what text I was looking at, but I suspect
> it was a web page that a script fetched and emailed to me.

If that web page included a literal fi ligature, there's little we can
do in Emacs, because we don't produce that character.  Of course, one
can set up a display table where ligatures like fi are displayed as
two characters, but that is a separate issue, very far from what we
were discussing in this thread.  So let's please leave the literal fi
display alone, because it will take us far away from the original
issue.

The original issue is with sequences of characters that are supposed
to be composed on display, because that's where the zero-width
characters play their role.  When several characters are supposed to
be composed on a text-mode display, Emacs simply writes them to the
terminal one after another, and expects the terminal to display them
as a ligature.  The only difference between what Emacs does in this
case and what it does when no character composition is expected is
that in the former case Emacs expects the terminal to produce just one
glyph that takes just one column on display.  Emacs never actually
writes the ligature's code to the TTY, unless that code is literally
present in the text.

So I don't see how querying the terminal about ligature support will
help us in the case we are discussing, nor do I see how is that
relevant.  In any case, ligature support is not just the ability of a
terminal, it also requires certain features from the font used to
display text, and on TTY frames Emacs doesn't know which font is being
used where.  Moreover, there's any number of possible ligatures, and
which ones are supported depends on the font, so a question like "are
ligatures supported" has no meaningful answer unless you also specify
the font and the particular ligature.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]