[comp.windows.x] Proportional vs. Fixed Fonts

mikep@progress.COM (Mike Pacholec) (12/15/90)

Is there a "standard" method for determining if a font is fixed (all 
characters the same width) or proportionally (each character has a
unique width) spaced?

I've tried checking to see if the min_bounds.width equaled the 
max_bounds.width (in the XFontStruct).  This works great under Motif, 
but under OpenWindows the min_bounds.width is zero in most cases (even
fixed).  This may be because many OpenWindows fonts cover all 255
chars where the X fonts covered 32 to 255 only.  The first 32 under 
OpenWindows would be of width 0 (undefined)???

Another method is checking to see if the XTextWidth() of "M" is the
same as "i".  But this is fairly kludgy.

Is there a better method that I can use?

--
-------------------------------------------------------------------------------
Mike Pacholec                                    UUCP: mit-eddie!progress!mikep
Progress Software Corp.                      Internet: mikep@progress.com
Bedford, MA 

mouse@LARRY.MCRCIM.MCGILL.EDU (12/17/90)

> Is there a "standard" method for determining if a font is fixed (all
> characters the same width) or proportionally (each character has a
> unique width) spaced?

If it's really important, then look at the character metrics.  If you
just want a reasonable guess, you could look at the SPACING property
(see the XLFD for details).

> I've tried checking to see if the min_bounds.width equaled the
> max_bounds.width (in the XFontStruct).  This works great under Motif,
> but under OpenWindows the min_bounds.width is zero in most cases
> (even fixed).

Then, sorry, the font is not truly fixed-width; it contains at least
one zero-width character.  Of course, the server may be buggy and
returning a zero when it shouldn't - try examining the per_char
elements and see.  (If there are no per_char elements, and min_bounds
is not equal to max_bounds, something is definitely buggy.)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (12/18/90)

Does the concept of a "fixed widget font" exist in X?
Is not a "fixed width font" merely a font where the
width of each character happens to be the same?

IF this is true, then the only way to check is to
bee-bop down the character metrics for each character
and check them for being of the same width.
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776