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