View previous topic :: View next topic |
Author |
Message |
cubancigar11 Guru
Joined: 10 Jan 2005 Posts: 340
|
Posted: Thu Jul 17, 2014 7:16 pm Post subject: [SOLVED] urxvt and local fonts |
|
|
Hi!
I have installed inconsolata in my home directory (~/.fonts). Is there a way I can use it with urxvt? Please guide me step by step - should I setup some startup script to do xset +fp? Or if it is possible to do without it? Will it be a better option to copy my fonts in /usr/local/share/fonts directory? If so, what should I add in xorg.conf to have it detected?
Last edited by cubancigar11 on Tue Jul 22, 2014 5:44 pm; edited 2 times in total |
|
Back to top |
|
|
v_andal Guru
Joined: 26 Aug 2008 Posts: 541 Location: Germany
|
|
Back to top |
|
|
boerKrelis Apprentice
Joined: 01 Jul 2003 Posts: 241 Location: The Netherlands
|
Posted: Fri Jul 18, 2014 10:37 am Post subject: |
|
|
You can use fonts with urxvt in two ways.
Simple:
Code: |
% xlsfonts | grep gohu
<snip/>
-gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1
-gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso8859-1
|
and then in your .Xresources / .Xdefaults:
Code: |
% grep gohu .Xresources
urxvt*font: -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1
|
Or, use fonts through Xft (if you compiled in support for that). This would give you antialiasing and stuff. In that case, your .Xresources would say something like this:
Code: |
urxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=36
|
|
|
Back to top |
|
|
cubancigar11 Guru
Joined: 10 Jan 2005 Posts: 340
|
Posted: Fri Jul 18, 2014 5:23 pm Post subject: |
|
|
Yes, I checked it. It didn't help
xlsfonts doesn't list any install fonts. It lists nothing but fixed fonts. Here is its output: http://pastebin.com/X8QDX2ff
/etc/fonts/fonts.conf has following entry: Code: | <dir>/usr/share/fonts</dir>
<dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir> | Though I wonder, looking at the inlined comment, how useful it will be in future.
My /etc/X11/xorg.conf has following in it: Code: | Section "Files"
FontPath "/usr/share/fonts/local"
EndSection | That directory doesn't exist, but anyway, "xset q" lists only this much: Code: | Font Path:
/usr/share/fonts/misc/,built-ins
|
|
|
Back to top |
|
|
v_andal Guru
Joined: 26 Aug 2008 Posts: 541 Location: Germany
|
Posted: Mon Jul 21, 2014 7:36 am Post subject: |
|
|
Well. There are 2 systems for providing fonts.
The old one provides fixed width fonts. It is configured via Files section of xorg.conf. By default it always adds some directories, which you see reported by 'xset q'. The command xlsfonts can be used to see available fonts and command xfontsel can be used to select some font.
The new one can handle both types of fonts, though by default it hides fixed width fonts. This system is configured via /etc/fonts/fonts.conf To see available fonts one uses fc-list command. This system is ugly (from my perspective). It attempts to be very user friendly, so it is kind of Microsoft in Linux As result of this friendliness there's no guarantee that you'd get the font you requested. The system may substitute it with one, that it believes suits you better. Well, sorry for rambling.
Anyway. By default urxvt works only with old system. To work with new system, you have to compile it with xft USE flag. Now, inconsolata provides fonts.dir so it should be fairly easy to use it with old system. Just add your directory to xorg.conf file (not /etc/fonts/fonts.conf). And then use '-misc-inconsolata-medium-r-normal--0-0-0-0-p-0-iso10646-1' as font for your URxvt*font in .Xresources. Well, if you don't want to restart your X, then you may want to use command
'xset +fp /home/my/.fonts/inconsolata' or whatever is appropriate path. This command can be placed in start up script if you don't want to put this directory into xorg.conf.
Though I have to admit, that even though I can see the font name, my application can't use this font. Maybe it will be better for you. Otherwise you'll have to try new system, and there you'll never know which font you actually got. At least in my case, I got some ugly looking blurry font. Oh well, I may have some wrong configuration in /etc/fonts/ |
|
Back to top |
|
|
cubancigar11 Guru
Joined: 10 Jan 2005 Posts: 340
|
Posted: Tue Jul 22, 2014 5:43 pm Post subject: |
|
|
Thanks! That helped. Instead of adding /usr/local/share/fonts, I needed to ad /usr/local/share/fonts/inconsolata in the xorg.conf file. I compiled urxvt with xft useflag and now I am able to use both methods to switch fonts. |
|
Back to top |
|
|
|