diff options
author | dkf <dkf@noemail.net> | 2004-06-18 21:42:16 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2004-06-18 21:42:16 (GMT) |
commit | db33a27e8d94b7071a53c3186f5f95f59469ca61 (patch) | |
tree | a17845a209fa0f0a4acf5760252b178cb4849d45 /doc/font.n | |
parent | 22469f8d72001eb12a7f48f517e17c6ee125e136 (diff) | |
download | tk-db33a27e8d94b7071a53c3186f5f95f59469ca61.zip tk-db33a27e8d94b7071a53c3186f5f95f59469ca61.tar.gz tk-db33a27e8d94b7071a53c3186f5f95f59469ca61.tar.bz2 |
Added example.
FossilOrigin-Name: 28465eae6b6e07c415afe2733779cd6425013f06
Diffstat (limited to 'doc/font.n')
-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 |