You are not logged in.

#1 2013-11-19 19:02:15

archbawks
Banned
Registered: 2013-03-17
Posts: 75

DPI Settings and Conky Font Displays

I have a set custom value for the DPI under X.Org in .Xresources. This is so that I don't have to keep messing with font sizes under various DEs.

However under certain circumstances the fonts aren't properly sized/aligned in Conky. Is it possible to set a DPI setting of 96 (the default) for Conky only?

Offline

#2 2013-11-20 00:12:36

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: DPI Settings and Conky Font Displays

You don't have to play with DPI when setting up conky: just change the font size in your config file.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2013-11-20 10:33:01

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Re: DPI Settings and Conky Font Displays

Yes I'm trying to use a Conky script which has whitespaces in it and this particular script was written with a standard 96 DPI in mind.
So if I change the DPI on my own desktop the spacing is all wrong inspite of adjusting the font sizes.

DPI alters whitespaces too in addition to font sizes.

Offline

#4 2013-11-20 14:33:44

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: DPI Settings and Conky Font Displays

Open a terminal:

 sudo nano /etc/x11/xorg.conf 

If you have an nvidia, scroll down to the DEVICE section and add a line at the end

Option        "DPI"  "96 x 96" 

Offline

#5 2013-11-20 18:57:05

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: DPI Settings and Conky Font Displays

I see your point -- thanks for clarification.

There is a trick with DPI you may try. Normally, you set the global DPI value in Xorg config file (or a parameter for startx: 'startx -- -nolisten tcp -dpi 96 vt1') and .Xresources. However, you can also specify one more value in /etc/fonts/fonts.conf or $HOME/.config/fontconfig/fonts.conf:

<match target="pattern">
    <edit name="dpi" mode="assign">
      <double>72</double>
    </edit>
 </match>

You can consider it a sort of a 'corrective' setting which some applications respect (e.g. Chrome, Openbox). If conky is able to use it, then you should be able to fix letter spacing issues and set font size properly. Check this out, maybe it helps.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#6 2013-11-20 19:32:05

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Re: DPI Settings and Conky Font Displays

^^^ Thanks for the sugestion Bohoo.
What's you're suggesting is to alter the DPI for just the fonts globally?
I prefer to alter the sizes of whitespaces too in order to maintain the proportion of screen realestate usage.

I was actually hoping for a solution to alter DPI exclusively for Conky windows only or something such like. I shall continue thinking about it in the meantime.

Offline

#7 2013-11-20 21:19:06

bohoomil
Banned
Registered: 2010-09-04
Posts: 2,377
Website

Re: DPI Settings and Conky Font Displays

I'm afraid that if an option like this isn't mentioned in the conky manual--and it doesn't seem to be as far as I know--then it is probably impossible to apply a different resolution exclusively to it. By default, conky uses libXft as its backend, so altering DPI value in Xresources should let you achieve what you want. However, quite a few applications will be affected, too. That is why I'd try to experiment with fontconfig parameter as well since this particular one works in a different way (hence you can fix some rendering oddities with it). With the two--Xresources and fontconfig--you can try to find a happy medium. Alternatively, using a different font family may be the easiest and most effective workaround.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#8 2013-11-20 21:21:38

ImperfectLink
Member
Registered: 2013-11-18
Posts: 16

Re: DPI Settings and Conky Font Displays

Start with editing xorg.conf and if it doesn't sort out your problem you can mark that off the list.

Offline

Board footer

Powered by FluxBB