代码:
引用:$ xdpyinfo |grep resolution
resolution: 75x75 dots per inch
因为我的实际 dpi 为 90, 故 75 对我来说低了。如果让 X server 工作在正确的 dpi,有多种途径,而且不同发行版略有差异,由于篇幅所限,只能部分介绍,具体请参考:
Mozilla DPI-related Font Size Issues on Unix
Solving the Linux DPI Puzzle
引用其中的几句话,简单看一下有哪几种和它们的优先级:
引用:
引用:How the XFree86 and Xorg servers calculate DPI
The DPI of the X server is determined in the following manner:
1. The -dpi command line option has highest priority.
2. If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.
3. If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.
4. If DDC does not specify a size, 75 DPI is used by default.
You can check what DPI your X server is set to by running xdpyinfo | grep resolution in a terminal window.
对于 Debian/Ubuntu 我采用方法 2,下面的设置改成你自己的,注意 dpi 的数值最好为 6 或 12 的倍数,原因:
引用:
引用: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.
同时你可以更加自己的满意程度,进行微调。
代码:
引用:$ vi /etc/X11/xorg.conf 加入
Section "Monitor"
......
DisplaySize 287 215 # 1024x768 90dpi
......
EndSection
这里的 287, 215 即我的实际显示区域的宽和高,单位为 mm。
重启 X 后,生效。以 gdm 为例:
代码:
引用:$ /etc/init.d/gdm restart
查看是否生效:
代码:
引用:$ xdpyinfo |grep dimensions
dimensions: 1024x768 pixels (289x217 millimeters)
$ xdpyinfo |grep resolution
resolution: 90x90 dots per inch
告诉 X server 实际 dpi 后,最直观的感觉就是用 gdm 登录管理器,在使用默认 75dpi 下,gdm Option 菜单和输入框中的字体会显得较小,其它的变化待大家慢慢发觉吧!


pinkfirex 于 2006-08-20 16:11:18发表:
好东东,帮顶了