"Vlad V. Voronenkov" <[email protected]> writes:

> The size of preview-generated images (figures, formulas, sections) is
> larger than normal and images are blurry when fractional scaling is
> used in the desktop environment (Gnome 49.1/Wayland).
> For the integer scale of 200% the size of images is normal, however,
> images look blurry due to insufficient resolution.

Thanks for your report and sorry for the late response.  Does this mean
that images are not Ok (in terms of resolution) only for a scale of
200%?

> This seems the correlate with the monitor geometry and scale factor
> returned by (frame-monitor-attributes).

IIUC, the only place in preview.el where `frame-monitor-attributes' is
used is:

--8<---------------cut here---------------start------------->8---
(defun preview-get-dpi ()
  (let* ((monitor-attrs (frame-monitor-attributes))
         (mm-dims (cdr (assoc 'mm-size monitor-attrs)))
         (mm-width (or (and (integerp (nth 0 mm-dims))
                            (> (nth 0 mm-dims) 0)
                            (nth 0 mm-dims))
                       1))
         (mm-height (or (and (integerp (nth 1 mm-dims))
                             (> (nth 1 mm-dims) 0)
                             (nth 1 mm-dims))
                        1))
         (pixel-dims (cl-cdddr (assoc 'geometry monitor-attrs)))
         (pixel-width (nth 0 pixel-dims))
         (pixel-height (nth 1 pixel-dims)))
    (cons (/ (* 25.4 pixel-width) mm-width)
          (/ (* 25.4 pixel-height) mm-height))))
--8<---------------cut here---------------end--------------->8---

As you can see, only the values for 'mm-size' and 'geometry' are used
for the calculation.

> Actual monitor resolution is 1920x1080.
>
> Scaling =>   monitor attributes
> 200%    =>   (geometry 0 0 1920 1080) (workarea 0 0 1920 1080)
> (mm-size 530 300) (scale-factor . 2.0)
> 166%    =>   (geometry 0 0 2304 1296) (workarea 0 0 2304 1296)
> (mm-size 530 300) (scale-factor . 2.0)
> 150%    =>   (geometry 0 0 2560 1440) (workarea 0 0 2560 1440)
> (mm-size 530 300) (scale-factor . 2.0)
> 133%    =>   (geometry 0 0 2880 1620) (workarea 0 0 2880 1620)
> (mm-size 530 300) (scale-factor . 2.0)
> 125%    =>   (geometry 0 0 3072 1728) (workarea 0 0 3072 1728)
> (mm-size 530 300) (scale-factor . 2.0)
> 100%    =>   (geometry 0 0 1920 1080) (workarea 0 0 1920 1080)
> (mm-size 530 300) (scale-factor . 1.0)

Looking at the above, I don't understand the values attached to the
'geometry' key, most notably, the changes for WIDTH and HEIGHT depending
on the scaling.  To recap, the 'geometry' key is defined as:

  'geometry'

      Position of the top-left corner of the monitor's screen and its
      size, in pixels, as '(x y width height)'.

Maybe this is a bug in Emacs?

Best, Arash



_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to