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