[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pdf-tools 1f91ba8894 09/16: Render crisp images for HiDPI
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pdf-tools 1f91ba8894 09/16: Render crisp images for HiDPI screens by default |
Date: |
Tue, 29 Nov 2022 01:59:30 -0500 (EST) |
branch: elpa/pdf-tools
commit 1f91ba8894e3820faa82e5cc95a0de163c461cb0
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>
Render crisp images for HiDPI screens by default
Copying from the README:
> `pdf-tools` version `1.1.0` release changed the default value of
> `pdf-view-use-scaling` to `t` (previously, it was `nil`). This has
> been done keeping in mind that most modern monitors are HiDPI
> screens, so the default configuration should cater to this user. If
> you are not using a HiDPI screen, you might have to change this
> value to `nil` in your configuration.
Closes: #133
---
NEWS | 20 ++++++++++++++++++--
README.org | 8 ++++----
lisp/pdf-cache.el | 6 +++---
lisp/pdf-util.el | 24 ++++++++++++++++--------
lisp/pdf-view.el | 8 ++++----
5 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/NEWS b/NEWS
index 00d2d5c06d..1ff8c77045 100644
--- a/NEWS
+++ b/NEWS
@@ -2,8 +2,24 @@
* Version 1.0.0 (Under Development)
From this version onward, we will follow Semantic Versioning for new
~pdf-tools~ releases.
-** Raise the minimum supported version of Emacs to 26.1
-Drop support for Emacs 24 and 25. This allows for some code cleanup.
+
+** Breaking changes:
+*** Raise the minimum supported version of Emacs to 26.3 #26
+Drop support for Emacs 24 and 25. This allows for some code cleanup. *This is
a major breaking change*.
+*** Change the default value of pdf-view-use-scaling #133
+~pdf-view-use-scaling~ is now true by default, leading to rendering of crisp
images on high-resolution screens. This should not cause problems on
low-resolution screen (other than taking up more cache space / increasing
rendering time), but if it does, please ~(setq pdf-view-use-scaling nil)~ in
your configuration.
+
+** Improve overall user experience
+- Set ~pdf-annot-list-highlight-type~ to true by default.
+ + Show annotation color when listing them by default, allow the user to turn
them off if need be.
+
+** Make changes required by newer versions of Emacs
+- Emacs 29 introduces ~pixel-scroll-precision-mode~, which interferes with
~pdf-view~ scrolling. This is fixed in #124
+
+** Functionality fixes and improvements
+- Fix ~revert-buffer~ to correctly work over Tramp #128
+- Fix sorting by date in ~pdf-annot-list-mode~ #75
+
* Version 0.91
** Change the keybindings for traversing history
This is a minor but *breaking change*. ~l~ (backward) and ~r~ (forward) are
the conventional bindings for history navigation in Emacs, but ~pdf-tools~ uses
~B~ and ~N~. The previous keybindings are kept as-is for people who were used
to it, while introducing ~l~ and ~r~ keybindings as well.
diff --git a/README.org b/README.org
index 67d443cb1e..57409fbe6e 100644
--- a/README.org
+++ b/README.org
@@ -521,7 +521,7 @@ L/R scrolling breaks while zoomed into a pdf, with usage of
sublimity smooth scr
:ID: C3A4A7C0-6BBB-4923-AD39-3707C8482A76
:END:
-In such PDFs the selected text becomes hidden behind the selection; see
[[https://github.com/vedang/pdf-tools/issues/149][this issue]], which also
describes the workaround in detail. The following function, which depends on
the [[https://github.com/orgtre/qpdf.el][qpdf.el]] package, can be used to
convert such a PDF file into one where text selection is transparent:
+In such PDFs the selected text becomes hidden behind the selection; see
[[https://github.com/vedang/pdf-tools/issues/149][this issue]], which also
describes the workaround in detail. The following function, which depends on
the [[https://github.com/orgtre/qpdf.el][qpdf.el]] package, can be used to
convert such a PDF file into one where text selection is transparent:
#+begin_src elisp
(defun my-fix-pdf-selection ()
"Replace pdf with one where selection shows transparently."
@@ -605,15 +605,15 @@ To see the list of operating systems where compilation
testing is supported, run
:CREATED: [2021-12-30 Thu 22:04]
:ID: 3be6abe7-163e-4c3e-a7df-28e8470fe37f
:END:
-** I'm on a Macbook and PDFs are rendering blurry
+** PDFs are not rendering well!
:PROPERTIES:
:CREATED: [2021-12-30 Thu 22:04]
:ID: 20ef86be-7c92-4cda-97ec-70a22484e689
:END:
-If you are on a Macbook with a Retina display, you may see PDFs as blurry due
to the high resolution display. Use:
+~pdf-tools~ version ~1.1.0~ release changed the default value of
~pdf-view-use-scaling~ to ~t~ (previously, it was ~nil~). This has been done
keeping in mind that most modern monitors are HiDPI screens, so the default
configuration should cater to this user. If you are not using a HiDPI screen,
you might have to change this value to ~nil~ in your configuration
#+begin_src elisp
- (setq pdf-view-use-scaling t)
+ (setq pdf-view-use-scaling nil)
#+end_src
to scale the images correctly when rendering them.
diff --git a/lisp/pdf-cache.el b/lisp/pdf-cache.el
index 31073ff3d9..650ff36acc 100644
--- a/lisp/pdf-cache.el
+++ b/lisp/pdf-cache.el
@@ -429,9 +429,9 @@ WINDOW and IMAGE-WIDTH decide the page and scale of the
final image."
(pdf-cache-lookup-image
page
image-width
- (if (not pdf-view-use-scaling)
- image-width
- (* 2 image-width))))
+ (if pdf-view-use-scaling
+ (* 2 image-width)
+ image-width)))
(setq page (pop pdf-cache--prefetch-pages)))
(pdf-util-debug
(when (null page)
diff --git a/lisp/pdf-util.el b/lisp/pdf-util.el
index e17800ceec..1e3b7be5a3 100644
--- a/lisp/pdf-util.el
+++ b/lisp/pdf-util.el
@@ -856,14 +856,22 @@ See also `regexp-quote'."
(defun pdf-util-frame-ppi ()
"Return the PPI of the current frame."
- (let* ((props (frame-monitor-attributes))
- (px (nthcdr 2 (alist-get 'geometry props)))
- (mm (alist-get 'mm-size props))
- (dp (sqrt (+ (expt (nth 0 px) 2)
- (expt (nth 1 px) 2))))
- (di (sqrt (+ (expt (/ (nth 0 mm) 25.4) 2)
- (expt (/ (nth 1 mm) 25.4) 2)))))
- (/ dp di)))
+ (condition-case nil
+ (let* ((props (frame-monitor-attributes))
+ (px (nthcdr 2 (alist-get 'geometry props)))
+ (mm (alist-get 'mm-size props))
+ (dp (sqrt (+ (expt (nth 0 px) 2)
+ (expt (nth 1 px) 2))))
+ (di (sqrt (+ (expt (/ (nth 0 mm) 25.4) 2)
+ (expt (/ (nth 1 mm) 25.4) 2)))))
+ (/ dp di))
+ ;; Calculating frame-ppi failed, return 0 to indicate unknown.
+ ;; This can happen when (frame-monitor-attributes) does not have
+ ;; the right properties (Emacs 26, 27). It leads to the
+ ;; wrong-type-argument error, which is the only one we are
+ ;; catching here. We will catch more errors only if we see them
+ ;; happening.
+ (wrong-type-argument 0)))
(defvar pdf-view-use-scaling)
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 981aa1be3a..849be6a713 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -86,7 +86,7 @@ FIXME: Explain dis-/advantages of imagemagick and png."
:group 'pdf-view
:type 'boolean)
-(defcustom pdf-view-use-scaling nil
+(defcustom pdf-view-use-scaling t
"Whether images should be allowed to be scaled for rendering.
This variable affects both the reuse of higher-resolution images
@@ -955,9 +955,9 @@ See also `pdf-view-use-imagemagick'."
(let* ((size (pdf-view-desired-image-size page window))
(data (pdf-cache-renderpage
page (car size)
- (if (not pdf-view-use-scaling)
- (car size)
- (* 2 (car size)))))
+ (if pdf-view-use-scaling
+ (* 2 (car size))
+ (car size))))
(hotspots (pdf-view-apply-hotspot-functions
window page size)))
(pdf-view-create-image data
- [nongnu] elpa/pdf-tools updated (d6980bc327 -> 1885cefc24), ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 37b4c4fcec 01/16: Add a byteclean target in the Makefile, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 710fe66dc4 02/16: Explicitly declare documentation files as Org files, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 997467ad3b 15/16: autobuild: Recognize NetBSD and install packages via pkgin, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 5563ac9114 04/16: Remove bugfix for imenu in Emacs 24.3 and below, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 1f91ba8894 09/16: Render crisp images for HiDPI screens by default,
ELPA Syncer <=
- [nongnu] elpa/pdf-tools 365d2d8e8e 03/16: Remove guards in `pdf-virtual` tests and code., ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 19801defb8 10/16: Add support for Alpine Linux to autobuild, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 1885cefc24 16/16: Merge branch 'feature/emacs-26.3', ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 96703b2bb5 14/16: Bump the minimum Emacs version to 26.3! 🎉🤞, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools ce5ed3412d 05/16: Remove macro / function re-definitions, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 05c42596a2 07/16: Remove compatibility function for image-mode-winprops, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 7a51b38310 13/16: Extend docker testing framework to test against Emacs versions, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools bc7c159c48 11/16: Make sure pkg-config is correctly set in autobuild, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 3af6141926 06/16: Remove pdf-util-window-pixel-width, fallback to window-body-width, ELPA Syncer, 2022/11/29
- [nongnu] elpa/pdf-tools 321e19ed59 08/16: Remove Emacs 24.4 guards for cua-mode, ELPA Syncer, 2022/11/29