diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2004-06-18 21:42:16 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2004-06-18 21:42:16 (GMT) |
commit | 19d095eaf7fa465272519bbd31504400e6d2237a (patch) | |
tree | a17845a209fa0f0a4acf5760252b178cb4849d45 /doc | |
parent | 83ba30aa1724ddbca5d23dce13b35e7baa2ca89a (diff) | |
download | tk-19d095eaf7fa465272519bbd31504400e6d2237a.zip tk-19d095eaf7fa465272519bbd31504400e6d2237a.tar.gz tk-19d095eaf7fa465272519bbd31504400e6d2237a.tar.bz2 |
Added example.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/font.n | 24 |
1 files changed, 21 insertions, 3 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.4 2004/03/25 12:12:36 vincentdarley Exp $ +'\" RCS: @(#) $Id: font.n,v 1.5 2004/06/18 21:42:16 dkf Exp $ '\" .so man.macros .TH font n 8.0 Tk "Tk Built-In Commands" @@ -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\fR families]] { + .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\fR measure [.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 |