<<<<<<<<<<<<<<<<

xfont(x) Xlib xfont(x)

NAME

xfont - an X font

DESCRIPTION

The xfont class provides an interface to X Font and XFontStruct structures.

SUPERCLASS

object

INSTANCE VARIABLES

display is the name of the associated xdisplay object.

font_name is a string for the font name.

font_struct is a pointer to the XFontStruct structure.

id is a pointer to the X Font structure.

text is a string of which several of the messages below will return dimensions.

MESSAGES

ascent? returns the ascent of the font, which is the distance in pixels from the baseline to the top of the tallest character. The sum of the acsnet and descent is the amount of vertical space occupied by the font.

descent? returns the descent of the font, which is the distance in pixels from the baseline to the bottom of the lowest character. The sum of the acsnet and descent is the amount of vertical space occupied by the font.

direction? returns the direction of the font. The possible values are FontLeftToRight (0) and FontRightToLeft (1).

display= display_object_name sets the display instance variable.

display? returns the value of the display instance variable on the argument stack.

font_name= font_name sets the font_name instance variable.

font_name? returns the value of the font_name instance variable on the argument stack.

font_loaded? returns 1 if a font has been loaded sucessfully or 0 if the font is not valid.

free_font! frees the font but not the xfont object.

id? returns the value of the id instance variable on the argument stack.

load_query!, load! loads the font and sets the id and font_struct instance variables.

string_ascent? returns the string ascent for the instance variable text. String ascent is the distance in pixels from the origin to the top edge of the rectangle covered by the character string.

string_descent? returns the string descent for the instance variable text. String descent is the distance in pixels from the origin to the bottom edge of the rectangle covered by the character string.

string_height? returns the height, in pixels, of the instnace variable text.

string_lbearing? returns the left bearing for the instance variable text. Left bearing is the distance in pixels from the origin to the left edge of the rectangle covered by the character string.

string_rbearing? returns the right bearing for the instance variable text. Right bearing is the distance in pixels from the origin to the right edge of the rectangle covered by the character string.

string_width? returns the width, in pixels, of the instnace variable text.

EXAMPLE

/* Create a font */ /* In: scripts/xfont.scr */

xfont new: nine_by_fifteen

font_name= "9x15"

load_query!;

/* check if it was actually loaded */ logic new: font_status equal: ([nine_by_fifteen font_loaded?],1.0) true: `! font 9x15 is loaded' false: `! font 9x15 is NOT loaded' ;

SEE ALSO

xdisplay, xgc


Last Updated On: Fri Mar 10 15:38:45 1995

Please send comments and suggestions to

its-documentation@rpi.edu

Keyword Search of RPInfo Consulting Pages and NewsCache