39.7. fm — Font Manager interface - Python 2.7.18 documentation 编辑

Deprecated since version 2.6: The fm module has been removed in Python 3.

This module provides access to the IRIS Font Manager library. It is available only on Silicon Graphics machines. See also: 4Sight User’s Guide, section 1, chapter 5: “Using the IRIS Font Manager.”

This is not yet a full interface to the IRIS Font Manager. Among the unsupported features are: matrix operations; cache operations; character operations (use string operations instead); some details of font info; individual glyph metrics; and printer matching.

It supports the following operations:

fm.init()

Initialization function. Calls fminit(). It is normally not necessary to call this function, since it is called automatically the first time the fm module is imported.

fm.findfont(fontname)

Return a font handle object. Calls fmfindfont(fontname).

fm.enumerate()

Returns a list of available font names. This is an interface to fmenumerate().

fm.prstr(string)

Render a string using the current font (see the setfont() font handle method below). Calls fmprstr(string).

fm.setpath(string)

Sets the font search path. Calls fmsetpath(string). (XXX Does not work!?!)

fm.fontpath()

Returns the current font search path.

Font handle objects support the following operations:

font handle.scalefont(factor)

Returns a handle for a scaled version of this font. Calls fmscalefont(fh, factor).

font handle.setfont()

Makes this font the current font. Note: the effect is undone silently when the font handle object is deleted. Calls fmsetfont(fh).

font handle.getfontname()

Returns this font’s name. Calls fmgetfontname(fh).

font handle.getcomment()

Returns the comment string associated with this font. Raises an exception if there is none. Calls fmgetcomment(fh).

font handle.getfontinfo()

Returns a tuple giving some pertinent data about this font. This is an interface to fmgetfontinfo(). The returned tuple contains the following numbers: (printermatched, fixed_width, xorig, yorig, xsize, ysize, height, nglyphs).

font handle.getstrwidth(string)

Returns the width, in pixels, of string when drawn in this font. Calls fmgetstrwidth(fh, string).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:61 次

字数:3043

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文