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