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