~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-2.7.11-docs-html/_sources/library/fm.txt

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
:mod:`fm` --- *Font Manager* interface
3
 
======================================
4
 
 
5
 
.. module:: fm
6
 
   :platform: IRIX
7
 
   :synopsis: Font Manager interface for SGI workstations.
8
 
   :deprecated:
9
 
 
10
 
.. deprecated:: 2.6
11
 
   The :mod:`fm` module has been removed in Python 3.
12
 
 
13
 
 
14
 
 
15
 
.. index::
16
 
   single: Font Manager, IRIS
17
 
   single: IRIS Font Manager
18
 
 
19
 
This module provides access to the IRIS *Font Manager* library.   It is
20
 
available only on Silicon Graphics machines. See also: *4Sight User's Guide*,
21
 
section 1, chapter 5: "Using the IRIS Font Manager."
22
 
 
23
 
This is not yet a full interface to the IRIS Font Manager. Among the unsupported
24
 
features are: matrix operations; cache operations; character operations (use
25
 
string operations instead); some details of font info; individual glyph metrics;
26
 
and printer matching.
27
 
 
28
 
It supports the following operations:
29
 
 
30
 
 
31
 
.. function:: init()
32
 
 
33
 
   Initialization function. Calls :c:func:`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
 
   :c:func:`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
 
 
64
 
Font 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:
94
 
   ``(printermatched, fixed_width, xorig, yorig, xsize, ysize, height, nglyphs)``.
95
 
 
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