blob: b52fd2656412d7215441d420d7045ace26cff8ed [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{fm}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule{builtin}{fm}
3
4\modulesynopsis{\emph{Font Manager} interface for SGI workstations.}
5
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00006
Fred Drakeaf8a0151998-01-14 14:51:31 +00007This module provides access to the IRIS \emph{Font Manager} library.
Fred Drake85ea68b1998-04-04 06:46:05 +00008\index{Font Manager, IRIS}
9\index{IRIS Font Manager}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000010It is available only on Silicon Graphics machines.
Fred Drakec9808b31998-03-15 02:04:59 +000011See also: \emph{4Sight User's Guide}, Section 1, Chapter 5: ``Using
12the IRIS Font Manager.''
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000013
14This is not yet a full interface to the IRIS Font Manager.
15Among the unsupported features are: matrix operations; cache
16operations; character operations (use string operations instead); some
17details of font info; individual glyph metrics; and printer matching.
18
19It supports the following operations:
20
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000021\begin{funcdesc}{init}{}
22Initialization function.
Fred Drakec9808b31998-03-15 02:04:59 +000023Calls \cfunction{fminit()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000024It is normally not necessary to call this function, since it is called
Fred Drakec9808b31998-03-15 02:04:59 +000025automatically the first time the \module{fm} module is imported.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000026\end{funcdesc}
27
28\begin{funcdesc}{findfont}{fontname}
29Return a font handle object.
30Calls \code{fmfindfont(\var{fontname})}.
31\end{funcdesc}
32
33\begin{funcdesc}{enumerate}{}
34Returns a list of available font names.
Fred Drakec9808b31998-03-15 02:04:59 +000035This is an interface to \cfunction{fmenumerate()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000036\end{funcdesc}
37
38\begin{funcdesc}{prstr}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000039Render a string using the current font (see the \function{setfont()} font
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000040handle method below).
41Calls \code{fmprstr(\var{string})}.
42\end{funcdesc}
43
44\begin{funcdesc}{setpath}{string}
45Sets the font search path.
Fred Drakec9808b31998-03-15 02:04:59 +000046Calls \code{fmsetpath(\var{string})}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000047(XXX Does not work!?!)
48\end{funcdesc}
49
50\begin{funcdesc}{fontpath}{}
51Returns the current font search path.
52\end{funcdesc}
53
54Font handle objects support the following operations:
55
Fred Drake19479911998-02-13 06:58:54 +000056\setindexsubitem{(font handle method)}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000057\begin{funcdesc}{scalefont}{factor}
58Returns a handle for a scaled version of this font.
59Calls \code{fmscalefont(\var{fh}, \var{factor})}.
60\end{funcdesc}
61
62\begin{funcdesc}{setfont}{}
63Makes this font the current font.
64Note: the effect is undone silently when the font handle object is
65deleted.
66Calls \code{fmsetfont(\var{fh})}.
67\end{funcdesc}
68
69\begin{funcdesc}{getfontname}{}
70Returns this font's name.
71Calls \code{fmgetfontname(\var{fh})}.
72\end{funcdesc}
73
74\begin{funcdesc}{getcomment}{}
75Returns the comment string associated with this font.
76Raises an exception if there is none.
77Calls \code{fmgetcomment(\var{fh})}.
78\end{funcdesc}
79
80\begin{funcdesc}{getfontinfo}{}
81Returns a tuple giving some pertinent data about this font.
82This is an interface to \code{fmgetfontinfo()}.
83The returned tuple contains the following numbers:
Fred Drakec9808b31998-03-15 02:04:59 +000084\code{(}\var{printermatched}, \var{fixed_width}, \var{xorig},
85\var{yorig}, \var{xsize}, \var{ysize}, \var{height},
86\var{nglyphs}\code{)}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000087\end{funcdesc}
88
89\begin{funcdesc}{getstrwidth}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000090Returns the width, in pixels, of \var{string} when drawn in this font.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000091Calls \code{fmgetstrwidth(\var{fh}, \var{string})}.
92\end{funcdesc}