QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1929|回复: 1

DPI Problem Solving

[复制链接]
发表于 2006-10-1 20:21:10 | 显示全部楼层 |阅读模式
http://www.mozilla.org/unix/dpi.html
[code:1]
Both points and DPI either too small or too big are typically caused by a mismatch between your real display size and the display size your X server thinks you have. So, if you don't like Mozilla's UI font sizes, start to correct your problem by reconciling the two sizes. Measure your display, and change whatever settings are required to cause the X server to report and use the actual display size.

GTK1 Mozilla does not respond to DPI adjustments with corresponding changes in UI fonts. Adjustments to GTK1 UI fonts must be made via gnomecc or via userChrome.css.

To find out what your X server thinks your DPI settings are, run the program xdpyinfo:

        $ xdpyinfo | grep dimensions
        $ xdpyinfo | grep resolution
Note the dimensions in pixels and millimeters, and the resolution in DPI. Compare to what you're actually using, but don't confuse dots and pixels - a dot may or may not equal a pixel. If you have KDE, kinfocenter's X-Server section will conveniently show the same information.

For example, if you use a 17" CRT display, your viewable screen dimensions will be approximately 328 mm wide by 246 mm tall. This actual size can usually be forced by adding:

        DisplaySize        328        246to
        Section "Monitor"in /etc/X11/XF86Config or /etc/X11/xorg.conf, as applicable on your system. If you are running a 1400 X 1050 resolution with a 328 mm X 246 mm display, your system will be running at an actual 108 DPI. In most cases, this change will be sufficient to correct your problem.

If the above change improves your system, but the result is less than 100% to your satisfaction, you can tweak sizes up or down by making the DisplaySize dimensions slightly larger or smaller than actual.

Unfortunately, variations in the implementations of X mean display size reconciliation as above won't be a solution on every system. Failure here seems to be common on newer systems using fontconfig instead of legacy xfs.

Many systems using fontconfig have the regular file /etc/X11/Xresources. On many of these systems, adding to this file a line:

        Xft.dpi: 108would produce the same result as setting DisplaySize produces for xfs. On systems with the directory /etc/X11/Xresources, instead try putting the Xft.dpi: setting in ~/.Xresources. On some systems, setting DisplaySize first, and then setting Xft.dpi to match the reported DPI is required for proper results.

As above, if this works, but at less than 100% satisfaction, tweak the number lower or higher to suit your preference. If possible, use a number that is a multiple of 6, or even 12, as numbers that aren't sometimes result in annoying rounding errors that cause adjacent bitmap font sizes to not increment and decrement linearly.

All Mozilla.org builds of Firefox and SeaMonkey, some of Mozilla, and most builds of these products supplied by recent Linux distros, are built using the GTK2 toolkit. This means that gnome-control-center can be used to explicitly set DPI to a desired value that these builds will share with all other GTK2 apps.

Some users have found success in adjusting the X server's DPI by doing one of the following:

Using the graphical login screen:

In /etc/X11/xdm/Xservers, change:

        :0 local /usr/X11R6/bin/Xto:

        :0 local /usr/X11R6/bin/X -dpi 100You need to restart xdm for this to work:

        $ su - root
        # telinit 3
        # telinit 5Using Redhat and gdm:

In /etc/X11/gdm/gdm.conf, change:

        0=/usr/bin/X11/Xto:

        0=/usr/bin/X11/X -dpi 100You will need to restart gdm for this to work

In some Debian variants:

In /etc/init.d/xsession, or /etc/kde3/kdm/Xservers, change:

        DPI="-dpi 75"to include whatever DPI you wish to use instead of 75.

You will need to restart X for this to work

Using startx from the command line:


$ startx -- -dpi 100If none of the above or variations thereof work, as a last resort, you can use the brute force method of forcing Mozilla to use a particular DPI directly. Edit your user.js file and add:

        user_pref("browser.display.screen_resolution", 108);You may change the DPI number to any resolution you like. Setting it to 0 will restore Mozilla's use of the X Server DPI. Like prefs.js, user.js is a plain text file in your profile directory. If it doesn't exist, create it with your choice of text editor.

As an alternative to editing user.js, you can change browser.display.screen_resolution by entering

        about:configin the urlbar, right clicking the current value, and changing it to any number you like.

A third way to change Mozilla DPI by brute force is via the preferences UI:

        Appearance        ->        Fonts        ->        Display resolutionChanges to browser.display.screen_resolution by any of the three methods above require a complete Mozilla restart to take effect.

Note - The DPI preference for development builds of Mozilla was changed from browser.display.screen_resolution to layout.css.dpi February 28, 2006.
[/code:1]
 楼主| 发表于 2006-10-1 20:25:52 | 显示全部楼层
http://mrmazda.no-ip.com/auth/dpi-screen-window.html
显示当前设置
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-25 09:02 , Processed in 0.056794 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表