You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
):
The patch below is a quick hack (see the "XXX" comment below) for PDF
Tools to display 2x images on Retina display.
YAMAMOTO Mitsuharu
address@hidden
diff --git a/lisp/pdf-annot.el b/lisp/pdf-annot.el
index 32cb237..bb63a71 100644
--- a/lisp/pdf-annot.el
+++ b/lisp/pdf-annot.el
@@ -921,6 +921,7 @@ other annotations."
(pdf-cache-renderpage-highlight
page (car size)
`("white" "steel blue" 0.35 ,@edges))
+ :width (car size)
:map (pdf-view-apply-hotspot-functions
window page size))))
(pdf-util-scroll-to-edges
diff --git a/lisp/pdf-info.el b/lisp/pdf-info.el
index 6a5edb8..62da214 100644
--- a/lisp/pdf-info.el
+++ b/lisp/pdf-info.el
@@ -1514,7 +1514,15 @@ Return the data of the corresponding PNG image."
'renderpage
(pdf-info--normalize-file-or-buffer file-or-buffer)
page
- width
+ (* width
+ ;; XXX This does not give optimal results when you have both
+ ;; Retina and non-Retina displays connected. For true
+ ;; high-resolution support, one should use either TIFF, "@2x"
+ ;; convention, or resolution-independent formats such as PDF.
+ (or (and (memq (pdf-view-image-type) '(imagemagick image-io))
+ (fboundp 'frame-monitor-attributes)
+ (cdr (assq 'backing-scale-factor (frame-monitor-attributes))))
+ 1))
(let (transformed)
(while (cdr commands)
(let ((kw (pop commands))
diff --git a/lisp/pdf-isearch.el b/lisp/pdf-isearch.el
index bffbd3b..674d295 100644
--- a/lisp/pdf-isearch.el
+++ b/lisp/pdf-isearch.el
@@ -728,7 +728,7 @@ MATCH-BG LAZY-FG LAZY-BG\)."
occur-hack-p)
(eq page (pdf-view-current-page)))
(pdf-view-display-image
- (pdf-view-create-image data))))))))
+ (pdf-view-create-image data :width width))))))))
(pdf-info-renderpage-text-regions
page width t nil
`(,fg1 ,bg1 ,@(pdf-util-scale-pixel-to-relative
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 555032e..406ab98 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -725,7 +725,7 @@ See also `pdf-view-set-slice-from-bounding-box'."
"Return the image-type which should be used.
The return value is either imagemagick (if available and wanted
-or if png is not available) or png.
+or if png is not available), image-io (on the Mac port), or png.
Signal an error, if neither imagemagick nor png is available.
@@ -733,6 +733,8 @@ See also `pdf-view-use-imagemagick'."
(cond ((and pdf-view-use-imagemagick
(fboundp 'imagemagick-types))
'imagemagick)
+ ((image-type-available-p 'image-io)
+ 'image-io)
((image-type-available-p 'png)
'png)
((fboundp 'imagemagick-types)
@@ -741,8 +743,8 @@ See also `pdf-view-use-imagemagick'."
(error "PNG image supported not compiled into Emacs"))))
(defun pdf-view-use-scaling-p ()
- (and (eq 'imagemagick
- (pdf-view-image-type))
+ (and (memq (pdf-view-image-type)
+ '(imagemagick image-io))
pdf-view-use-scaling))
(defmacro pdf-view-create-image (data &rest props)
@@ -1195,7 +1197,8 @@ This is more useful for commands like
`(,(car colors) ,(cdr colors) 0.35 ,@region))
(pdf-info-renderpage-text-regions
page width nil nil
- `(,(car colors) ,(cdr colors) ,@region)))))))
+ `(,(car colors) ,(cdr colors) ,@region)))
+ :width width))))
(defun pdf-view-kill-ring-save ()
"Copy the region to the `kill-ring'."
Thenks, Konrad