unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50958: 27.2; Very blurry svg rendering on Retina screen
@ 2021-10-02  7:25 Carlos Pita
  2021-10-02  9:06 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos Pita @ 2021-10-02  7:25 UTC (permalink / raw)
  To: 50958

Hi all,

I'm having a hard time getting org-mode LaTeX preview to render without
excesive blurriness. I started with a default configuration of emacs
27.2 from https://emacsformacosx.com/. Since that build doesn't support
svg rendering, I moved to emacs 27.2 from
https://github.com/d12frosted/homebrew-emacs-plus, which is compiled
with svg support. But the rendering ended up being as blurry as with
png. So I opened the particular svg files that the org-mode backend was
producing in the stock Preview app and they look just fine. I also
opened them with doc-view and they look as bad as in org-mode. So is
this a known issue? Some part seems to have the wrong idea of the actual
resolution of my device.

Best regards,
Carlos

---

In GNU Emacs 27.2 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-10-02 built on Carloss-MacBook-Pro.local
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.6

Recent messages:
Loading ns-auto-titlebar...done
Loading org-roam-db...done
Loading paren...done
Loading winner...done
Clearing removed files...done
Processing modified files...done
Loading /Users/carlos/.emacs.d/recentf...done
Cleaning up the recentf list...done (0 removed)
Loading dired-x...done
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: The mark is not set now, so there is no region
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-plus@27/27.2/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-plus@27/27.2 --with-xml2 --with-gnutls
 --without-dbus --with-imagemagick --with-modules --with-rsvg --with-ns
 --disable-ns-self-contained'

Configured features:
RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS XIM NS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_AR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-fill-column-indicator-mode: t
  flymake-mode: t
  pdf-occur-global-minor-mode: t
  recentf-mode: t
  my-fill-mode: t
  delete-selection-mode: t
  winner-mode: t
  show-paren-mode: t
  org-roam-db-autosync-mode: t
  outline-minor-mode: t
  ns-auto-titlebar-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  global-company-mode: t
  company-mode: t
  electric-pair-mode: t
  cua-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/Users/carlos/.emacs.d/elpa/magit-20210928.1325/magit-section-pkg hides /Users/carlos/.emacs.d/elpa/magit-section-20210829.1849/magit-section-pkg

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rfc822 mml
mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail
mail-utils display-fill-column-indicator checkdoc lisp-mnt flymake-proc
flymake warnings thingatpt visual-fill-column pdf-occur ibuf-ext ibuffer
ibuffer-loaddefs tablist tablist-filter semantic/wisent/comp
semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local cedet dired-x
dired dired-loaddefs pdf-isearch let-alist pdf-misc imenu pdf-tools
compile pdf-view bookmark text-property-search pp jka-compr pdf-cache
pdf-info tq pdf-util pdf-macs image-mode exif recentf tree-widget
exec-path-from-shell doom-themes-ext-org doom-themes-ext-visual-bell
face-remap cl-extra help-mode company-oddmuse company-keywords
company-etags etags fileloop xref project company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb doom-solarized-light-theme doom-themes doom-themes-base
delsel winner paren org-roam-migrate org-roam-mode org-roam-capture
org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam
org-capture org-element avl-tree generator org-id org-refile org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete comint ansi-color ring org-list
org-faces org-entities time-date noutline outline easy-mmode org-version
ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat org-macs
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs
emacsql-sqlite url-http url-auth mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap advice emacsql emacsql-compiler magit-section rx f dash
s ns-auto-titlebar ido-completing-read+ memoize cus-edit wid-edit
minibuf-eldef ido company edmacro kmacro pcase elec-pair cua-base
cus-start cus-load finder-inf info package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 415683 26926)
 (symbols 48 29562 2)
 (strings 32 125515 3321)
 (string-bytes 1 3620467)
 (vectors 16 43369)
 (vector-slots 8 768323 28868)
 (floats 8 384 234)
 (intervals 56 331 0)
 (buffers 1000 16))






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

* bug#50958: 27.2; Very blurry svg rendering on Retina screen
  2021-10-02  7:25 bug#50958: 27.2; Very blurry svg rendering on Retina screen Carlos Pita
@ 2021-10-02  9:06 ` Lars Ingebrigtsen
  2021-10-02 15:52   ` Carlos Pita
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-02  9:06 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 50958

Carlos Pita <carlosjosepita@gmail.com> writes:

> I'm having a hard time getting org-mode LaTeX preview to render without
> excesive blurriness. 

SVG rendering on HiDPI screens has been improved in Emacs 28 -- could
you try that instead to see whether it fixes the problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#50958: 27.2; Very blurry svg rendering on Retina screen
  2021-10-02  9:06 ` Lars Ingebrigtsen
@ 2021-10-02 15:52   ` Carlos Pita
  2021-10-03  8:56     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Carlos Pita @ 2021-10-02 15:52 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 50958

> SVG rendering on HiDPI screens has been improved in Emacs 28 -- could
> you try that instead to see whether it fixes the problem?

Sure Lars, I was going to do it anyway because of other issues with pdf-tools.

It indeed fixes part of the problem:

* LaTeX previews in org-mode are high resolution now.
* Also adds the frame-scale-factor function that’s used by the fix to pdf-tools [1] blurry rendering.

But other related issues remain:

* doc-view still renders low-resolution svg.
* doc-view still renders low-resolution pdf (which is not the topic of this issue but may be relevant).

Best regards,
Carlos

---

[1] https://github.com/vedang/pdf-tools/commit/f771c93781b3135200cae6dbc8e45dbb887f77b1







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

* bug#50958: 27.2; Very blurry svg rendering on Retina screen
  2021-10-02 15:52   ` Carlos Pita
@ 2021-10-03  8:56     ` Lars Ingebrigtsen
  2021-10-03  9:31       ` Alan Third
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-03  8:56 UTC (permalink / raw)
  To: Carlos Pita; +Cc: Alan Third, 50958

Carlos Pita <carlosjosepita@gmail.com> writes:

> But other related issues remain:
>
> * doc-view still renders low-resolution svg.
> * doc-view still renders low-resolution pdf (which is not the topic of
> this issue but may be relevant).

Perhaps Alan has some comments here -- he did the work to get HiDPI
rendering to work for SVGs, so I've added him to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#50958: 27.2; Very blurry svg rendering on Retina screen
  2021-10-03  8:56     ` Lars Ingebrigtsen
@ 2021-10-03  9:31       ` Alan Third
  2021-10-05  5:42         ` Carlos Pita
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Third @ 2021-10-03  9:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Carlos Pita, 50958

On Sun, Oct 03, 2021 at 10:56:44AM +0200, Lars Ingebrigtsen wrote:
> Carlos Pita <carlosjosepita@gmail.com> writes:
> 
> > But other related issues remain:
> >
> > * doc-view still renders low-resolution svg.
> > * doc-view still renders low-resolution pdf (which is not the topic of
> > this issue but may be relevant).
> 
> Perhaps Alan has some comments here -- he did the work to get HiDPI
> rendering to work for SVGs, so I've added him to the CCs.

I think docview uses external applications to render the files to png
and it has its own setting for DPI (doc-view-resolution), which on a
hi-dpi screen is a bit low.

IIRC docview is a bit strange because you don't set the dpi to the
screen's dpi, the actual value you want to use depends on various
factors, like how large your window is and whether you zoom in on the
image or not.
-- 
Alan Third





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

* bug#50958: 27.2; Very blurry svg rendering on Retina screen
  2021-10-03  9:31       ` Alan Third
@ 2021-10-05  5:42         ` Carlos Pita
  0 siblings, 0 replies; 6+ messages in thread
From: Carlos Pita @ 2021-10-05  5:42 UTC (permalink / raw)
  To: Alan Third, Lars Ingebrigtsen, Carlos Pita, 50958

Hi Alan,

> I think docview uses external applications to render the files to png
> and it has its own setting for DPI (doc-view-resolution), which on a
> hi-dpi screen is a bit low.
>
> IIRC docview is a bit strange because you don't set the dpi to the
> screen's dpi, the actual value you want to use depends on various
> factors, like how large your window is and whether you zoom in on the
> image or not.

Wouldn't it make sense to set the default resolution to a value more
appropriate to the screen resolution then? I understand that someone
may want to change it for zooming for example, but OOTB seems quite
broken in a HiDPI screen and the average user (even the average emacs
user) probably doesn't understand a lot about scaling factors, not to
say about the existence of doc-view-resolution. Maybe now that there
is frame-scale-factor in emacs 28 it could be used to set the default
resolution for docview?

Best regards,
Carlos





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

end of thread, other threads:[~2021-10-05  5:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-02  7:25 bug#50958: 27.2; Very blurry svg rendering on Retina screen Carlos Pita
2021-10-02  9:06 ` Lars Ingebrigtsen
2021-10-02 15:52   ` Carlos Pita
2021-10-03  8:56     ` Lars Ingebrigtsen
2021-10-03  9:31       ` Alan Third
2021-10-05  5:42         ` Carlos Pita

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).