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