]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix <h1> and <tt> rendering
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Feb 2015 05:48:04 +0000 (16:48 +1100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 10 Feb 2015 05:48:04 +0000 (16:48 +1100)
(shr-tag-h1): Don't use variable-pitch fonts on fontless rendering.
(shr-tag-tt): New function.

lisp/ChangeLog
lisp/net/shr.el

index d8cb245cbebefc42657b708421f51de64e8252ae..c4c329ef5cee8beeefc3d42941e3d5b7ac4acfd6 100644 (file)
@@ -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  <fgallina@gnu.org>
 
index 06a75a46bf20d9e27667b91abbe34bb2d45eeecb..e929f48b5fd521489c58f195744c682f08aa5002 100644 (file)
@@ -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))