Use py_resource module
[python/dscho.git] / Doc / lib / libfm.tex
blob45d820c0b006c7556d1bd0ad32c6822c9c341c7c
1 \section{Built-in Module \sectcode{fm}}
2 \bimodindex{fm}
4 This module provides access to the IRIS {\em Font Manager} library.
5 It is available only on Silicon Graphics machines.
6 See also: 4Sight User's Guide, Section 1, Chapter 5: Using the IRIS
7 Font Manager.
9 This is not yet a full interface to the IRIS Font Manager.
10 Among the unsupported features are: matrix operations; cache
11 operations; character operations (use string operations instead); some
12 details of font info; individual glyph metrics; and printer matching.
14 It supports the following operations:
16 \renewcommand{\indexsubitem}{(in module fm)}
17 \begin{funcdesc}{init}{}
18 Initialization function.
19 Calls \code{fminit()}.
20 It is normally not necessary to call this function, since it is called
21 automatically the first time the \code{fm} module is imported.
22 \end{funcdesc}
24 \begin{funcdesc}{findfont}{fontname}
25 Return a font handle object.
26 Calls \code{fmfindfont(\var{fontname})}.
27 \end{funcdesc}
29 \begin{funcdesc}{enumerate}{}
30 Returns a list of available font names.
31 This is an interface to \code{fmenumerate()}.
32 \end{funcdesc}
34 \begin{funcdesc}{prstr}{string}
35 Render a string using the current font (see the \code{setfont()} font
36 handle method below).
37 Calls \code{fmprstr(\var{string})}.
38 \end{funcdesc}
40 \begin{funcdesc}{setpath}{string}
41 Sets the font search path.
42 Calls \code{fmsetpath(string)}.
43 (XXX Does not work!?!)
44 \end{funcdesc}
46 \begin{funcdesc}{fontpath}{}
47 Returns the current font search path.
48 \end{funcdesc}
50 Font handle objects support the following operations:
52 \renewcommand{\indexsubitem}{(font handle method)}
53 \begin{funcdesc}{scalefont}{factor}
54 Returns a handle for a scaled version of this font.
55 Calls \code{fmscalefont(\var{fh}, \var{factor})}.
56 \end{funcdesc}
58 \begin{funcdesc}{setfont}{}
59 Makes this font the current font.
60 Note: the effect is undone silently when the font handle object is
61 deleted.
62 Calls \code{fmsetfont(\var{fh})}.
63 \end{funcdesc}
65 \begin{funcdesc}{getfontname}{}
66 Returns this font's name.
67 Calls \code{fmgetfontname(\var{fh})}.
68 \end{funcdesc}
70 \begin{funcdesc}{getcomment}{}
71 Returns the comment string associated with this font.
72 Raises an exception if there is none.
73 Calls \code{fmgetcomment(\var{fh})}.
74 \end{funcdesc}
76 \begin{funcdesc}{getfontinfo}{}
77 Returns a tuple giving some pertinent data about this font.
78 This is an interface to \code{fmgetfontinfo()}.
79 The returned tuple contains the following numbers:
80 {\tt(\var{printermatched}, \var{fixed_width}, \var{xorig}, \var{yorig},
81 \var{xsize}, \var{ysize}, \var{height}, \var{nglyphs})}.
82 \end{funcdesc}
84 \begin{funcdesc}{getstrwidth}{string}
85 Returns the width, in pixels, of the string when drawn in this font.
86 Calls \code{fmgetstrwidth(\var{fh}, \var{string})}.
87 \end{funcdesc}