blob: 0a0c237dec3b2d4c5196c6a1f053a15d4f0f6006 [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
Georg Brandl781aef22007-04-10 21:39:38 +000058\begin{methoddesc}[font handle]{scalefont}{factor}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000059Returns a handle for a scaled version of this font.
60Calls \code{fmscalefont(\var{fh}, \var{factor})}.
Georg Brandl781aef22007-04-10 21:39:38 +000061\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000062
Georg Brandl781aef22007-04-10 21:39:38 +000063\begin{methoddesc}[font handle]{setfont}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000064Makes this font the current font.
65Note: the effect is undone silently when the font handle object is
66deleted.
67Calls \code{fmsetfont(\var{fh})}.
Georg Brandl781aef22007-04-10 21:39:38 +000068\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000069
Georg Brandl781aef22007-04-10 21:39:38 +000070\begin{methoddesc}[font handle]{getfontname}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000071Returns this font's name.
72Calls \code{fmgetfontname(\var{fh})}.
Georg Brandl781aef22007-04-10 21:39:38 +000073\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000074
Georg Brandl781aef22007-04-10 21:39:38 +000075\begin{methoddesc}[font handle]{getcomment}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000076Returns the comment string associated with this font.
77Raises an exception if there is none.
78Calls \code{fmgetcomment(\var{fh})}.
Georg Brandl781aef22007-04-10 21:39:38 +000079\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000080
Georg Brandl781aef22007-04-10 21:39:38 +000081\begin{methoddesc}[font handle]{getfontinfo}{}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000082Returns 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{)}.
Georg Brandl781aef22007-04-10 21:39:38 +000088\end{methoddesc}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000089
Georg Brandl781aef22007-04-10 21:39:38 +000090\begin{methoddesc}[font handle]{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})}.
Georg Brandl781aef22007-04-10 21:39:38 +000093\end{methoddesc}