From 6a319400ccb77f7783db793bbb114d8df47bde3e Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 10 Feb 2015 16:48:04 +1100 Subject: [PATCH] Fix

and rendering (shr-tag-h1): Don't use variable-pitch fonts on fontless rendering. (shr-tag-tt): New function. --- lisp/ChangeLog | 2 ++ lisp/net/shr.el | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8cb245cbeb..c4c329ef5ce 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -32,6 +32,8 @@ (shr-pixel-buffer-width): New function. (shr-render-td): Add a caching layer. (shr-dom-max-natural-width): New function. + (shr-tag-h1): Don't use variable-pitch fonts on fontless rendering. + (shr-tag-tt): New function. 2015-02-10 Fabián Ezequiel Gallina diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 06a75a46bf2..e929f48b5fd 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1168,6 +1168,10 @@ ones, in case fg and bg are nil." (defun shr-tag-u (dom) (shr-fontize-dom dom 'underline)) +(defun shr-tag-tt (dom) + (let ((shr-current-font 'default)) + (shr-generic dom))) + (defun shr-parse-style (style) (when style (save-match-data @@ -1451,7 +1455,9 @@ The preference is a float determined from `shr-prefer-media-type'." (shr-generic dom)) (defun shr-tag-h1 (dom) - (shr-heading dom '(variable-pitch (:height 1.3 :weight bold)))) + (shr-heading dom (if shr-use-fonts + '(variable-pitch (:height 1.3 :weight bold)) + 'bold))) (defun shr-tag-h2 (dom) (shr-heading dom 'bold)) -- 2.39.2