| Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 1 | \section{Built-in Module \sectcode{fm}} | 
 | 2 | \bimodindex{fm} | 
 | 3 |  | 
 | 4 | This module provides access to the IRIS {\em Font Manager} library. | 
 | 5 | It is available only on Silicon Graphics machines. | 
 | 6 | See also: 4Sight User's Guide, Section 1, Chapter 5: Using the IRIS | 
 | 7 | Font Manager. | 
 | 8 |  | 
 | 9 | This is not yet a full interface to the IRIS Font Manager. | 
 | 10 | Among the unsupported features are: matrix operations; cache | 
 | 11 | operations; character operations (use string operations instead); some | 
 | 12 | details of font info; individual glyph metrics; and printer matching. | 
 | 13 |  | 
 | 14 | It supports the following operations: | 
 | 15 |  | 
 | 16 | \renewcommand{\indexsubitem}{(in module fm)} | 
 | 17 | \begin{funcdesc}{init}{} | 
 | 18 | Initialization function. | 
 | 19 | Calls \code{fminit()}. | 
 | 20 | It is normally not necessary to call this function, since it is called | 
 | 21 | automatically the first time the \code{fm} module is imported. | 
 | 22 | \end{funcdesc} | 
 | 23 |  | 
 | 24 | \begin{funcdesc}{findfont}{fontname} | 
 | 25 | Return a font handle object. | 
 | 26 | Calls \code{fmfindfont(\var{fontname})}. | 
 | 27 | \end{funcdesc} | 
 | 28 |  | 
 | 29 | \begin{funcdesc}{enumerate}{} | 
 | 30 | Returns a list of available font names. | 
 | 31 | This is an interface to \code{fmenumerate()}. | 
 | 32 | \end{funcdesc} | 
 | 33 |  | 
 | 34 | \begin{funcdesc}{prstr}{string} | 
 | 35 | Render a string using the current font (see the \code{setfont()} font | 
 | 36 | handle method below). | 
 | 37 | Calls \code{fmprstr(\var{string})}. | 
 | 38 | \end{funcdesc} | 
 | 39 |  | 
 | 40 | \begin{funcdesc}{setpath}{string} | 
 | 41 | Sets the font search path. | 
 | 42 | Calls \code{fmsetpath(string)}. | 
 | 43 | (XXX Does not work!?!) | 
 | 44 | \end{funcdesc} | 
 | 45 |  | 
 | 46 | \begin{funcdesc}{fontpath}{} | 
 | 47 | Returns the current font search path. | 
 | 48 | \end{funcdesc} | 
 | 49 |  | 
 | 50 | Font handle objects support the following operations: | 
 | 51 |  | 
 | 52 | \renewcommand{\indexsubitem}{(font handle method)} | 
 | 53 | \begin{funcdesc}{scalefont}{factor} | 
 | 54 | Returns a handle for a scaled version of this font. | 
 | 55 | Calls \code{fmscalefont(\var{fh}, \var{factor})}. | 
 | 56 | \end{funcdesc} | 
 | 57 |  | 
 | 58 | \begin{funcdesc}{setfont}{} | 
 | 59 | Makes this font the current font. | 
 | 60 | Note: the effect is undone silently when the font handle object is | 
 | 61 | deleted. | 
 | 62 | Calls \code{fmsetfont(\var{fh})}. | 
 | 63 | \end{funcdesc} | 
 | 64 |  | 
 | 65 | \begin{funcdesc}{getfontname}{} | 
 | 66 | Returns this font's name. | 
 | 67 | Calls \code{fmgetfontname(\var{fh})}. | 
 | 68 | \end{funcdesc} | 
 | 69 |  | 
 | 70 | \begin{funcdesc}{getcomment}{} | 
 | 71 | Returns the comment string associated with this font. | 
 | 72 | Raises an exception if there is none. | 
 | 73 | Calls \code{fmgetcomment(\var{fh})}. | 
 | 74 | \end{funcdesc} | 
 | 75 |  | 
 | 76 | \begin{funcdesc}{getfontinfo}{} | 
 | 77 | Returns a tuple giving some pertinent data about this font. | 
 | 78 | This is an interface to \code{fmgetfontinfo()}. | 
 | 79 | The returned tuple contains the following numbers: | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 80 | {\tt(\var{printermatched}, \var{fixed_width}, \var{xorig}, \var{yorig}, | 
 | 81 | \var{xsize}, \var{ysize}, \var{height}, \var{nglyphs})}. | 
| Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 82 | \end{funcdesc} | 
 | 83 |  | 
 | 84 | \begin{funcdesc}{getstrwidth}{string} | 
 | 85 | Returns the width, in pixels, of the string when drawn in this font. | 
 | 86 | Calls \code{fmgetstrwidth(\var{fh}, \var{string})}. | 
 | 87 | \end{funcdesc} |