Switch bold font in Urxvt at runtime

0

As seen in the man page, one can switch the font in Urxvt using:

printf '\33]50;%s\007' "xft:Terminus:pixelsize=20"

However, having the following line in ~/.Xdefaults will cause bold fonts to not change:

urxvt*boldFont: xft:terminus:pixelsize=13

Weird font mix in Urxvt

How to decode \33]50;%s\007 and what code to use, so that bold fonts are changed?

qubodup

Posted 2015-11-08T10:17:41.573

Reputation: 3 736

Answers

1

The command to use for changing bold fonts is:

printf '\33]711;%s\007' "xft:Terminus:pixelsize=20"

The \33]50;%s\007 is close, but not the right place to look. For whatever reason, the link you reference is pointing to an incomplete page. This copy of urxvt(7) lists the code 711 which you would use to specify that the bold font should be changed, e.g., using

\033]711;%s\007

The manual page documents codes 50 and 711 respectively as

Ps = 50
Set fontset to Pt, with the following special values of Pt (rxvt) #+n change up n #-n change down n if n is missing of 0, a value of 1 is used empty change to font0 n change to font n

and

Ps = 711
Set bold fontset to Pt. Similar to Ps = 50 (Compile styles).

By the way, the given font specification

"xft:Terminus:pixelsize=20"

looks odd: one would expect something like this because you are asking for a bold font:

"xft:Terminus:pixelsize=20:style=bold"

Thomas Dickey

Posted 2015-11-08T10:17:41.573

Reputation: 6 891