Ar an dara lá is fiche de mí Feabhra, scríobh René Rebe:
Thank you for this hint. While the output is correct, I now use it in
my
.xemacs/init.el to correct for the current xemacs xft shortcomings:
(if
(>
(/ (device-pixel-width (selected-device))
(/ (device-mm-width (selected-device)) 25.4)
)
140)
(set-face-font 'default "Source Code Pro-20")
(set-face-font 'default "Source Code Pro-12")
)
I usually do not write Lisp, so if you have tips for a Lips newbie feel
free to drop them. I probably further tweak this to scale to any HiDPI
in 72/2 steps or so.
This way will work better with multiple displays:
(set-face-font 'default "Source Code Pro-12")
(define-specifier-tag 'HiDPI #'(lambda (device)
(> (/ (device-pixel-width device)
(/ (device-mm-width device) 25.4))
140)))
(set-face-font 'default "Source Code Pro-20" nil '(HiDPI) 'prepend)
I’ve tested the above with my local setup, it should just work.
The way to adjust it to work with multiple increments is something like the
following:
(macrolet
((define-tag-and-prepend (&rest points)
(cons 'progn
(loop for point
in points
nconc `((define-specifier-tag ',(intern (format
"point-width-%d"
point))
#'(lambda (device)
(< (/ (device-pixel-width
device)
(/ (device-mm-width
device)
25.4))
,(* point 10))))
(set-face-font 'default ,(format
"Source Code Pro-%d"
point)))))))
(define-tag-and-prepend 10 12 14 16 18 20 22 24 26 28 30))
I haven’t tested this, there may be a bit of bug-fixing involved. F1 f
macrolet or F1 f define-specifier-tag to help debug it.
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)