Path: utzoo!attcan!uunet!convex!killer!ames!ncar!boulder!stan!garya From: garya@stan.com (Gary Aitken) Newsgroups: comp.windows.x Subject: XFontStruct numbers useless? Keywords: XFontStruct Message-ID: <281@stan.com> Date: 17 Nov 88 22:47:40 GMT Organization: Solbourne Computer Inc., Longmont, Co. Lines: 48 I would like a good explanation of what the font information in an XFontStruct is supposed to mean. In particular, how does one determine the total space occupied by a font, in order to size a window to enclose it? For example, the courB12 font has characters which extend outside of the width. How does one determine if a font has it's own imbedded interline spacing, as the 9x15 font appears to? For example, the server reports the following font information: courB12 (-Adobe-Courier-Bold-R-Normal--12-120-75-75-M-70-ISO8859-1) ascent descent lbearing rbearing width 10 3 min bounds: -1 -7 0 1 7 max bounds: 11 3 3 8 7 9x15 ascent descent lbearing rbearing width 12 3 min bounds: 0 -7 0 0 9 max bounds: 10 3 5 9 9 For courB12, the font structure says ascent is 10 and descent is 3, yet there are numerous characters with an ascent of 11. If one sums the general font ascent and descent to obtain the total number of vertical pixels where foreground pixels are drawn, one gets the correct answer for 9x15 but an incorrect answer for courB12. If one uses the max character ascent + descent, one gets the correct answer for courB12 but the wrong one for 9x15. Does one have to take the max of the max's?? PPuuuuuuuchchchch!!!! What is the purpose of the general ascent and descent for the font? Is there a reliable way to determine if interline whitespace is already included in the font, and what it is? In the above examples, for 9x15 one can take the font ascent+descent and subtract the max bounds ascent+descent, to get two pixels of whitespace, which is what the font really has. But this totally falls apart for courB12. For fixed width fonts, it should be possible to size a window to contain a specified number of characters. None of the numbers give a reliable hint as to how many pixels must be added at the beginning of a string to accomodate characters which stick out to the left of their bounding box, or at the end for those which stick out to the right. Again, the courB12 font has numerous characters which stick out 1 pixel to the right. Gary Aitken ncar!boulder!stan!garya