blob: abcbaa46210625445d21100b1a5684c1306c1e83 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Built-in Module \module{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
Fred Drakeaf8a0151998-01-14 14:51:31 +00005This module provides access to the IRIS \emph{Font Manager} library.
Fred Drake85ea68b1998-04-04 06:46:05 +00006\index{Font Manager, IRIS}
7\index{IRIS Font Manager}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00008It is available only on Silicon Graphics machines.
Fred Drakec9808b31998-03-15 02:04:59 +00009See also: \emph{4Sight User's Guide}, Section 1, Chapter 5: ``Using
10the IRIS Font Manager.''
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000011
12This is not yet a full interface to the IRIS Font Manager.
13Among the unsupported features are: matrix operations; cache
14operations; character operations (use string operations instead); some
15details of font info; individual glyph metrics; and printer matching.
16
17It supports the following operations:
18
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000019\begin{funcdesc}{init}{}
20Initialization function.
Fred Drakec9808b31998-03-15 02:04:59 +000021Calls \cfunction{fminit()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000022It is normally not necessary to call this function, since it is called
Fred Drakec9808b31998-03-15 02:04:59 +000023automatically the first time the \module{fm} module is imported.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000024\end{funcdesc}
25
26\begin{funcdesc}{findfont}{fontname}
27Return a font handle object.
28Calls \code{fmfindfont(\var{fontname})}.
29\end{funcdesc}
30
31\begin{funcdesc}{enumerate}{}
32Returns a list of available font names.
Fred Drakec9808b31998-03-15 02:04:59 +000033This is an interface to \cfunction{fmenumerate()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000034\end{funcdesc}
35
36\begin{funcdesc}{prstr}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000037Render a string using the current font (see the \function{setfont()} font
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000038handle method below).
39Calls \code{fmprstr(\var{string})}.
40\end{funcdesc}
41
42\begin{funcdesc}{setpath}{string}
43Sets the font search path.
Fred Drakec9808b31998-03-15 02:04:59 +000044Calls \code{fmsetpath(\var{string})}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000045(XXX Does not work!?!)
46\end{funcdesc}
47
48\begin{funcdesc}{fontpath}{}
49Returns the current font search path.
50\end{funcdesc}
51
52Font handle objects support the following operations:
53
Fred Drake19479911998-02-13 06:58:54 +000054\setindexsubitem{(font handle method)}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000055\begin{funcdesc}{scalefont}{factor}
56Returns a handle for a scaled version of this font.
57Calls \code{fmscalefont(\var{fh}, \var{factor})}.
58\end{funcdesc}
59
60\begin{funcdesc}{setfont}{}
61Makes this font the current font.
62Note: the effect is undone silently when the font handle object is
63deleted.
64Calls \code{fmsetfont(\var{fh})}.
65\end{funcdesc}
66
67\begin{funcdesc}{getfontname}{}
68Returns this font's name.
69Calls \code{fmgetfontname(\var{fh})}.
70\end{funcdesc}
71
72\begin{funcdesc}{getcomment}{}
73Returns the comment string associated with this font.
74Raises an exception if there is none.
75Calls \code{fmgetcomment(\var{fh})}.
76\end{funcdesc}
77
78\begin{funcdesc}{getfontinfo}{}
79Returns a tuple giving some pertinent data about this font.
80This is an interface to \code{fmgetfontinfo()}.
81The returned tuple contains the following numbers:
Fred Drakec9808b31998-03-15 02:04:59 +000082\code{(}\var{printermatched}, \var{fixed_width}, \var{xorig},
83\var{yorig}, \var{xsize}, \var{ysize}, \var{height},
84\var{nglyphs}\code{)}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000085\end{funcdesc}
86
87\begin{funcdesc}{getstrwidth}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000088Returns the width, in pixels, of \var{string} when drawn in this font.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000089Calls \code{fmgetstrwidth(\var{fh}, \var{string})}.
90\end{funcdesc}