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