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