[CS-FSLUG] Yet another font fix

Ed Hurst softedges at tconline.net
Tue Sep 14 22:54:43 CDT 2004


I've been having trouble with my various Linux/Unix installs for some 
time now. The one thing that I never seemed to resolve was getting my 
DPI to balance out when I checked with 'xdpyinfo' -- I kept getting 
93x98, 89x100, etc. Not good, because this plays havoc with fonts 
display. Now, in FreeBSD, the 'startx -dpi 100' switch won't work (it's 
a long story). So I really needed to find a way to plug in a screen 
dimensions in my XF86Config that would balance out. Stumbled across it 
today:
-------------------------------------------------------------
If the X server is configured such that the dsplay pixels are not
square, it can cause errors in the alignment of vector and raster
features. To see if this is the case, run the command "xdpyinfo | grep
resolution:", for example:

    resolution: 98x108 dots per inch

If the X and Y DPI values are not equal or out by 1 then this may cause
misalignment. THE DPI values are calculated from the size of the
graphics window (in pixels) and the computer's estimation of the actual
monitor size. We can force the DPI values to be equal by overriding the
display size values.

The window and monitor sizes can be obtained from the X server using
"xdpyinfo | grep dimensions:", for example:

    dimensions: 1280x1024 pixels (330x250 millimeters)

We want to adjust the monitor size values so that the derived resolution
values come out equal in X and Y. However, we can only specify values in
whole numbers, so we sometimes need to perform some trial and error
calculations to get suitable values.

The easiest way to come up with new values is to adjust the given
monitor size values until they are in the same aspect ratio as the
graphics window. Using the above example, we try:

1280 / 1024 * 250 = 312.5 - not an integer
1280 / 1024 * 251 = 313.75 - not an integer
1280 / 1024 * 252 = 315

Ok, we now have a suitable monitor size, 315x250. We are now ready to
actually change the server to match this.
---------------------------------------------

So far, this is working like a charm for me.

-- 
Ed Hurst
-----------
A Bible Site -- http://webs.tconline.net/softedges/
Linux & Unix Help -- http://ed.asisaid.com/
Blog -- http://ed.asisaid.com/blog/
---
[This E-mail scanned for viruses by Declude Virus]





More information about the Christiansource mailing list