diff options
Diffstat (limited to 'doc/font.n')
-rw-r--r-- | doc/font.n | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: font.n,v 1.3 2000/07/25 21:14:35 jenglish Exp $ +'\" RCS: @(#) $Id: font.n,v 1.3.8.1 2004/10/28 10:19:29 dkf Exp $ '\" .so man.macros .TH font n 8.0 Tk "Tk Built-In Commands" @@ -24,7 +24,7 @@ first argument. The following forms are currently supported: .TP \fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? . -Returns information about the the actual attributes that are obtained when +Returns information about the actual attributes that are obtained when \fIfont\fR is used on \fIwindow\fR's display; the actual attributes obtained may differ from the attributes requested due to platform-dependant limitations, such as the availability of font families and pointsizes. @@ -76,7 +76,7 @@ Measures the amount of space the string \fItext\fR would use in the given \fIfont\fR when displayed in \fIwindow\fR. \fIfont\fR is a font description; see FONT DESCRIPTIONS below. If the \fIwindow\fR argument is omitted, it defaults to the main window. The return value is the total width in pixels -of \fItext\fR, not including the extra pixels used by highly exagerrated +of \fItext\fR, not including the extra pixels used by highly exaggerated characters such as cursive ``f''. If the string contains newlines or tabs, those characters are not expanded or treated specially when measuring the string. @@ -192,7 +192,7 @@ above the baseline line plus the descent below the baseline. \fB\-fixed \0\fR . Returns a boolean flag that is ``\fB1\fR'' if this is a fixed-width font, -where each normal character is the the same width as all the other +where each normal character is the same width as all the other characters, or is ``\fB0\fR'' if this is a proportionally-spaced font, where individual characters have different widths. The widths of control characters, tab characters, and other non-printing characters are not @@ -258,7 +258,6 @@ font should be underlined. The default value for underline is \fBfalse\fR. The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is \fBfalse\fR. - .SH "PLATFORM-SPECIFIC ISSUES" .LP The following named system fonts are supported: @@ -280,8 +279,27 @@ Macintosh: \fBsystem application\fR .DE .RE +.SH EXAMPLE +Fill a text widget with lots of font demonstrators, one for every font +family installed on your system: +.CS +pack [text .t -wrap none] -fill both -expand 1 +set count 0 +set tabwidth 0 +foreach family [lsort -dictionary [\fBfont families\fR]] { + .t tag configure f[incr count] -font [list $family 10] + .t insert end ${family}:\\t {} \\ + "This is a simple sampler\\n" f$count + set w [\fBfont measure\fR [.t cget -font] ${family}:] + if {$w+5 > $tabwidth} { + set tabwidth [expr {$w+5}] + .t configure -tabs $tabwidth + } +} +.CE + .SH "SEE ALSO" -options +options(n) .SH KEYWORDS font |