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 | |
Fred Drake | af8a015 | 1998-01-14 14:51:31 +0000 | [diff] [blame] | 5 | This module provides access to the IRIS \emph{Font Manager} library. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 6 | It is available only on Silicon Graphics machines. |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 7 | See also: \emph{4Sight User's Guide}, Section 1, Chapter 5: ``Using |
| 8 | the IRIS Font Manager.'' |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 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 | |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 17 | \begin{funcdesc}{init}{} |
| 18 | Initialization function. |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 19 | Calls \cfunction{fminit()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 20 | It is normally not necessary to call this function, since it is called |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 21 | automatically the first time the \module{fm} module is imported. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 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. |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 31 | This is an interface to \cfunction{fmenumerate()}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 32 | \end{funcdesc} |
| 33 | |
| 34 | \begin{funcdesc}{prstr}{string} |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 35 | Render a string using the current font (see the \function{setfont()} font |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 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. |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 42 | Calls \code{fmsetpath(\var{string})}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 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 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 52 | \setindexsubitem{(font handle method)} |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 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: |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 80 | \code{(}\var{printermatched}, \var{fixed_width}, \var{xorig}, |
| 81 | \var{yorig}, \var{xsize}, \var{ysize}, \var{height}, |
| 82 | \var{nglyphs}\code{)}. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 83 | \end{funcdesc} |
| 84 | |
| 85 | \begin{funcdesc}{getstrwidth}{string} |
Fred Drake | c9808b3 | 1998-03-15 02:04:59 +0000 | [diff] [blame] | 86 | Returns the width, in pixels, of \var{string} when drawn in this font. |
Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame] | 87 | Calls \code{fmgetstrwidth(\var{fh}, \var{string})}. |
| 88 | \end{funcdesc} |