all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: ndame <emacsuser@freemail.hu>
Cc: 40508@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <87zh7ymd81.fsf@gnus.org> (raw)
In-Reply-To: <Aybc2w.v0VqA7FAu3c4.da1fsLniOLFnmF91lWO@freemail.hu> (ndame's message of "Wed, 8 Apr 2020 16:37:35 +0200 (CEST)")

ndame <emacsuser@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





  reply	other threads:[~2020-07-17 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 14:37 bug#40508: 26.2; shr does not make h1 tag larger if variable-pitch font is set ndame
2020-07-17 14:24 ` Lars Ingebrigtsen [this message]
2020-07-29  7:49   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh7ymd81.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=40508@debbugs.gnu.org \
    --cc=emacsuser@freemail.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.