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.

Full log


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




This bug report was last modified 4 years and 296 days ago.

Previous Next


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