GNU bug report logs - #46971
28.0.50; Fontifications in Info buffers break alignment in @multitable

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sat, 6 Mar 2021 17:17:01 UTC

Severity: minor

Found in version 28.0.50

Full log


Message #11 received at 46971 <at> debbugs.gnu.org (full text, mbox):

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Stefan Kangas <stefan <at> marxist.se>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 46971 <at> debbugs.gnu.org
Subject: Re: bug#46971: 28.0.50; Fontifications in Info buffers break
 alignment in @multitable
Date: Sat, 02 Oct 2021 07:56:40 +0300
On 2021-09-26, 07:34 -0700, Stefan Kangas <stefan <at> marxist.se> wrote:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> To reproduce:
>>
>>   emacs -Q
>>   C-u C-h i ../info/elisp.info RET
>>   C-s Syntax name
>
>> You should now see the table of syntax categories.  The characters in
>> the rightmost column don't align, which looks ugly.
>>
>> This happens because font-lock is instructed to do this:
>>
>>   (defvar Info-mode-font-lock-keywords
>>     '(("‘\\([‘’]\\|[^‘’]*\\)’" (1 'Info-quoted))))
>>
>> Thus the quotes and the quoted text use different faces, and if those
>> faces use different fonts (as they do by default), the table will not
>> be aligned.
>>
>> One possible solution would be to modify Info-mode-font-lock-keywords
>> such that the quotes are also fontified in Info-quoted face.
>
> That fix solves this issue in "emacs -Q" here, but not in my personal
> Emacs configuration where I use a different font.
>
> In "emacs -Q" I have these fonts for the column text (1), and the
> whitespace in between columns (2), and everything lines up:
>
>   1. ftcrhb:-bitstream-Courier 10
> Pitch-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1 (#x08)
>   2. ftcrhb:-Bits-Bitstream Vera Sans
> Mono-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1 (#x03)
>
> With my personal configuration, I have these fonts for the column text
> (1), and the whitespace in between (2), and the alignment is wrong (see
> screenshots below):

Hello Stefan,

The reason you are getting two distinct fonts is because the
'Info-quoted' face is inheriting from 'fixed-pitch'.

Does the alignment get fixed if you make fixed-pitch use the same font
as the default?  Such as with this:

    (set-face-attribute 'fixed-pitch nil
                        :family (face-attribute 'default :family)
                        :height (face-attribute 'default :height))

All the best,
Protesilaos

-- 
Protesilaos Stavrou
https://protesilaos.com

This bug report was last modified 3 years and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.