[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command to determine resolution



Brian Potkin <brian@copernicus.demon.co.uk> writes:
BP> If I understand you correctly you are saying that using -dpi 75 informs
BP> an application which wants to display a 72 point font that it will be
BP> allowed 75 pixels whereas with -dpi 100 it will get 100 pixels.  Having
BP> spent some time in the recent past playing with this setting I have to
BP> wonder why it is then that changing it on my system does not alter the
BP> font size on the screen at all with the majority of applications I use.
BP> There may be others, but only I have found only Lyx, August and Ted to
BP> respond to an alteration in the dpi switch.

It all has to do with how you name your fonts.  Let's look at a full
font name:

        -adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1

This is an Adobe font named 'courier'.  It's 'medium' weight (as
opposed to, typically, 'bold'); it's 'r'oman (not 'i'talic or
'o'blique), normal width, and has no magic attributes.  Jumping to the 
end, it's a 'm'onospaced (not 'c'haracter-cell or 'p'roportional)
font, and uses the ISO 8859-1 encoding.

The other numbers are more interesting.  In order, they are:
 10: pixel size of the font
100: point size of the font, times 10
 75: horizontal resolution of the font in dpi
 75: vertical resolution of the font in dpi
 60: average width of a character (in points times 10?)

Now, you can leave out parts of the specification by replacing them
with asterisks.  If you leave out the pixel size, one is calculated
from the point size and DPI; similarly, a point size can be calculated 
from the pixel size and DPI.  If you leave out the font resolution, a
default one is calculated.

What you probably actually want for "10-point Courier" is

        -*-courier-medium-r-normal-*-*-100-*-*-m-*-iso8859-1

which will get you a monospaced font from some foundry named 'courier' 
using the iso8859-1 encoding, at 10 points.  But it's unfortunately
common among programs to either (a) record the full name of the font,
including point size and DPI, so when you change server DPI the font
doesn't follow, or (b) use legacy font names like '6x9', which refer
to character-cell bitmap fonts exactly six pixels wide and nine tall.

-- 
David Maze             dmaze@mit.edu          http://www.mit.edu/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: