blob: e46506b65ef1866dfa32738a744b8f10154fa994 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001
2:mod:`fm` --- *Font Manager* interface
3======================================
4
5.. module:: fm
6 :platform: IRIX
7 :synopsis: Font Manager interface for SGI workstations.
Brett Cannon94f25612008-05-15 04:34:17 +00008 :deprecated:
Georg Brandlc62ef8b2009-01-03 20:55:06 +00009
Brett Cannon94f25612008-05-15 04:34:17 +000010.. deprecated:: 2.6
11 The :mod:`fm` module has been deprecated for removal in Python 3.0.
12
Georg Brandl8ec7f652007-08-15 14:28:01 +000013
14
15.. index::
16 single: Font Manager, IRIS
17 single: IRIS Font Manager
18
19This module provides access to the IRIS *Font Manager* library. It is
20available only on Silicon Graphics machines. See also: *4Sight User's Guide*,
21section 1, chapter 5: "Using the IRIS Font Manager."
22
23This is not yet a full interface to the IRIS Font Manager. Among the unsupported
24features are: matrix operations; cache operations; character operations (use
25string operations instead); some details of font info; individual glyph metrics;
26and printer matching.
27
28It supports the following operations:
29
30
31.. function:: init()
32
33 Initialization function. Calls :cfunc:`fminit`. It is normally not necessary to
34 call this function, since it is called automatically the first time the
35 :mod:`fm` module is imported.
36
37
38.. function:: findfont(fontname)
39
40 Return a font handle object. Calls ``fmfindfont(fontname)``.
41
42
43.. function:: enumerate()
44
45 Returns a list of available font names. This is an interface to
46 :cfunc:`fmenumerate`.
47
48
49.. function:: prstr(string)
50
51 Render a string using the current font (see the :func:`setfont` font handle
52 method below). Calls ``fmprstr(string)``.
53
54
55.. function:: setpath(string)
56
57 Sets the font search path. Calls ``fmsetpath(string)``. (XXX Does not work!?!)
58
59
60.. function:: fontpath()
61
62 Returns the current font search path.
63
64Font handle objects support the following operations:
65
66
67.. method:: font handle.scalefont(factor)
68
69 Returns a handle for a scaled version of this font. Calls ``fmscalefont(fh,
70 factor)``.
71
72
73.. method:: font handle.setfont()
74
75 Makes this font the current font. Note: the effect is undone silently when the
76 font handle object is deleted. Calls ``fmsetfont(fh)``.
77
78
79.. method:: font handle.getfontname()
80
81 Returns this font's name. Calls ``fmgetfontname(fh)``.
82
83
84.. method:: font handle.getcomment()
85
86 Returns the comment string associated with this font. Raises an exception if
87 there is none. Calls ``fmgetcomment(fh)``.
88
89
90.. method:: font handle.getfontinfo()
91
92 Returns a tuple giving some pertinent data about this font. This is an interface
93 to ``fmgetfontinfo()``. The returned tuple contains the following numbers:
Georg Brandlc553f422007-08-19 18:43:50 +000094 ``(printermatched, fixed_width, xorig, yorig, xsize, ysize, height, nglyphs)``.
Georg Brandl8ec7f652007-08-15 14:28:01 +000095
96
97.. method:: font handle.getstrwidth(string)
98
99 Returns the width, in pixels, of *string* when drawn in this font. Calls
100 ``fmgetstrwidth(fh, string)``.
101