From 1e6b9b0b84c52a7d7cc94173079251dad0c2abbd Mon Sep 17 00:00:00 2001 From: Holger Dürer Date: Mon, 5 Mar 2018 20:41:42 +0000 Subject: Add a new customization flag to switch between using fixed width or proportional fonts. The default stays as is now to use fixed width fonts. --- lisp/mastodon-tl.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 58b50ab..c78211d 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -55,6 +55,11 @@ keep the timestamps current as time progresses." :group 'mastodon-tl :type '(boolean :tag "Enable relative timestamps and background updater task")) +(defcustom mastodon-tl--enable-proportional-fonts nil + "Nonnil to enable using proportional (rather than the default fixed width) fonts when rendering HTML." + :group 'mastodon-tl + :type '(boolean :tag "Enable using proportional rather than fixed width fonts when rendering HTML text")) + (defvar mastodon-tl--buffer-spec nil "A unique identifier and functions for each Mastodon buffer.") (make-variable-buffer-local 'mastodon-tl--buffer-spec) @@ -311,7 +316,9 @@ TIME-STAMP is assumed to be in the past." "Returns a propertized text giving the rendering of the given HTML string." (with-temp-buffer (insert string) - (let ((shr-use-fonts nil)) + (let ((shr-use-fonts mastodon-tl--enable-proportional-fonts) + (shr-width (when mastodon-tl--enable-proportional-fonts + (window-width)))) (shr-render-region (point-min) (point-max))) ;; Make all links a tab stop recognized by our own logic and ;; update keymaps where needed. -- cgit v1.2.3