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