📄 getfont.3
字号:
'\"'\" Copyright (c) 1990-1992 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) GetFont.3 1.11 96/07/31 14:07:40'\" .so man.macros.TH Tk_GetFont 3 "" Tk "Tk Library Procedures".BS.SH NAMETk_GetFont, Tk_NameOfFont, Tk_FreeFont \- maintain database of fonts.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spTk_Font \fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR.spchar *\fBTk_NameOfFont(\fItkfont\fB)\fR.spvoid\fBTk_FreeFont(\fItkfont\fB)\fR.SH ARGUMENTS.AS "const char" *tkfont.AP "Tcl_Interp" *interp inInterpreter to use for error reporting..AP Tk_Window tkwin inToken for window on the display in which font will be used..AP "const char" *string inName or description of desired font. See documentation for the \fBfont\fR command for details on acceptable formats..AP Tk_Font tkfont inOpaque font token..BE.SH DESCRIPTION.PP\fBTk_GetFont\fR finds the font indicated by \fIstring\fR and returns atoken that represents the font. The return value can be used in subsequentcalls to procedures such as \fBTk_FontMetrics\fR, \fBTk_MeasureChars\fR, and\fBTk_FreeFont\fR. The token returned by \fBTk_GetFont\fR will remainvalid until \fBTk_FreeFont\fR is called to release it. \fIString\fR canbe either a symbolic name or a font description; see the documentation forthe \fBfont\fR command for a description of the valid formats. If\fBTk_GetFont\fR is unsuccessful (because, for example, \fIstring\fR wasnot a valid font specification) then it returns \fBNULL\fR and stores anerror message in \fIinterp->result\fR..PP\fBTk_GetFont\fR maintains a database of all fonts it has allocated. Ifthe same \fIstring\fR is requested multiple times (e.g. by differentwindows or for different purposes), then additional calls for the same\fIstring\fR will be handled without involving the platform-specificgraphics server..PPThe procedure \fBTk_NameOfFont\fR is roughly the inverse of\fBTk_GetFont\fR. Given a \fItkfont\fR that was created by\fBTk_GetFont\fR, the return value is the \fIstring\fR argument that waspassed to \fBTk_GetFont\fR to create the font. The string returned by\fBTk_NameOfFont\fR is only guaranteed to persist until the \fItkfont\fRis deleted. The caller must not modify this string..PPWhen a font returned by \fBTk_GetFont\fR is no longer needed,\fBTk_FreeFont\fR should be called to release it. There should beexactly one call to \fBTk_FreeFont\fR for each call to \fBTk_GetFont\fR.When a font is no longer in use anywhere (i.e. it has been freed as manytimes as it has been gotten) \fBTk_FreeFont\fR will release anyplatform-specific storage and delete it from the database. .SH KEYWORDSfont
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -