next up previous
Next: x_drawable Up: simxlib Previous: xfont

xfontmetrics


     NAME
	  xfontmetrics - part of Simula	to Xlib	interface

     DESCRIPTION
	     class XFontMetrics(theXFont);
	  This class is	attached to a certain XFont  and  can  answere
	  some	(complex)  size	properties related to that XFont and a
	  text string to be displayed in that  XFont.  The  object  is
	  used	by  first calling the 'Measure'	operation and then the
	  other	operations are prepared	to  return  results  regarding
	  that	string	until the next call of 'Measure'.  Notice that
	  the simple (but frequent) size question, 'Width' of a	string
	  can  be  answered  by	 the  XFont  object  itself  (which is
	  probably  more  efficient).	also  notice  that  the	 three
	  operation  related  to  the  Font  itself  rather  than  the
	  particular  text  string  (FontAscent/FontDescent/Direction)
	  are also available in	XFont.

	  SUPERS: none
	  KIND:	Instantiable;
	  INIT:	Call Measure first, before consulting the results
	  SEQUENCE: (Measure (<Results>)* )*
	  :   Results= CharAscent / CharDescent	/ CharAttributes /
	  CharWidth /
	  :   CharLBearing / CharRBearing / FontAscent / FontDescent /
	  Direction

     OPERATIONS
     Measure
	     procedure Measure(string);
	     text string;
	  Measures the 8-bit character string

     CharAscent
	     integer procedure CharAscent;
	  Returns the maximum ascent metrics of	all characters in  the
	  string.

     CharDescent
	     integer procedure CharDescent;
	  Returns the maximum descent metrics of all characters	in the
	  string.

     CharAttributes
	     integer procedure CharAttributes;
	  (whatever that is)

     CharWidth
	     integer procedure CharWidth;
	  Returns the width on pixels of the measured string.  This is
	  the  sum of the character-width metrics of all characters in
	  the string.
     CharLBearing
	     integer procedure CharLBearing;
	  Returns the lbearing of the character	in the string with the
	  smallest lbearing plus the width of all characters up	to but
	  not including	that character.

     CharRBearing
	     integer procedure CharRBearing;
	  Returns the rbearing of the character	in the string with the
	  largest  lbearing plus the width of all characters up	to but
	  not including	that character.

     Direction
	     integer procedure Direction;
	  Returns   the	  direction,   either	'FontRightToLeft'   or
	  'FontLeftToRight.'   of  the	Font.  These two constants are
	  defined in XFont

     FontAscent
	     integer procedure FontAscent;
	  Returns the overall maximum ascent for the font.

     FontDescent
	     integer procedure FontDescent;
	  Returns the overall maximum descent for the font.