all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* DocView resolution for PDF on WQHD
@ 2018-06-18  9:10 Van L
  2018-06-18  9:26 ` Alexis
  2018-06-18 14:30 ` Yuri Khan
  0 siblings, 2 replies; 11+ messages in thread
From: Van L @ 2018-06-18  9:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hello.

The PDF's font rendering is mildly awful on Mac¹ port Emacs 26.1 or in Emacs 27.0.50 over XQuartz.

Is there a way to confirm I have the best display resolution for when viewing PDF² in Emacs?

— 
¹ git checkout tags/emacs-26.1-mac-7.1 
² http://linguistics.berkeley.edu/~rscook/pdf/IUC18-SWJZZ.wp3-600.pdf


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18  9:10 DocView resolution for PDF on WQHD Van L
@ 2018-06-18  9:26 ` Alexis
  2018-06-18 12:53   ` Van L
  2018-06-18 14:30 ` Yuri Khan
  1 sibling, 1 reply; 11+ messages in thread
From: Alexis @ 2018-06-18  9:26 UTC (permalink / raw)
  To: Van L; +Cc: help-gnu-emacs


Van L <van@scratch.space> writes:

> The PDF's font rendering is mildly awful on Mac¹ port Emacs 26.1 
> or in Emacs 27.0.50 over XQuartz.
>
> Is there a way to confirm I have the best display resolution for 
> when viewing PDF² in Emacs?

Out of interest, is the rendering any better if you use the 
`pdf-tools` package?

https://github.com/politza/pdf-tools

("Although OS X is not officially supported, it has been reported 
to have been successfully compiled.")


Alexis.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18  9:26 ` Alexis
@ 2018-06-18 12:53   ` Van L
  0 siblings, 0 replies; 11+ messages in thread
From: Van L @ 2018-06-18 12:53 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks,

> is the rendering any better if you use the `pdf-tools` package?

I'm hoping for changes to default settings to improve the ghostwriter plumbing if that will do it.

The pdf-tools package is outside of regular NS port Emacs and the Mac port. 

I’m not wanting to go there. The readme says it renders to PNG not SVG.

Mac port has improved high resolution abilities, I believe.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18  9:10 DocView resolution for PDF on WQHD Van L
  2018-06-18  9:26 ` Alexis
@ 2018-06-18 14:30 ` Yuri Khan
  2018-06-18 15:26   ` Van L
  1 sibling, 1 reply; 11+ messages in thread
From: Yuri Khan @ 2018-06-18 14:30 UTC (permalink / raw)
  To: van; +Cc: help-gnu-emacs

On Mon, Jun 18, 2018 at 4:11 PM Van L <van@scratch.space> wrote:

> The PDF's font rendering is mildly awful on Mac¹ port Emacs 26.1 or in Emacs 27.0.50 over XQuartz.
>
> Is there a way to confirm I have the best display resolution for when viewing PDF² in Emacs?

I am using a HiDPI monitor with X11/GNU/Linux, and yes, out-of-the-box
rendering in that configuration is pretty accurately described by the
expression “mildly awful”.

I was able to achieve a non-awful result by customizing:

    (setq doc-view-resolution 192)

(to match my system’s idea of the monitor’s pixel density).

If you also want to use +/- keys to enlarge or reduce the displayed
page, you might want to set that higher than your actual DPI.

> Mac port has improved high resolution abilities, I believe.

There is absolutely no reason to think only Mac users deserve nice
rendering in HiDPI configurations.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18 14:30 ` Yuri Khan
@ 2018-06-18 15:26   ` Van L
  2018-06-18 16:06     ` Yuri Khan
  2018-06-22 16:14     ` Van L
  0 siblings, 2 replies; 11+ messages in thread
From: Van L @ 2018-06-18 15:26 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs

Thanks,

> (setq doc-view-resolution 192)

I was able to find 'resolution' in M-x customize.

For WQHD I calculated

(/ (sqrt
    (+ (* 2560 2560)
       (* 1440 1440)
       ))
   25) ; which is approx. 118 PPI¹

and the out of the box setting is 100.

Setting 'Doc View Resolution' to 192 and reloading the PDF doesn’t improve the font rendering.

See² for side-by-side comparison. 

On the right side is the inferior Emacs’s PDF view.

— 
¹ https://en.wikipedia.org/wiki/HiDPI
² http://emacs.scratch.space/public/Doc-View-Resolution-192-PPI.png


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18 15:26   ` Van L
@ 2018-06-18 16:06     ` Yuri Khan
  2018-06-19  4:29       ` Van L
  2018-06-22 16:14     ` Van L
  1 sibling, 1 reply; 11+ messages in thread
From: Yuri Khan @ 2018-06-18 16:06 UTC (permalink / raw)
  To: van; +Cc: help-gnu-emacs

On Mon, Jun 18, 2018 at 10:26 PM Van L <van@scratch.space> wrote:

> I was able to find 'resolution' in M-x customize.
>
> For WQHD I calculated
>
> (/ (sqrt
>     (+ (* 2560 2560)
>        (* 1440 1440)
>        ))
>    25) ; which is approx. 118 PPI¹
>
> and the out of the box setting is 100.

Hm, so yours is not a particularly HiDPI monitor. Then it’s probably
just subjective differences in font rendering.

For one thing, I notice that the web browser on the left uses subpixel
rendering while Ghostscript doesn’t (and seemingly can’t).

Sorry, I don’t know how to help you further.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18 16:06     ` Yuri Khan
@ 2018-06-19  4:29       ` Van L
  2018-06-19  8:13         ` Yuri Khan
  0 siblings, 1 reply; 11+ messages in thread
From: Van L @ 2018-06-19  4:29 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs


> not a particularly HiDPI monitor. 

At about the time when src/macfont.h entered the source code I first experienced PDF viewing inside NetBSD GNU Emacs and was blown away by the crispness. I suppose HiDPI is a 4k, 5k, 8k display.

> the web browser on the left uses subpixel
> rendering while Ghostscript doesn’t (and seemingly can’t).

I see.

> Sorry, I don’t know how to help you further.

Any help is appreciated. Thanks.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-19  4:29       ` Van L
@ 2018-06-19  8:13         ` Yuri Khan
  2018-06-19 10:24           ` Van L
  0 siblings, 1 reply; 11+ messages in thread
From: Yuri Khan @ 2018-06-19  8:13 UTC (permalink / raw)
  To: van; +Cc: help-gnu-emacs

On Tue, Jun 19, 2018 at 11:29 AM Van L <van@scratch.space> wrote:

> At about the time when src/macfont.h entered the source code I first experienced PDF viewing inside NetBSD GNU Emacs and was blown away by the crispness. I suppose HiDPI is a 4k, 5k, 8k display.

It’s not that simple. There are many factors in play.

First, there is the pixel count. This is what WQHD, 4k, 5k, 8k, and
explicitly stated pixel counts such as 2560×1440 refer to.

Second, there is the screen diagonal or screen size, usually expressed
in inches.

Given a pixel count and a diagonal, one can calculate the linear pixel
density: ld = sqrt(w^2 + h^2) / diag.

Third, there is the eye to screen distance, which can be measured in
meters, feet, or arm’s lengths. A desktop monitor is normally one
arm’s length (≈70cm) from the eye; a laptop, tablet, or phone screen
is usually at about half that distance; and a cinema screen might be
as far as twenty meters away.

Given a linear pixel density and eye to screen distance, one can
approximate the angular pixel density: ad = ld / dist.

Perceived crispness of the image, and what HiDPI is really about, is a
function of the angular pixel density.

A typical desktop monitor is about 100 dpi at arm’s length. A HiDPI
monitor is about 200 dpi at arm’s length.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-19  8:13         ` Yuri Khan
@ 2018-06-19 10:24           ` Van L
  2018-06-19 13:26             ` Van L
  0 siblings, 1 reply; 11+ messages in thread
From: Van L @ 2018-06-19 10:24 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs


> HiDPI

In the limit the technology is about getting the ideal projection on the human retina with customization options for people above/below 20/20 vision.

I think Emacs can improve the Ghostscript rendering before needing to employ subpixel optimization.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-19 10:24           ` Van L
@ 2018-06-19 13:26             ` Van L
  0 siblings, 0 replies; 11+ messages in thread
From: Van L @ 2018-06-19 13:26 UTC (permalink / raw)
  To: help-gnu-emacs


> improve the Ghostscript rendering

Comparing A, B and C.

Emacs renders the S acceptably, see last word on line 6 of A.
But, there, the header and footer lines don’t render well.

The S in B also done in Emacs’s PDF viewer, isn’t as acceptable as in A.
Note, the staircasing on the double angle brackets. Line 3.

C is the native Mac app; maybe it adaptively renders depending on the size of the window-frame.
C has not staircasing on those double angle brackets. Line 2.

Is it possible B’s S isn’t as good as A’s S because 
B decides uses the font in the PDF and not those of the hosting platform?
Those double angle brackets in B and C. Choice of font issue, too?

— 
A http://emacs.scratch.space/public/A.png
B http://emacs.scratch.space/public/B.png
C http://emacs.scratch.space/public/C.png


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: DocView resolution for PDF on WQHD
  2018-06-18 15:26   ` Van L
  2018-06-18 16:06     ` Yuri Khan
@ 2018-06-22 16:14     ` Van L
  1 sibling, 0 replies; 11+ messages in thread
From: Van L @ 2018-06-22 16:14 UTC (permalink / raw)
  To: help-gnu-emacs


> Setting 'Doc View Resolution' to 192
> and reloading the PDF doesn’t improve
> the font rendering.

The clue from lisp/doc-view.el 
is to call `doc-view-clear-cache`
and the 192 resolution takes effect.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-22 16:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18  9:10 DocView resolution for PDF on WQHD Van L
2018-06-18  9:26 ` Alexis
2018-06-18 12:53   ` Van L
2018-06-18 14:30 ` Yuri Khan
2018-06-18 15:26   ` Van L
2018-06-18 16:06     ` Yuri Khan
2018-06-19  4:29       ` Van L
2018-06-19  8:13         ` Yuri Khan
2018-06-19 10:24           ` Van L
2018-06-19 13:26             ` Van L
2018-06-22 16:14     ` Van L

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.