diff options
author | Holger Dürer <me@hdurer.net> | 2018-03-05 20:41:42 +0000 |
---|---|---|
committer | Holger Dürer <me@hdurer.net> | 2018-03-05 20:48:00 +0000 |
commit | 1e6b9b0b84c52a7d7cc94173079251dad0c2abbd (patch) | |
tree | 0240110c658f0f06ab69c225e099cc03ccefb2f8 /lisp | |
parent | a5d0c22e0cab6771d3fc3e7e7244de32d497c994 (diff) |
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.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-tl.el | 9 |
1 files changed, 8 insertions, 1 deletions
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. |