emacs-devel
[Top][All Lists]
Advanced

[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:

PNG image


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:

PNG image


WDYT?

Yuan


Attachment: svg-scale.patch
Description: Binary data



reply via email to

[Prev in Thread] Current Thread [Next in Thread]