You are not logged in.

#1 2013-08-19 11:54:47

vohof
Member
Registered: 2013-08-14
Posts: 33

urxvt -fn works but not .xResources

When I run urxvt -fn "xft:Inconsolata\-g:style=g:pixelsize=13" on terminator, it opens urxvt with the desired font. However, why don't I get the desired font when I run xrdb -merge ~/.Xresources && urxvt?

$ tail -n 1 ~/.Xresources
URxvt*font:xft:Inconsolata\-g:style=g:pixelsize=13

Offline

#2 2013-08-19 21:04:15

bleach
Member
Registered: 2013-07-26
Posts: 264

Re: urxvt -fn works but not .xResources

try putting it in .Xdefaults create it if nessesary.

Offline

#3 2013-08-19 21:32:57

miroslavkoskar
Member
Registered: 2013-08-13
Posts: 8
Website

Re: urxvt -fn works but not .xResources

1) Use the key

URxvt.font:    xft:<font-definition>

2) After merging double check with

$ xrdb -query

inactive, migrated to new user account: <mkoskar> (https://bbs.archlinux.org/profile.php?id=83604)

Offline

#4 2013-09-22 09:28:54

csddff
Member
Registered: 2013-09-22
Posts: 3

Re: urxvt -fn works but not .xResources

bleach wrote:

try putting it in .Xdefaults create it if nessesary.

it doesn't work. actually, I installed ttf-Inconsolata too, Inconsolata\-g in .Xresources is parsed by urxvt as Inconsolata. I tried Insonlata\-z and something else, it seems "-z" is not parsed. But if words are separated by space, like xft:Bitstream Cyberbit, it will be parsed correctly

Last edited by csddff (2013-09-22 09:37:44)

Offline

#5 2013-09-22 09:32:04

csddff
Member
Registered: 2013-09-22
Posts: 3

Re: urxvt -fn works but not .xResources

miroslavkoskar wrote:

1) Use the key

URxvt.font:    xft:<font-definition>

2) After merging double check with

$ xrdb -query

I also tried 1), no effect. And xrdb -query -all displays it is configured right, but urxvt parsed it wrongly as Inconsolata. I am not sure if it is a bug or something

Offline

#6 2013-09-22 10:20:48

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: urxvt -fn works but not .xResources

I wondered why you had that backslash in there. It seems either urxvt or xft needs to see that hyphen escaped. Anyway, X resources also use the backslash for escape sequences, so you need \\ for a single backslash (just like you would have to escape the backslash for most shells if you don't put the value of -fn in double quotes).

Offline

#7 2013-09-22 14:24:44

csddff
Member
Registered: 2013-09-22
Posts: 3

Re: urxvt -fn works but not .xResources

Raynman wrote:

I wondered why you had that backslash in there. It seems either urxvt or xft needs to see that hyphen escaped. Anyway, X resources also use the backslash for escape sequences, so you need \\ for a single backslash (just like you would have to escape the backslash for most shells if you don't put the value of -fn in double quotes).

yeah, that works!. Thanks, Raynman. I installed Inconsolata-g from AUR, and fc-list tells there should be a backslash.

PS: I didn't figure out the double-backslash issue, but I came up with a work-around. Because I have to patch the font for powerline's fancy symbol, I changed the family name of the font to avoid the hyphen, by using FontForge. It also works

PS: Maybe we should put it into the wiki page, it's a little bit tricky

Last edited by csddff (2013-09-22 14:25:37)

Offline

#8 2013-11-05 21:50:20

vohof
Member
Registered: 2013-08-14
Posts: 33

Re: urxvt -fn works but not .xResources

@csddff, so what's the line suppose to be? I tried this one but it still does not work:

$ fc-list | grep -i inconso
/home/cyrus/.fonts/inconsolata-g/Inconsolata-g.ttf: Inconsolata\-g:style=g
/home/cyrus/.fonts/inconsolata-g/Inconsolata-g.otf: Inconsolata\-g:style=g

$ xrdb -query | noglob grep -i urxvt.font
URxvt*font:	xft:Inconsolata-g:style=g:pixelsize=14

Last edited by vohof (2013-11-05 21:55:45)

Offline

#9 2017-04-11 20:52:56

LindyBalboa
Member
Registered: 2016-10-06
Posts: 39

Re: urxvt -fn works but not .xResources

Sorry to bump an old thread, but I just ran into this issue. To make it blatantly clear, if the font name has a hyphen, you need TWO backslahses to get this to work.

.Xresources

URxvt*font: xft:Inconsolata\\-g for Powerline:style=g:pixelsize=14

Could a mod mark this as solved?

Last edited by LindyBalboa (2017-04-11 20:53:25)

Offline

#10 2017-04-11 22:05:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: urxvt -fn works but not .xResources

We don't know if vohof ever satisfactorily solved their problem, so I won't mark it as solved. Thank you for clarifying the solution, however.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB