unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40508: 26.2; shr does not make h1 tag larger if variable-pitch font is set
@ 2020-04-08 14:37 ndame
  2020-07-17 14:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: ndame @ 2020-04-08 14:37 UTC (permalink / raw)
  To: 40508

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

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)))
 

[-- Attachment #2: Type: text/html, Size: 634 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#40508: 26.2; shr does not make h1 tag larger if variable-pitch font is set
  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
  2020-07-29  7:49   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-07-17 14:24 UTC (permalink / raw)
  To: ndame; +Cc: 40508

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#40508: 26.2; shr does not make h1 tag larger if variable-pitch font is set
  2020-07-17 14:24 ` Lars Ingebrigtsen
@ 2020-07-29  7:49   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-07-29  7:49 UTC (permalink / raw)
  To: ndame; +Cc: 40508

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-29  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-07-29  7:49   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).