blob: 0b429e0638cf430e1851569bbb02a6f38d645bb5 [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 Drakef6863c11999-03-02 16:37:17 +00005 \platform{IRIX}
Fred Drakeb91e9341998-07-23 17:59:49 +00006\modulesynopsis{\emph{Font Manager} interface for SGI workstations.}
7
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00008
Fred Drakeaf8a0151998-01-14 14:51:31 +00009This module provides access to the IRIS \emph{Font Manager} library.
Fred Drake85ea68b1998-04-04 06:46:05 +000010\index{Font Manager, IRIS}
11\index{IRIS Font Manager}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000012It is available only on Silicon Graphics machines.
Fred Drake5f342ac1999-04-29 02:47:40 +000013See also: \emph{4Sight User's Guide}, section 1, chapter 5: ``Using
Fred Drakec9808b31998-03-15 02:04:59 +000014the IRIS Font Manager.''
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000015
16This is not yet a full interface to the IRIS Font Manager.
17Among the unsupported features are: matrix operations; cache
18operations; character operations (use string operations instead); some
19details of font info; individual glyph metrics; and printer matching.
20
21It supports the following operations:
22
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000023\begin{funcdesc}{init}{}
24Initialization function.
Fred Drakec9808b31998-03-15 02:04:59 +000025Calls \cfunction{fminit()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000026It is normally not necessary to call this function, since it is called
Fred Drakec9808b31998-03-15 02:04:59 +000027automatically the first time the \module{fm} module is imported.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000028\end{funcdesc}
29
30\begin{funcdesc}{findfont}{fontname}
31Return a font handle object.
32Calls \code{fmfindfont(\var{fontname})}.
33\end{funcdesc}
34
35\begin{funcdesc}{enumerate}{}
36Returns a list of available font names.
Fred Drakec9808b31998-03-15 02:04:59 +000037This is an interface to \cfunction{fmenumerate()}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000038\end{funcdesc}
39
40\begin{funcdesc}{prstr}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000041Render a string using the current font (see the \function{setfont()} font
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000042handle method below).
43Calls \code{fmprstr(\var{string})}.
44\end{funcdesc}
45
46\begin{funcdesc}{setpath}{string}
47Sets the font search path.
Fred Drakec9808b31998-03-15 02:04:59 +000048Calls \code{fmsetpath(\var{string})}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000049(XXX Does not work!?!)
50\end{funcdesc}
51
52\begin{funcdesc}{fontpath}{}
53Returns the current font search path.
54\end{funcdesc}
55
56Font handle objects support the following operations:
57
Fred Drake19479911998-02-13 06:58:54 +000058\setindexsubitem{(font handle method)}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000059\begin{funcdesc}{scalefont}{factor}
60Returns a handle for a scaled version of this font.
61Calls \code{fmscalefont(\var{fh}, \var{factor})}.
62\end{funcdesc}
63
64\begin{funcdesc}{setfont}{}
65Makes this font the current font.
66Note: the effect is undone silently when the font handle object is
67deleted.
68Calls \code{fmsetfont(\var{fh})}.
69\end{funcdesc}
70
71\begin{funcdesc}{getfontname}{}
72Returns this font's name.
73Calls \code{fmgetfontname(\var{fh})}.
74\end{funcdesc}
75
76\begin{funcdesc}{getcomment}{}
77Returns the comment string associated with this font.
78Raises an exception if there is none.
79Calls \code{fmgetcomment(\var{fh})}.
80\end{funcdesc}
81
82\begin{funcdesc}{getfontinfo}{}
83Returns a tuple giving some pertinent data about this font.
84This is an interface to \code{fmgetfontinfo()}.
85The returned tuple contains the following numbers:
Fred Drakec9808b31998-03-15 02:04:59 +000086\code{(}\var{printermatched}, \var{fixed_width}, \var{xorig},
87\var{yorig}, \var{xsize}, \var{ysize}, \var{height},
88\var{nglyphs}\code{)}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000089\end{funcdesc}
90
91\begin{funcdesc}{getstrwidth}{string}
Fred Drakec9808b31998-03-15 02:04:59 +000092Returns the width, in pixels, of \var{string} when drawn in this font.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000093Calls \code{fmgetstrwidth(\var{fh}, \var{string})}.
94\end{funcdesc}