When I'm in a good mood, my terminal font is Terminus with pixelsize 12, and it's pretty.
Sometimes though I realize I'd be happier if my font was a bit bigger. Is there a way to change font size in an already-running urxvt?
Last edited by peets (2008-02-18 14:31:48)
I would also like to know this...
Something like this:
! :Bind C-0, C-+ and C-= to activate small, medium, and big font size resp. URxvt.keysym.C-0: command:\033]710;-*-dina-medium-r-normal--13-*-*-*-*-*-*-*\007 URxvt.keysym.C-minus: command:\033]710;-*-dina-medium-r-normal--15-*-*-*-*-*-*-*\007 URxvt.keysym.C-equal: command:\033]710;-*-dina-medium-r-normal--16-*-*-*-*-*-*-*\007
May cause your cat to hate you or your local garbage collector to knock your house down. Cheers.
Besides setting up keys such as badger mentions you can also, for a quick change, paste this in a running terminal:
printf '\33]50;%s\007' "xft:Terminus:pixelsize=20"
See man 7 urxvt ("Can I switch the fonts at runtime?" and "Can I see a typical configuration?") for more info.
I won't bother finding out what those escapes actually mean this time
~ $ cat ~/bin/fsize #!/bin/bash printf '\33]50;%s%d\007' "xft:Terminus:pixelsize=" $1
Thanks a lot for posting the solution!
Does anybody know what this means though? I have the following lines in my .Xdefaults
$ cat .Xdefaults | grep pixel urxvt*boldFont: xft:terminus:pixelsize=13 urxvt*font: xft:Terminus:pixelsize=13
Experimenting with replacing the escaped values turned the terminal pink in one instance but I couldn't figure out how to set the bold font size...
It is possible to omit this problem by removing the boldFont line, since I'm using the same font for both normal and bold but it'd be still useful to know.
Last edited by qubodup (2015-11-08 10:22:12)
means that when Ctrl-0 is pressed:
\033] - send fake keystroke ESC-] (this announces a terminal control sequence)
710; - terminal control: set normal font, followed by the font description
\077 - end command
Other font control sequences are:
711; - set bold font
712; - set italic font
713; - set bold/italic font
So if you want to set normal and bold at the same time, you can just chain control sequences together:
I only know the font control numbers off the top of my head; the others (like character spacing etc.) are probably somewhere in the urxvt docs.
Edit: I found the docs in man 7 urxvt and they explain why 50; doesn't work. 50; sets a new entire fontset (normal, bold, italic) and can dynamically increase/decrease font sizes, but it seems to work only for X11 fontsets (dashes and stars), not xft fonts. So AFAIK chaining multiple font sequences is the way to go (it works for me).
Last edited by 12foo (2015-12-09 15:42:42)
Wow, 7 year old necrobump, you should know better, qubodup.
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD
Making lemonade from lemons since 2015.