libfm.tex 2.82 KB
Newer Older
Fred Drake's avatar
Fred Drake committed
1
\section{\module{fm} ---
Fred Drake's avatar
Fred Drake committed
2
         \emph{Font Manager} interface}
3

Fred Drake's avatar
Fred Drake committed
4
\declaremodule{builtin}{fm}
5
  \platform{IRIX}
6 7
\modulesynopsis{\emph{Font Manager} interface for SGI workstations.}

8

9
This module provides access to the IRIS \emph{Font Manager} library.
Fred Drake's avatar
Fred Drake committed
10 11
\index{Font Manager, IRIS}
\index{IRIS Font Manager}
12
It is available only on Silicon Graphics machines.
13
See also: \emph{4Sight User's Guide}, section 1, chapter 5: ``Using
Fred Drake's avatar
Fred Drake committed
14
the IRIS Font Manager.''
15 16 17 18 19 20 21 22 23 24

This is not yet a full interface to the IRIS Font Manager.
Among the unsupported features are: matrix operations; cache
operations; character operations (use string operations instead); some
details of font info; individual glyph metrics; and printer matching.

It supports the following operations:

\begin{funcdesc}{init}{}
Initialization function.
Fred Drake's avatar
Fred Drake committed
25
Calls \cfunction{fminit()}.
26
It is normally not necessary to call this function, since it is called
Fred Drake's avatar
Fred Drake committed
27
automatically the first time the \module{fm} module is imported.
28 29 30 31 32 33 34 35 36
\end{funcdesc}

\begin{funcdesc}{findfont}{fontname}
Return a font handle object.
Calls \code{fmfindfont(\var{fontname})}.
\end{funcdesc}

\begin{funcdesc}{enumerate}{}
Returns a list of available font names.
Fred Drake's avatar
Fred Drake committed
37
This is an interface to \cfunction{fmenumerate()}.
38 39 40
\end{funcdesc}

\begin{funcdesc}{prstr}{string}
Fred Drake's avatar
Fred Drake committed
41
Render a string using the current font (see the \function{setfont()} font
42 43 44 45 46 47
handle method below).
Calls \code{fmprstr(\var{string})}.
\end{funcdesc}

\begin{funcdesc}{setpath}{string}
Sets the font search path.
Fred Drake's avatar
Fred Drake committed
48
Calls \code{fmsetpath(\var{string})}.
49 50 51 52 53 54 55 56 57
(XXX Does not work!?!)
\end{funcdesc}

\begin{funcdesc}{fontpath}{}
Returns the current font search path.
\end{funcdesc}

Font handle objects support the following operations:

58
\setindexsubitem{(font handle method)}
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
\begin{funcdesc}{scalefont}{factor}
Returns a handle for a scaled version of this font.
Calls \code{fmscalefont(\var{fh}, \var{factor})}.
\end{funcdesc}

\begin{funcdesc}{setfont}{}
Makes this font the current font.
Note: the effect is undone silently when the font handle object is
deleted.
Calls \code{fmsetfont(\var{fh})}.
\end{funcdesc}

\begin{funcdesc}{getfontname}{}
Returns this font's name.
Calls \code{fmgetfontname(\var{fh})}.
\end{funcdesc}

\begin{funcdesc}{getcomment}{}
Returns the comment string associated with this font.
Raises an exception if there is none.
Calls \code{fmgetcomment(\var{fh})}.
\end{funcdesc}

\begin{funcdesc}{getfontinfo}{}
Returns a tuple giving some pertinent data about this font.
This is an interface to \code{fmgetfontinfo()}.
The returned tuple contains the following numbers:
Fred Drake's avatar
Fred Drake committed
86 87 88
\code{(}\var{printermatched}, \var{fixed_width}, \var{xorig},
\var{yorig}, \var{xsize}, \var{ysize}, \var{height},
\var{nglyphs}\code{)}.
89 90 91
\end{funcdesc}

\begin{funcdesc}{getstrwidth}{string}
Fred Drake's avatar
Fred Drake committed
92
Returns the width, in pixels, of \var{string} when drawn in this font.
93 94
Calls \code{fmgetstrwidth(\var{fh}, \var{string})}.
\end{funcdesc}