Subject: Re: bug#59606: flags take up so many columns

From: Kévin Le Gouguec <[email-masked]>
Date: Tue, 29 Nov 2022 08:44:06 +0100

Dan Jacobson <[email-masked]> writes:

> OK, sorry. It must be the noto fonts.
> '"No Tofu" font families with large Unicode coverage'.

Yes, as the describe-char output you posted confirms, Emacs defaults to
Noto Color Emoji (when available) to display emoji (specifically those
that either have Emoji_Presentation=Yes, or those that are followed by
VS-16.  Compare ⚠ with ⚠️).

So nothing surprising there, AFAIU.

> I suppose I will have to take it up with them.

Unless I missed something, you still haven't described what you are
seeing precisely (specifically, how many columns each emoji takes on
your setup), so it is not clear what you wish to "take up" to the Noto
developers.

(FWIW, I don't know what Emacs aims to do when faced with mixed fonts.
AFAICT it does not try to re-scale glyphs to make them match their
string-width, e.g. here Noto Color Emoji characters take up slightly
more than 2 "columns"; Symbola characters like 👁 are somewhere in
between:

  (dolist (char '("c" "⚠" "👁" "⚠️" "👁️"))
    (let ((font (font-at (1- (length char)) nil char)))
      (insert (format "%s: %d\n" char (string-pixel-width char)))))

  c: 9
  ⚠: 9
  👁: 15
  ⚠️: 19
  👁️: 19

Not saying Emacs should do anything more; just wondering what behaviour
users should expect there)