LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to stop DPI from changing on resolution change (http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-dpi-from-changing-on-resolution-change-403450/)

arobinson74 01-14-2006 09:14 PM

How to stop DPI from changing on resolution change
 
I am running slackware inside of a virtual machine (vmware workstation 5.5) and running xfce on X. My home monitor is a 20" LCD at 1600x1200. I have set my DisplaySize in my xorg.conf to end up with 96 dpi with these settings. The problem occurs when changing resolutions.

Sometimes, I want to use my VM in a smaller window:
when running from x11vnc my laptop is 1400x1050
when on windows and linux at the same time, I like to run around 1280x1024 to be able to see both well

The problem is that when I change my resolution while X is running using "xrandr" or the display applet in xfce, the DPI changes to try to reflect my monitor size. I don't want this, I want the DPI to ALWAYS be 96 regardless of the resolution. That way on my laptop over vncviewer and when shrinking my vmware application window, my fonts will be readable (right now, if I set the resolution to 1400x1050 for example on my laptop the fonts are too small).

Is there any way to permanently fix the DPI and stop the font scaling by screen dimensions?

arobinson74 01-16-2006 12:57 AM

Just some more information. I started X (defaults to 1600x1200), then changed my resolution to 1152x864:
Code:

xdpyinfo | grep "resolution"
  resolution:    69x69 dots per inch
xdpyinfo | grep "dimensions"
  dimensions:    1152x864

Section from xorg.conf:
Code:

Section "Monitor"
    Identifier "vmware"
    VendorName "VMware, Inc"
    HorizSync 1-10000
    VertRefresh 1-10000
    #DisplaySize 542 406
    DisplaySize 474 356
EndSection

The display size seems to be ignored, as it should be 96 dpi at the given display size and resolution from what I saw on other posts, but it is 69 at this resolution and 1600 was still 96.

Any help appreciated

ibex 04-29-2006 03:29 PM

Hi man,

have you found any solution to this problem?
I am having exactly the same issues with my dpi
and VNC viewer. I would like to fix that at 96dpi.

Your advice much appreciated

arobinson74 04-29-2006 05:41 PM

Yes I did:

You must set the DPI explicitly in your window manager. I am using XFCE, so I looked at the .xinitrc file in my user directory and saw that it was pulling settings from "$HOME/.config/xfce" as the 'BASEDIR' and font information from "$BASEDIR/Xft.xrdb"

So I modified the ~/.config/xfce/Xft.xrdb. I now have the following:
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.rgba: rgb
Xft.dpi: 96

The key is the last line. This tells XFCE to always use 96 DPI. Now whatever resolution I use, 96 DPI will always be used.

ibex 04-30-2006 05:24 AM

That's a big success for you then.
Well done.

In my case, I use SUSE.10.1.beta9
with KDE and I cannot locate any files
and directories like the ones you mention.
There should be something similar though.

All the best

dive 04-30-2006 06:27 AM

If you have an nvidia card you can put this in driver section:

Code:

Option  "UseEdidDpi"  "FALSE"
Option  "DPI"  "96 x 96"


DrCR 08-03-2006 01:40 AM

Quote:

Originally Posted by ibex
That's a big success for you then.
Well done.

In my case, I use SUSE.10.1.beta9
with KDE and I cannot locate any files
and directories like the ones you mention.
There should be something similar though.

Check out this link for SuSE help. :)
Optimal Use of MS TrueType Core Fonts for a KDE Desktop on SuSE
en.opensuse . org/Optimal_Use_of_Fonts_on_SuSE

FYI it was founded on this link:
Optimal Use of Fonts on Linux
avi.alkalay . net/linux/docs/font-howto/Font.html

Sorry about the goofy links...the forum software settings are preventing from linking them properly.


Quote:

Originally Posted by dive
If you have an nvidia card you can put this in driver section:

Code:

Option  "UseEdidDpi"  "FALSE"
Option  "DPI"  "96 x 96"


Worked like a charm for me. Thanks! In my case I just wanted to get back to the 81x81 VectorLinux setting I had before Nvidia driver 1.0-8762 changed it to 75x75.

Code:

Section "Device"

### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
#Option    "ShadowFB"                  # [<bool>]
#Option    "DefaultRefresh"            # [<bool>]
    Identifier    "Card0"
    Driver        "nvidia"
    VendorName    "nVidia Corporation"
    BoardName      "Unknown Board"
    Option      "UseEditDpi"      "FALSE"
    Option      "DPI"    "85x85"
EndSection

DrCR

_____________
A8N5X, 3500+ VeniceE4, 2z512MB Corsair XMS, MSI NX7600GT-VT2D256E

noend 10-21-2006 07:38 PM

You can also avoid the use of the NVIDIA driver options by adding "-dpi 96" into the /etc/X11/xinit/xserverrc

My current xserverrc config is:

exec /usr/bin/X11/X -dpi 96 -nolisten tcp

DrCR 03-07-2007 09:06 PM

Quote:

Originally Posted by ibex
That's a big success for you then.
Well done.

In my case, I use SUSE.10.1.beta9
with KDE and I cannot locate any files
and directories like the ones you mention.
There should be something similar though.

Did you ever figure find it? I posted the Nvidia solution I'm using above, but I'd like to learn a non-Nvidia solution for then the need arises on a non-Nvidia vided rig.

Thanks,
DrCR

_____________

pannet1 03-15-2007 06:22 AM

hai every one i am anable to change in XFree86 under lfs


All times are GMT -5. The time now is 10:57 AM.