[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"Fix" sag scaling for hidpi
From: |
Yuan Fu |
Subject: |
"Fix" sag scaling for hidpi |
Date: |
Thu, 4 Feb 2021 15:49:27 -0500 |
To get crisp images on hidpi displays, a common approach is to load an image
double de dimension and rescale it down. E.g., load an 200x200 image and
rescale it to 100x100. In Emacs this can be done by
(insert-image (create-image "200x200img.png" 'png nil :scale 0.5))
And Emacs will display a crisp 100x100 image in the buffer. However, this
doesn’t work for sag images. If I do
(progn
(require 'svg)
(let ((svg (svg-create 200 200)))
(svg-text svg "test"
:font-size 100
:y 150)
(insert-image (svg-image svg :scale 0.5))))
The image is still blurry:

Turns out image.c resolves the dimension for svg images before generating them
and skips rescaling all together. The following patch changes that behavior and
allows me to generate crisp svg images:

WDYT?
Yuan
svg-scale.patch
Description: Binary data
- "Fix" sag scaling for hidpi,
Yuan Fu <=
- Re: "Fix" sag scaling for hidpi, Stefan Monnier, 2021/02/04
- Re: "Fix" sag scaling for hidpi, Yuan Fu, 2021/02/04
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/05
- Re: "Fix" sag scaling for hidpi, Robert Pluim, 2021/02/05
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/06
- Re: "Fix" sag scaling for hidpi, Eli Zaretskii, 2021/02/06
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/06
- Re: "Fix" sag scaling for hidpi, Eli Zaretskii, 2021/02/06
- Re: "Fix" sag scaling for hidpi, Lars Ingebrigtsen, 2021/02/07
- Re: "Fix" sag scaling for hidpi, Robert Pluim, 2021/02/07