LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Changing fonts in rxvt and mc (http://www.linuxquestions.org/questions/slackware-14/changing-fonts-in-rxvt-and-mc-570129/)

matthew1181 07-17-2007 12:10 PM

Changing fonts in rxvt and mc
 
Hello, I'm trying to change the fonts in my terminal (rxvt) and file manager (Midnight Commander). I may just want to change the font size. I'm using fluxbox, but I don't think it's a setting that fluxbox controls. Is it something I change in .Xdefaults (under user directory)? I tried someone else's .Xdefaults file, which had listed

rxvt*font: ter-128b

but that is too small.

Thanks.

slakmagik 07-17-2007 08:09 PM

mc doesn't have fonts; that's dependent on the terminal emulator. And some have their own config files but xterm (and rxvt, I believe), do indeed use .Xdefaults or .Xresources or whatever script you have xrdb read. That looks like an alias for a terminus font but I'm not sure/can't remember what the 128 is. In a full XLFD, you'd have:

-xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso8859-1
-xos4-terminus-medium-r-normal--24-240-72-72-c-120-iso8859-1

and you'd want to change the pixel size/point size (20-200/24-240). So if it's too small, just try one bigger, run 'xrdb -merge FILE', and launch rxvt again. You can use 'xlsfonts' (or xfontsel) to see what options you have for font choices.

slakmagik 07-17-2007 08:10 PM

Just noticed this was your first post - welcome to LQ. :)

matthew1181 07-18-2007 09:04 AM

Yes, it's an alias for Terminus.

I did not have them installed correctly -- well, I may not still. I got them from here:

http://www.is-vn.bg/hamster/jimmy-en.html

It has a section that says:

Quote:

Slackware package:

source: terminus-font.SlackBuild, slack-desc

To build and install a Slackware package: download terminus-font.SlackBuild, slack-desc, terminus-font-4.20.tar.gz and any character variants you'd like, then as root execute "sh ./terminus-font.SlackBuild" and "installpkg /tmp/terminus-font-4.20-noarch-4dtz.tgz".
I did this and they're showing up in xlsfonts and xfontsel now. However I still don't know how to get rxvt and mc displaying them. I edit a .Xdefaults file in my /home/<usr> directory? or is it the .Xdefaults in /home/?

Trying to change

Quote:

rxvt*font: ter-128b
in the .Xdefaults did not seem to work -- I think it registers that as a non-font and supplies something else.

- Matthew

p.s. Yes, second post here. Thanks for the help!

dive 07-18-2007 09:13 AM

You need to start rxvt with the font in the command line:

xrvt -fn xxxx

xfontsel will allow you to pick a font.

xrvt -h for other settings.

matthew1181 07-18-2007 09:25 AM

"rxvt -fn <XLFD>" works, but I'm looking for permanent settings. (It returns to the old font after closing the window).

slakmagik 07-18-2007 09:37 AM

You can do as dive says to see if you can get it working at all and, if it does, even make an alias to make the font flag automatic, but xrdb is the usual course.

Quote:

Originally Posted by matthew1181
I edit a .Xdefaults file in my /home/<usr> directory? or is it the .Xdefaults in /home/?

It would probably be /home/$USER, yes, though it can be any file. I don't use a display manager, so start X with 'startx', which means my ~/.xinitrc gets read and, in that file, I have
Code:

xrdb -merge ~/.xresources
So that's the file it is for me (the uppercase bugged me). I think the default is to read a system-wide file and then ~/.Xdefaults or ~/.Xresources

Quote:

Originally Posted by matthew1181
Trying to change

rxvt*font: ter-128b

in the .Xdefaults did not seem to work -- I think it registers that as a non-font and supplies something else.

Change to what? What was the result? Specifying things like this will help you get help. Depending on what your fonts.alias in your terminus directory says, you may need to specify different things but, as long as X is aware of the fonts the XLFD (the full weird string) should always work. If it said something like 'unable to find font foo, defaulting to "fixed"', then, yeah, it's not finding the font, but if you feed in what xlsfonts spits out, that shouldn't happen.

As I say, you will need to run 'xrdb -merge ~/.Xdefaults' to get the config changes to rxvt to take effect. You didn't specify whether you did that.

Quote:

Originally Posted by matthew1181
p.s. Yes, second post here. Thanks for the help!

Welcome. :)

slakmagik 07-18-2007 09:40 AM

Dunno how I missed your last post. So that's good. It's not a font issue but purely an .Xdefaults or xrdb issue. One other thing to try is 'xprop WM_CLASS' on an rxvt window to make sure its class is 'rxvt', but it certainly is. So doing something like

Code:

XTerm*font: -xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso8859-1
(only with 'rxvt' or 'Rxvt' or whatever, and your preferred font) should work.

matthew1181 07-18-2007 09:41 AM

Ah ha! I solved it.

Okay this is what you do.

You must include the full XLFD in the .Xdefaults of your user directory. Or, if you include an alias, I must be typing it wrong, so I have used the XLFD instead.

I used -xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso8859-1.

So in /home/<user>/.Xdefaults I have:

Quote:

rxvt*font: -xos4-terminus-medium-r-normal--20-200-72-72-c-100-iso8859-1
and now Midnight Commander looks like this on 1280x960 resolution in Fluxbox:

http://img400.imageshack.us/img400/9...erminusbn1.png


Thanks for the help everyone!

matthew1181 07-18-2007 09:44 AM

Sorry digiot -- I must have been in the midst of posting that while you were responding. By the way, it seems to have worked without using 'xrdb -merge ~/.Xdefaults'.

MannyNix 07-18-2007 03:10 PM

If you're in a hurry or just lazy, just press
Code:

shift + <--(keypad)
or - to increase/decrease font size

pdw_hu 07-19-2007 07:37 AM

You can also try running xlsfonts to see how your font would look like.

mdooligan 03-11-2010 07:00 PM

rxvt fonts
 
Been playing with this for a while and this one worked beautifully for me:

rxvt -fn -misc-fixed-medium-r-normal-*-15-*-*-*-*-*-*-*

Nice and readable. Has all the line drawing chars for mc also.


All times are GMT -5. The time now is 01:33 AM.