Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] urxvt and local fonts
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 340

PostPosted: Thu Jul 17, 2014 7:16 pm    Post subject: [SOLVED] urxvt and local fonts Reply with quote

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
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Fri Jul 18, 2014 7:06 am    Post subject: Reply with quote

Have you checked this https://forums.gentoo.org/viewtopic-t-917820-start-0.html ?

To begin with, check if your ~/.fonts is still checked by the system. See if it is present in /etc/fonts/fonts.conf
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Fri Jul 18, 2014 10:37 am    Post subject: Reply with quote

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
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 340

PostPosted: Fri Jul 18, 2014 5:23 pm    Post subject: Reply with quote

v_andal wrote:
Have you checked this https://forums.gentoo.org/viewtopic-t-917820-start-0.html ?

To begin with, check if your ~/.fonts is still checked by the system. See if it is present in /etc/fonts/fonts.conf
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
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Mon Jul 21, 2014 7:36 am    Post subject: Reply with quote

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/ :wink:
Back to top
View user's profile Send private message
cubancigar11
Guru
Guru


Joined: 10 Jan 2005
Posts: 340

PostPosted: Tue Jul 22, 2014 5:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum