You are not logged in.

#1 2010-08-20 17:46:19

nschoe
Member
Registered: 2009-10-29
Posts: 23
Website

Questions about .Xdefaults

Hi all,

I have been reading some "linux-pro"'s dotfiles in order to see what existed and what could be done.
Recently, I found these lines in an .Xdefault:

Xft.dpi:         96
Xft.antialias: 1
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.rgba:        rgb

Well, I know what "dpi" means, but what I am not sure is: by setting Xft.dpi to 96, will it change the resolution of my screen? Or will it change the resolution of the papers I will print through my printer? Or... neither of them?
Another question is the last line: What does "Xft.rgba: rgb" actually do?
Thanks for your help.


The important thing is not to stop questioning.
If you can't explain something simply, you don't know enough about it.

Offline

#2 2010-08-20 18:02:42

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Questions about .Xdefaults

I don't know if it actually changes the screen DPI, but it does affect text (as if the DPI were changed).

And Xft.rgba affects the subpixel hinting.

https://bbs.archlinux.org/viewtopic.php?id=47844

Offline

#3 2010-08-20 18:28:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

The dpi settings affect only you screen.

Offline

#4 2010-08-20 19:28:10

nschoe
Member
Registered: 2009-10-29
Posts: 23
Website

Re: Questions about .Xdefaults

Hi thanks for you answers and the link.
Ok so, dpi affects the font, but how/where can I find the optimized value for my monitor? I am on a laptop, dunnow if it affects things that much.
I issued this:

xdpyinfo | grep resolution
> resolution: 112x112 dots per inch

. Is it relevant? Can I improve the number?


The important thing is not to stop questioning.
If you can't explain something simply, you don't know enough about it.

Offline

#5 2010-08-20 19:33:17

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

nschoe wrote:

Hi thanks for you answers and the link.
Ok so, dpi affects the font, but how/where can I find the optimized value for my monitor? I am on a laptop, dunnow if it affects things that much.
I issued this:

xdpyinfo | grep resolution
> resolution: 112x112 dots per inch

. Is it relevant? Can I improve the number?

DPI settings, hinting etc. are highly subjective and depend on a number of things: are you using latin fonts or far-eastern? While reading English may be easy with your settings, reading Chinese may not. Choose the settings *you* prefer as 'the pros' may have been from Taiwan and they might have been using hi-res screens.

Offline

#6 2010-08-21 10:59:18

nschoe
Member
Registered: 2009-10-29
Posts: 23
Website

Re: Questions about .Xdefaults

hi,
yeah you're totally right, settings must suit me, not the others, and that's clearly what I want to achieve. It's just that I don't like not understanding something, and about dpi, I tried several settings: dpi: 96, dpi: 112, dpi: 200. Each time I changed the settings I 'killall X', but when I loaded another terminal, nothing seemed to have changed. Moreover, when I issued 'dpyinfo | grep resolution' I still had 122x122. So I wonder: is there something I do wrong, or maybe there are fonts fro which dpi is not effective?
Now I think about it, I tried 'xft.antialias: true/false' and when I loaded a terminal, it didn't seem to take effect.

I read some pages in the 'man xft'` but it's specific and I could not understand the whole, what I understood is that Xft is a (program?) which is charged of rendering font on the scree. So here are my two questions: 1/ am I right about xft? 2/ by modifying xft settings in .Xdefaults (xft.antilias; xft.hinting; xft.dpi), it is supposed to affect every font displayed on screen (i.e. in browser, in terminal, in pidgin...)?

Sorry to bother you with such questions, but this is something I can't get right yet and that annoys me a it hmm

Thanks a lot for your time!

[EDIT]
I ran some tests, and here is what I came up with:
First of all, I didn't see any modifications because there was indeed no modifications, and that is because I wrote 'xft.dpi: 200' instead of 'Xft.dpi: 200', it seems it is case-sensitive. So modifying the anti-aliasing, and the dpi does work, but not in the terminal. When I set dpi to 200 (just to check), I saw modificatiosn when I launched chromium and pidgin: indeed the pop up messages -in chromium- were very big, and the floating boxes in pidgin too -with dpi set to 200-. I don't really understand why: I thought the higher to value in dpi was, the better resolution; well I set it to 96 and I find it nice, easy to read and all, so I will keep it as karol suggested; -but if anyone can explain to me the error I made when I though high dpi value meant high resolution, please do.
Moreover, I still don't understand why the settings don't affect the terminal -in my case urxvt- appearance.
[/EDIT]

Last edited by nschoe (2010-08-21 11:30:26)


The important thing is not to stop questioning.
If you can't explain something simply, you don't know enough about it.

Offline

#7 2010-08-21 11:54:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

When my terminal was lagging, I turned antialias off, but when I opened my browser, I turned it back on pretty quickly, because the fonts in firefox looked horrible.

You can change the fontsize like this

urxvt.font:             xft:terminus:antialias=false:pixelsize=14

so you don't have to tweak the dpi.

Last edited by karol (2010-08-21 11:56:04)

Offline

#8 2010-08-21 13:05:51

nschoe
Member
Registered: 2009-10-29
Posts: 23
Website

Re: Questions about .Xdefaults

Yeah, disabling anti-aliasing looks very bad indeed, I kept it. About dpi settings, I think I like how it is now -96 dpi.
In the configuration file I saw, the font was set that way, and looked quite well on the screen:

urxvt*font:     -xos4-terminus-medium-*-*-*-12-*-*-*-*-*-iso8859-2

I want to try it, so I

pacman -Ss terminus

and it offered me 'terminus-font' which I installed.
But when enabling the line -xos4... I got an error, because it says it can't load the base font or smth like that, and indeed, when I start xfontsel, I can't find that setting.
I checked '/usr/share/fonts/local' and I have dozens of 'ter-XXX' where XXX is a number. But I definitely can't load xos4-terminus as in the file. So I wonder where I can find it, or if it terminus-font but I did something wrong. Can you help me on that?

Thanks a lot for your help!


The important thing is not to stop questioning.
If you can't explain something simply, you don't know enough about it.

Offline

#9 2010-08-21 13:48:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

Different distros have packages and files named differently, so I think you should start with

urxvt.font:             xft:terminus:pixelsize=12

Offline

#10 2010-08-21 14:04:44

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Questions about .Xdefaults

nschoe wrote:

Can you help me on that?

It installs to /usr/share/fonts/local, which is not in your font path by default. You should add it to your X font path in /etc/X11/xorg.conf (FontPath   "/usr/share/fonts/local"), or if you don't have it maybe through your ~/.xinitrc (maybe like this: xset +fp /usr/share/fonts/local/ && xset fp rehash).

Xft settings you saw are for some legacy applications, the same settings (presuming one wants to use those exact) should be set in ~/.fonts.conf (or do it through KDE systemsettings or Gnome equivalent if you don't know how to).

DPI you can set by specifying a correct DisplaySize in your xorg.conf (ask Google how), or again if you don't have xorg.conf by providing the -dpi option when starting X, in Arch this can be done in /etc/X11/xinit/xserverrc (for example by appending -dpi 96 to the command that starts X).

Last edited by anrxc (2010-08-21 14:11:13)


You need to install an RTFM interface.

Offline

#11 2010-08-21 14:10:26

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

anrxc wrote:

Can you help me on that?

It installs to /usr/share/fonts/local, which is not in your font path by default. You should add it to your X font path in xorg.conf (FontPath   "/usr/share/fonts/local"), or if you don't have it maybe through your .xinitrc (maybe like this: xset +fp /usr/share/fonts/local/ && xset fp rehash).

Xft settings you saw are for some legacy applications, the same settings (presuming one wants to use those exact) should be set in ~/.fonts.conf (or do it through KDE systemsettings or Gnome equivalent if you don't know how to).

DPI you can set by specifying a correct DisplaySize in your xorg.conf (ask Google how), or again if you don't have xorg.conf by providing the -dpi option when starting X, in Arch this can be done in /etc/X11/xinit/xserverrc (for example by appending -dpi 96 to the command that starts X).

After

xset +fp /usr/share/fonts/local/ && xset fp rehash

the xos4 terminus font shows up in xfontsel so you can try using the config line you've found.

Thanks, anrxc, for the tip :-)

Last edited by karol (2010-08-21 14:14:06)

Offline

#12 2010-08-21 19:42:51

nschoe
Member
Registered: 2009-10-29
Posts: 23
Website

Re: Questions about .Xdefaults

Hi,
Actually, it's your config, anrxc, that I am reading and from which I inspire mine, on your git (sysphere) repo^^
I did what you said,adding the lines in my .xinitrc and it worked: I did set the font, and it is perfect^^
Thanks to both of you who helped me *a lot*!
My -hopefully- last question is: where can I find info about what can be put in the .Xdefaults? I mean, when I read anrxc's .Xdefaults first, I was amazed because I had no idea we could put so much into that file, so where can I find the different options?
Thanks a lot, again!


The important thing is not to stop questioning.
If you can't explain something simply, you don't know enough about it.

Offline

#13 2010-08-21 19:57:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Questions about .Xdefaults

I think you need to read e.g. urxvt's man pages if you want to know what to put where and why.

Offline

#14 2010-08-21 20:00:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Questions about .Xdefaults

The wiki page has some sample entries with contextual information: http://wiki.archlinux.org/index.php/Xdefaults


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#15 2010-08-21 20:59:35

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: Questions about .Xdefaults

nschoe wrote:

Actually, it's your config, anrxc, that I am reading

Small world huh? Then you can find my fonts.conf too.

nschoe wrote:

where can I find the different options?

Applications list resources in their manual, so by reading the manual. But you learn about a lot of resources just by reading Xdefaults of other users.

Last edited by anrxc (2010-08-21 21:00:18)


You need to install an RTFM interface.

Offline

Board footer

Powered by FluxBB