You are not logged in.
While I'm getting older my eyes are too. I looked for some way to change the
terminal font on the fly, like you can do with 'setfont' in the VT. I found
none, so I came up with this, nothing fancy but quite handy.
Project: http://github.com/trapd00r/pickyfont
AUR: http://aur.archlinux.org/packages.php?ID=39032
Last edited by dmz (2010-08-22 19:34:31)
Offline
Great work dmz.
The program depends on the WM?
This work for any Wm, for example Wmii?
Offline
All I see is
printf "\033]50;${font}\007"
Where did you find this trick dmz?
Edit: xlsfonts is a helpful tool for getting that list if you don't already use it.
Last edited by lolilolicon (2010-03-15 16:50:04)
This silver ladybug at line 28...
Offline
Great work dmz.
The program depends on the WM?
This work for any Wm, for example Wmii?
I see no reason why it shouldn't.
Offline
All I see is
printf "\033]50;${font}\007"
Where did you find this trick dmz?
Edit: xlsfonts is a helpful tool for getting that list if you don't already use it.
Strange. What terminal are you using? Works in xterm and urxvt for me.
I found this in the urxvt manpage. Thanks for the xlsfont tip, that was indeed nice.
Edit:You don't have them fonts installed, which results in the raw string prints.. Try with fixed, it's as default as it gets I think.
Last edited by dmz (2010-03-16 03:59:06)
Offline
I thought about parsing the xlsfonts output to provide a list that's up to date and correct for each system, but there were loads and loads of fonts and types, and no way to parse the 'friendly names' either, not even with -l(llll).
Oh well, I guess that most people have terminus and fixed at least. I think that profont is OK, too.
Offline
This does not work for me in urxtv? I use rxvt-unicode (urxvt) v9.07
It works fine in xterm, so I am not sure why this would be. Are you sure it is from the urxvt man page, and not the xterm man page you got that escape sequence?
Offline
This does not work for me in urxtv? I use rxvt-unicode (urxvt) v9.07
It works fine in xterm, so I am not sure why this would be. Are you sure it is from the urxvt man page, and not the xterm man page you got that escape sequence?
Line 1046 in 'man urxvt' my friend.
Edit: Does something like this work for you?
echo -en "\033]50;-*-terminus-*-*-*-*-14-*-72-72-*-*-*-*\007"
printf "\033]50;-*-terminus-*-*-*-*-14-*-72-72-*-*-*-*\007"
Also, how does it not work? What happens?
Last edited by dmz (2010-03-16 05:49:41)
Offline
lolilolicon wrote:All I see is
printf "\033]50;${font}\007"
Where did you find this trick dmz?
Edit: xlsfonts is a helpful tool for getting that list if you don't already use it.
Strange. What terminal are you using? Works in xterm and urxvt for me.
I found this in the urxvt manpage. Thanks for the xlsfont tip, that was indeed nice.Edit:You don't have them fonts installed, which results in the raw string prints..
Try with fixed, it's as default as it gets I think.
Haha, I meant `printf "\033]50;${font}\007"` was the tricky part which was new to me
This is a nice find indeed, thanks for sharing!
This silver ladybug at line 28...
Offline
Line 1046 in 'man urxvt' my friend.
Edit: Does something like this work for you?echo -en "\033]50;-*-terminus-*-*-*-*-14-*-72-72-*-*-*-*\007" printf "\033]50;-*-terminus-*-*-*-*-14-*-72-72-*-*-*-*\007"
Also, how does it not work? What happens?
Ah, I see it
I tried both the print and the echo, but they do nothing. Absolutely nothing.
I wonder if this requires xft, or I have disabled something in my xrdb... hmmm
I suppose it works perfectly for you in urxvt?
[Edit]
Ok, it seems to work with some fonts, ie, I can switch to something like 9x15, and back to my normal font (dina), but there are several others that don't work (from xfontsel). I will tinker more with this and return...
[Edit2]
Ok, I am an oaf it seems. It seems to be a missing font issue, but I would swear that it did not work with fixed[1..8] at first... but everything seems fine now.
Thx for this find. It will come in handy
Last edited by alterecco (2010-03-16 12:49:00)
Offline
Handy tool, dmz thanks.
In my case I often specify both *font and *boldFont values in my Xdefaults since terminus doesn't include bold letters at the smaller sizes.
Pickyfont doesn't appear to set/change the boldFont if it was previously specified.
thayer williams ~ cinderwick.ca
Offline
Handy tool, dmz thanks.
In my case I often specify both *font and *boldFont values in my Xdefaults since terminus doesn't include bold letters at the smaller sizes.
Pickyfont doesn't appear to set/change the boldFont if it was previously specified.
I found a different escape sequence to switch fonts at runtime:
# normal font
printf "\033]710;%s\007" "${font}"
# bold font
printf "\033]711;%s\007" "${bold_font}"
See http://lists.schmorp.de/pipermail/rxvt- … 00886.html for a urxvt perl extension.
Edit: it all in man 7 urxvt
XTerm Operating System Commands
"ESC ] Ps;Pt ST"
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
Ps = 710 Set normal fontset to Pt. Same as Ps = 50.
Ps = 711 Set bold fontset to Pt. Similar to Ps = 50 (Compile styles).
Ps = 712 Set italic fontset to Pt. Similar to Ps = 50 (Compile styles).
Ps = 713 Set bold-italic fontset to Pt. Similar to Ps = 50 (Compile styles).
Last edited by lolilolicon (2010-03-16 15:28:58)
This silver ladybug at line 28...
Offline
Ah... I noticed the same thing just now. Thanks lolilolicon!
Offline
Hm... I dont get neither of those to work in the script, though they work nicely in the shell. Strange.
Offline
Finally I had time to fix the bold/italic issue. http://github.com/trapd00r/pickyfont
Thanks for noticing.
Offline
And while I am getting older I also learn new stuff.
I rewrote the whole thing and made it easier, added lots of fonts and a
description for each as well. Wasnt very informative with 'fixed18'.
Looks like...
Enjoy...
Offline
It's cool
How can i save the font picked in .Xdefaults?
arst
Offline
It's cool
How can i save the font picked in .Xdefaults?
Ah. Maybe that'd be a feature.
Or did you mean manually?
I do it like this;
URxvt.shiva*font: -*-profont-*-*-*-*-11-*-*-*-*-*-*-*
If you want the font for all urxvt's;
URxvt*font: *-profont-*-*-*-*-11-*-*-*-*-*-*-*
Offline
Ah. Maybe that'd be a feature.
Or did you mean manually?
No, i was looking for an automatically way. But thanks, I hope you add that "feature" in next versions
arst
Offline
So I've finally added functionality for changing fonts based on typeface:
pickyfont set ter4 bold
pickyfont set pro3 italic
pickyfont set pro7 normal
pickyfont set pro2 all
Which means you can have different fonts for normal/bold/italic - good for small fonts that doesnt support a bold fontface.
Offline
+Support for arbitary fonts:
pickyfont 0.4
USAGE: pickyfont OPTIONS
OPTIONS
list list available fonts
set font (typeface)
arb set font to arbitary string, see below
Typeface can be normal, bold, italic or all
You can specify arbitary font to use, like so:
pickyfont arb lucidasanstypewriter-bold-24
The 'arb' flag is optional:
pickyfont 8x13
is valid as well
I can highly recommend installing Monte Carlo and Profont, issue:
pickyfont monte1 normal
pickyfont monte2 bold
pickyfont pro1 italic
... and check the look of vim, or, why not, yaourt -Ss foo. My new favourite setup for sure.
Offline
Some updates since last time... and I need your help.
From the manpage:
There is no reliable way to get friendly font names from the X.org server. One could parse the output from xlsfonts, but that output could be insanely long and will only show the raw names and several duplicates as well.
Therefore I see no other way then to keeping a (configuration)? file with more or less standard font mappings that most people would (in many cases, should) have installed, and let them pick from that.
Any ideas, mates?
Offline