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