/Doc/library/fm.rst

http://unladen-swallow.googlecode.com/ · ReStructuredText · 101 lines · 54 code · 47 blank · 0 comment · 0 complexity · 3003dc1e2e43d2949c4bf4ad3580b8c1 MD5 · raw file

  1. :mod:`fm` --- *Font Manager* interface
  2. ======================================
  3. .. module:: fm
  4. :platform: IRIX
  5. :synopsis: Font Manager interface for SGI workstations.
  6. :deprecated:
  7. .. deprecated:: 2.6
  8. The :mod:`fm` module has been deprecated for removal in Python 3.0.
  9. .. index::
  10. single: Font Manager, IRIS
  11. single: IRIS Font Manager
  12. This module provides access to the IRIS *Font Manager* library. It is
  13. available only on Silicon Graphics machines. See also: *4Sight User's Guide*,
  14. section 1, chapter 5: "Using the IRIS Font Manager."
  15. This is not yet a full interface to the IRIS Font Manager. Among the unsupported
  16. features are: matrix operations; cache operations; character operations (use
  17. string operations instead); some details of font info; individual glyph metrics;
  18. and printer matching.
  19. It supports the following operations:
  20. .. function:: init()
  21. Initialization function. Calls :cfunc:`fminit`. It is normally not necessary to
  22. call this function, since it is called automatically the first time the
  23. :mod:`fm` module is imported.
  24. .. function:: findfont(fontname)
  25. Return a font handle object. Calls ``fmfindfont(fontname)``.
  26. .. function:: enumerate()
  27. Returns a list of available font names. This is an interface to
  28. :cfunc:`fmenumerate`.
  29. .. function:: prstr(string)
  30. Render a string using the current font (see the :func:`setfont` font handle
  31. method below). Calls ``fmprstr(string)``.
  32. .. function:: setpath(string)
  33. Sets the font search path. Calls ``fmsetpath(string)``. (XXX Does not work!?!)
  34. .. function:: fontpath()
  35. Returns the current font search path.
  36. Font handle objects support the following operations:
  37. .. method:: font handle.scalefont(factor)
  38. Returns a handle for a scaled version of this font. Calls ``fmscalefont(fh,
  39. factor)``.
  40. .. method:: font handle.setfont()
  41. Makes this font the current font. Note: the effect is undone silently when the
  42. font handle object is deleted. Calls ``fmsetfont(fh)``.
  43. .. method:: font handle.getfontname()
  44. Returns this font's name. Calls ``fmgetfontname(fh)``.
  45. .. method:: font handle.getcomment()
  46. Returns the comment string associated with this font. Raises an exception if
  47. there is none. Calls ``fmgetcomment(fh)``.
  48. .. method:: font handle.getfontinfo()
  49. Returns a tuple giving some pertinent data about this font. This is an interface
  50. to ``fmgetfontinfo()``. The returned tuple contains the following numbers:
  51. ``(printermatched, fixed_width, xorig, yorig, xsize, ysize, height, nglyphs)``.
  52. .. method:: font handle.getstrwidth(string)
  53. Returns the width, in pixels, of *string* when drawn in this font. Calls
  54. ``fmgetstrwidth(fh, string)``.