Subject: Re: bug#53729: 29.0.50; Tamil text not shaped in modeline

From: Visuwesh <[email-masked]>
Date: Thu, 10 Feb 2022 18:39:42 +0530

[வியாழன், பிப்ரவரி 03 2022] Visuwesh wrote:

> [வியாழன், பிப்ரவரி 03 2022] Eli Zaretskii wrote:
>
>>> I suppose so but I'm confident that "Noto Serif Tamil" is the font used
>>> in the modeline.  The only other Tamil font I have installed is "Noto
>>> Sans Tamil" and I can easily make out the difference between the two.
>>> Font selection does not seem to be the problem, at least.
>>
>> It could be that Emacs selects some variant of Noto Serif Tamil (some
>> weight or maybe width) which causes this.
>
> Right.  I know I cannot trust my eyes but it seems to be the bold font
> but I will step through in gdb.
>
>> Btw, can you try this with other fonts and see if any of them displays
>> the buffer name correctly in the mode line?
>>
>
> I tried "Lohit Tamil" but the text is not shaped properly when I use it
> too, and the (incorrect) shaping is different from what I observe when I
> use "Noto Serif Tamil".  I will try other fonts over the weekend and
> report back.
>

Things were a little more busier than I thought: I finally sat down and
tested other fonts, and the situation has gotten even more confusing!

I tried all the Tamil fonts in Google fonts and to ease the checking
process, I wrote the following Elisp snippet:

    (with-current-buffer (get-buffer-create "அக்னிச்சிறகுகள்.pdf")
      (switch-to-buffer-other-window "அக்னிச்சிறகுகள்.pdf")
      (let ((fonts '("Arima Madurai"
                     "Baloo Thambi 2"
                     "Catamaran"
                     "Coiny"
                     "Hind Madurai"
                     "Kavivanar"
                     "Meera Inimai"
                     "Mukta Malar"
                     "Oi"
                     "Pavanam"
                     "Noto Sans Tamil"
                     "Noto Serif Tamil"
                     "Lohit Tamil"))
            (i 0)
            (die nil))
        (while (not die)
          (erase-buffer)
          (insert "அக்னிச்சிறகுகள்")
          (set-fontset-font "fontset-default" 'tamil (cons (nth i fonts) "iso10646-1"))
          (pcase (read-char-choice
                  (format "%s ([n]ext, [p]rev, [q]uit): " (nth i fonts))
                  '(?n ?q ?p))
            (?q (setq die t))
            (?n (setq i (mod (1+ i) (length fonts))))
            (?p (setq i (mod (1- i) (length fonts))))))))

and the buffer name in the modeline has the right shaping!  This is the
case for _every_ font I tried: including Noto Serif Tamil.  But if I
open a file named "அக்னிச்சிறகுகள்.pdf", the shaping is as in the OP.

Here's a screenshot of the Emacs frame (this is in emacs -Q):

>>> In either case, I think I can only get to this in two weeks.  And is the
>>> information in etc/DEBUG all I need (except the breakpoint which will be
>>> provided?)?
>>
>> It should get you started, yes.  There are special commands defined in
>> src/.gdbinit that will help showing Lisp objects, and feel free to ask
>> for guidance if you aren't sure how to proceed or have any questions.
>>

Given the above strangeness, can you please instruct me to use gdb to
stab Emacs?  Thanks.