Next: gl Prev: flp Up: SGI IRIX ONLY Top: Top

9.6. Built-in Module fm

This module provides access to the IRIS Font Manager library. It is available only on Silicon Graphics machines. See also: 4Sight User's Guide, Section 1, Chapter 5: Using the IRIS Font Manager.

This is not yet a full interface to the IRIS Font Manager. Among the unsupported features are: matrix operations; cache operations; character operations (use string operations instead); some details of font info; individual glyph metrics; and printer matching.

It supports the following operations:

init () -- function of module fm
Initialization function. Calls fminit(). It is normally not necessary to call this function, since it is called automatically the first time the fm module is imported.
findfont (fontname) -- function of module fm
Return a font handle object. Calls fmfindfont(fontname).
enumerate () -- function of module fm
Returns a list of available font names. This is an interface to fmenumerate().
prstr (string) -- function of module fm
Render a string using the current font (see the setfont() font handle method below). Calls fmprstr(string).
setpath (string) -- function of module fm
Sets the font search path. Calls fmsetpath(string). (XXX Does not work!?!)
fontpath () -- function of module fm
Returns the current font search path.
Font handle objects support the following operations:

scalefont (factor) -- Method on font handle
Returns a handle for a scaled version of this font. Calls fmscalefont(fh, factor).
setfont () -- Method on font handle
Makes this font the current font. Note: the effect is undone silently when the font handle object is deleted. Calls fmsetfont(fh).
getfontname () -- Method on font handle
Returns this font's name. Calls fmgetfontname(fh).
getcomment () -- Method on font handle
Returns the comment string associated with this font. Raises an exception if there is none. Calls fmgetcomment(fh).
getfontinfo () -- Method on font handle
Returns a tuple giving some pertinent data about this font. This is an interface to fmgetfontinfo(). The returned tuple contains the following numbers: (printermatched, fixed_width, xorig, yorig, xsize, ysize, height, nglyphs).
getstrwidth (string) -- Method on font handle
Returns the width, in pixels, of the string when drawn in this font. Calls fmgetstrwidth(fh, string).