diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-18 21:42:16 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-18 21:42:16 (GMT) |
commit | 3787f5ffc469815e898434d4b4491d680ece951f (patch) | |
tree | a17845a209fa0f0a4acf5760252b178cb4849d45 /doc | |
parent | 3f6c7bd53424ac8193971c5d8cdb198b9199c777 (diff) | |
download | tk-3787f5ffc469815e898434d4b4491d680ece951f.zip tk-3787f5ffc469815e898434d4b4491d680ece951f.tar.gz tk-3787f5ffc469815e898434d4b4491d680ece951f.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 |