You are not logged in.

#1 2023-12-12 08:55:38

jijr
Member
Registered: 2023-10-15
Posts: 2

[SOLVED] trouble using certain X fonts via .Xresources with URxvt

Hi all. I've had this recurring issue with certain fonts, noticeably fonts that contain non-latin characters in the proper font name, when trying to specify them with .Xresources: They simply will not pass to URxvt even after merging the .Xresources file with xrdb-merge. The font I am currently attempting to use, according to fc-list, is "CRPC&G流麗太行書体", though this issue isn't specific to this font, but rather to any font I try to use that contains non-latin characters and no alternative names. When the following .Xresources file is merged to xrdb, new instances of URxvt fall back to the system default font:

 URxvt.font: xft:CRPC&G流麗太行書体:size=15

Checking to make sure the font name is correct with fc-list again and

fc-match CRPC&G流麗太行書体

returns the following:

CRccgryb.ttc: "CRPC&G流麗太行書体" "regular"

What is curious is that when I manually specify this font via the --font flag when starting a new instance of URxvt through another terminal as follows:

urxvt --font 'xft:CRPC&G流麗太行書体:size=15'

the font displays correctly, leading me to assume that for whatever reason, .Xresources isn't being parsed correctly. Perhaps due to the font name? Is there some kind of convention or escaping necessary when a font name contains non-latin glyphs?

Thank you all in advance and I hope this evening is finding everyone well :-)

Last edited by jijr (2023-12-12 19:23:11)

Offline

#2 2023-12-12 14:13:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: [SOLVED] trouble using certain X fonts via .Xresources with URxvt

xrdb -q | grep -i rxvt

Offline

#3 2023-12-12 18:00:55

jijr
Member
Registered: 2023-10-15
Posts: 2

Re: [SOLVED] trouble using certain X fonts via .Xresources with URxvt

returns

URxvt.font:	xft:CRP\U0000ff23\U0000ff06\U0000ff27\U00006d41\U00009e97\U0000592a\U0000884c\U000066f8\U00004f53:size=15

Is there a way to pass .Xresources to xrdb without encoding into control chars?
EDIT:
Using the -nocpp flag with xrdb fixes this.

xrdb -nocpp .Xresources

Font displays correctly in terminal now, and xrdb -query returns

URxvt.font:	xft:CRPC&G流麗太行書体:size=15

Marking post as solved.

Last edited by jijr (2023-12-12 19:22:50)

Offline

Board footer

Powered by FluxBB