13

I've got a curious hardware situation, and I've run into a curious software quirk. I have a laptop with a broken screen that I have hooked up to an external display. I start up an X session and open a urxvt terminal. With the setting URxvt.letterSpace: -1 in my Xresources file, the text in my terminal displays like this:

Normally spaced text in urxvt

Now I don't want the broken built-in screen still on, so I disable it with the line:

xrandr --output LVDS1 --off 

If I open a new terminal now, the text will appear as it does above. But after logging into /dev/tty2 and then coming back to my graphical X session and opening up a new terminal, the text displays like this with the letter-spacing much tighter than before:

Much tighter text in URxvt

Reloading my Xresources file doesn't fix this. But increasing the value of URxvt.letterSpace from -1 to 0 and then reloading does appear to return the letter-spacing to what it was originally, so it seems that somewhere, after logging into /dev/tty, an extra -1 is being added to my letter-spacing.

Why does this happen? Why does going into a /dev/tty decrease the letter-spacing like this?

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
Mike Pierce
  • 737
  • 1
  • 6
  • 23
  • 1
    Is this reproducible? Is `letterSpace` set to -1 every time you switch to `/dev/tty2`? – Dmitry Grigoryev Mar 29 '17 at 17:14
  • It doesn't seem to happen *every* time, but I'm not sure what I'm doing in `/dev/tty` that triggers it. The only way I've figured out to reset this effect is to restart the computer (maybe just restart the Xsession?). I'll play around and reply if I discover more concrete steps to reproduce this. – Mike Pierce Mar 29 '17 at 17:24
  • And it doesn't appear that the value of `letterSpace` is actually being changed with this happens. The value of `URxvt.letterSpace` is -1 in both of those images in the question. It looks like another -1 is getting added somewhere for some reason. – Mike Pierce Mar 29 '17 at 17:24
  • @DmitryGrigoryev , I've made discovery. I'll add details in the post. – Mike Pierce Mar 29 '17 at 17:39
  • Sounds kind of like display driver weirdness, which acts like deep magic from normal userspace's perspective (my usual fix for problems along these lines is "update kernel and try again"; it sometimes works). – Tom Hunt Mar 29 '17 at 20:53
  • @TomHunt Haha thanks. The kernel is all up to date though. Version 4.10.6-1 on Arch Linux. :) – Mike Pierce Mar 29 '17 at 20:58
  • This looks actually like a different, more compressed font variant with a bit more weight. I think it's possible the X server rearranges font tables when it's started up again switching VTs back, and if you've several matching fonts, it might pick a different one. That's just a theory, though. – dirkt Jun 03 '17 at 08:43
  • Could you post the output from `xrand` before and after disabling LVDS1? Just to check that you are dealing with exactly the same values. – Eduardo Trápani May 25 '20 at 01:55
  • 4
    I’m voting to close this question because I no longer have the curious hardware setup of a laptop with a broken screen and external display, and I can't seem to reproduce this error on my current setup. – Mike Pierce Jun 01 '20 at 16:30

1 Answers1

-1

Do you have any font settings in .Xdefaults?

Add (or remove) lines in .Xdefaults to specify a font and size.

! -- Fonts -- !
URxvt.font:xft:Monospace:pixelsize=15

There may be several in the .Xdefaults file that the system picks from. Remove or comment out the ones you don't want or add the one you do.

This helped me set a particular size and font for my X sessions in the past.

Paulo Tomé
  • 3,754
  • 6
  • 26
  • 38
Mark Stewart
  • 726
  • 3
  • 8