On 12/06/2017 10:55 AM, Stephen J. Turnbull wrote:
Aidan Kehoe writes:
> In fontconfig theory the -13 is pt,
That's right. If your X server is providing the right DPI for the
screen, fontconfig will automatically scale points to pixels
> so it seems that the underlying library isn’t handling it
I don't think that's likely, given:
> > PS: Surprisingly the Xemacs menus and such sale automatically, just not
> > this most important, main edit buffer, ..?
Most of the "menus and such" have their fonts configured through X
resources rather than XEmacs faces. I think that most likely
something is going on in the face processing, but I don't have a good
idea what that might be offhand. XEmacs *should* be passing the
fontspec directly to fontconfig, which then finds the font, and passes
that and the spec to Xft, which renders at the right scale. I don't
recall that XEmacs tries to adjust fontconfig specs in any way.
On my own system this "just works", and the screens that get switched
are a Mac Book Pro 13" (2560x1600) and a Thunderbolt 26" (2560x1440).
so I should see the same effect that you do. But I don't.
Have you tried other fonts? Do you use this font with other
applications? What are the results in those cases? (I don't mean to
"blame the victim", but with the information I have so far the only
suggestion I have that would give quick resolution is that the font is
somehow broken, and a different font would work.)
If the font does work correctly in other applications and different
fonts show the same behavior in XEmacs, the next step would be to check to
see if XEmacs knows the actual dimensions of the screen. You can get
this information by evaluating
(list (device-pixel-width (selected-device))
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:
(/ (device-pixel-width (selected-device))
(/ (device-mm-width (selected-device)) 25.4)
(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 doesn't doesn't give the right answers with both screens
on my Mac although xdpyinfo seems to work correctly. I will
investigate that, but can't promise any results soon. It doesn't
surprise me that something weird would be going on in X since the Mac
will mirror or tile the screens at the Quartz level and authomatically
adjust things, so X doesn't actually know what's going on. But it
does suggest that XEmacs is messed up here somehow.
René Rebe, ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin