Character Size on SGI Machines
QUESTION: Why are plot character sizes larger on SGI machines than they are on other machines that IDL runs on?
![]()
ANSWER: This is a deep mystery that no one (including, apparently, RSI technical support engineers) seems to know the answer to. But the fact that character sizes are larger on SGI machines certainly plays havoc with the way plots look when you run code written on an SGI machine on a SUN or HP machine or visa versa.
Here is what I know about the situation. (Thanks to Liam Gumley for making me aware of what was going on and for his suggestion as to how to solve the problem.)
First of all, what I say here applies only to IDL vector or software fonts. These are the so-called Hershey fonts that IDL uses on plots by default or when the !P.Font system variable is set to -1. Like many IDL characteristics, the default character size and spacing is set when IDL opens the very first graphics window in the IDL session.
Normally the default character width is set to 6 and the default vertical spacing between character lines is set to 9. (I don't know anyone who knows exactly what units these numbers are in. Perhaps it doesn't matter.) The current character width is available via the !D.X_CH_SIZE system variable. (The current character height is not available, but it is not needed since the Hershey fonts use characters with a fixed aspect ratio. Setting the character width automatically sets the character height.) The default character spacing between lines of text is given by the misnamed !D.Y_CH_SIZE system variable.
For some reason when the first graphics window is opened on an SGI machine, these values are set to 12 and 15, respectively. This appears to be the only machine architecture where this happens! As a result, text on SGI machines is much larger than comparable text on other machines running IDL.
The solution is quite simple (although annoying). Simply set the default character size and spacing yourself with the DEVICE command and the SET_CHARACTER_SIZE keyword. Since this must be done every time you enter an IDL session, it is best done in an IDL startup file. Since a window must be opened first to do this correctly, the startup file might look something like this. (I prefer my IDL sessions on any machine use a character size of 8 and a character spacing of 12, so that is what is set here.)
; IDL startup file.
Window, XSize=10, YSize=10, /Pixmap, /Free
WDelete, !D.Window
Device, Set_Character_Size=[8,12]
This startup file has the added benefit that since I have already opened a graphics window, my !D.N_Colors system variable now reflects the number of colors I really have available in my IDL session!
![]()
Copyright © 1997 David W. Fanning
Last Updated 11 April 1997
