summaryrefslogtreecommitdiffstats
path: root/doc/font.n
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2004-06-18 21:42:16 (GMT)
committerdkf <dkf@noemail.net>2004-06-18 21:42:16 (GMT)
commitdb33a27e8d94b7071a53c3186f5f95f59469ca61 (patch)
treea17845a209fa0f0a4acf5760252b178cb4849d45 /doc/font.n
parent22469f8d72001eb12a7f48f517e17c6ee125e136 (diff)
downloadtk-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.n24
1 files changed, 21 insertions, 3 deletions
diff --git a/doc/font.n b/doc/font.n
index 104be90..8f12e00 100644
--- a/doc/font.n
+++ b/doc/font.n
@@ -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