GNU bug report logs - #40508
26.2; shr does not make h1 tag larger if variable-pitch font is set

Previous Next

Package: emacs;

Reported by: ndame <emacsuser <at> freemail.hu>

Date: Wed, 8 Apr 2020 14:38:01 UTC

Severity: normal

Tags: notabug

Found in version 26.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40508 in the body.
You can then email your comments to 40508 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#40508; Package emacs. (Wed, 08 Apr 2020 14:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to ndame <emacsuser <at> freemail.hu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 Apr 2020 14:38:02 GMT) Full text and rfc822 format available.

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

From: ndame <emacsuser <at> freemail.hu>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.2;  shr does not make h1 tag larger if variable-pitch font is set
Date: Wed,  8 Apr 2020 16:37:35 +0200 (CEST)
[Message part 1 (text/plain, inline)]
If you change the font of the default variable-pitch face

(set-face-font 'variable-pitch "Arial-15")

then shr renders h1 tags as regular size text.

This is because variable-pitch is listed first in the face  setting and
if it is set with size then it overrides the settings coming later:

(defun shr-tag-h1 (dom)
  (shr-heading dom (if shr-use-fonts
               '(variable-pitch (:height 1.3 :weight bold))
             'bold)))
 
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40508; Package emacs. (Fri, 17 Jul 2020 14:25:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <emacsuser <at> freemail.hu>
Cc: 40508 <at> debbugs.gnu.org
Subject: Re: bug#40508: 26.2;  shr does not make h1 tag larger if
 variable-pitch font is set
Date: Fri, 17 Jul 2020 16:24:14 +0200
ndame <emacsuser <at> freemail.hu> writes:

> If you change the font of the default variable-pitch face
>
> (set-face-font 'variable-pitch "Arial-15")
>
> then shr renders h1 tags as regular size text.
>
> This is because variable-pitch is listed first in the face  setting and
> if it is set with size then it overrides the settings coming later:
>
> (defun shr-tag-h1 (dom)
>   (shr-heading dom (if shr-use-fonts
>                '(variable-pitch (:height 1.3 :weight bold))
>              'bold)))

Would reversing the order fix this problem?  Untested patch below.

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index d6bdb4c17e..ea74316a74 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1916,7 +1916,7 @@ shr-tag-span
 
 (defun shr-tag-h1 (dom)
   (shr-heading dom (if shr-use-fonts
-		       '(variable-pitch (:height 1.3 :weight bold))
+		       '((:height 1.3 :weight bold) variable-pitch)
 		     'bold)))
 
 (defun shr-tag-h2 (dom)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40508; Package emacs. (Wed, 29 Jul 2020 07:50:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ndame <emacsuser <at> freemail.hu>
Cc: 40508 <at> debbugs.gnu.org
Subject: Re: bug#40508: 26.2;  shr does not make h1 tag larger if
 variable-pitch font is set
Date: Wed, 29 Jul 2020 09:49:44 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> This is because variable-pitch is listed first in the face  setting and
>> if it is set with size then it overrides the settings coming later:
>>
>> (defun shr-tag-h1 (dom)
>>   (shr-heading dom (if shr-use-fonts
>>                '(variable-pitch (:height 1.3 :weight bold))
>>              'bold)))
>
> Would reversing the order fix this problem?  Untested patch below.

Well, no, and the order isn't the problem at all -- it's that if you set
the font that way in a face, it doesn't really matter what else you add
to the spec afterwards, as far as I can see.

If what you were trying to achieve was to make the face bigger, then you
can increase the size by (for instance) 20% with this:

(set-face-attribute 'variable-pitch nil :height 120)

So this isn't an eww bug, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Jul 2020 07:51:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 40508 <at> debbugs.gnu.org and ndame <emacsuser <at> freemail.hu> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Jul 2020 07:51:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 11:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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