summaryrefslogtreecommitdiffstats
path: root/doc/font.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/font.n')
-rw-r--r--doc/font.n91
1 files changed, 49 insertions, 42 deletions
diff --git a/doc/font.n b/doc/font.n
index 72f9270..e1bdf05 100644
--- a/doc/font.n
+++ b/doc/font.n
@@ -12,7 +12,7 @@
.SH NAME
font \- Create and inspect fonts.
.SH SYNOPSIS
-\fBfont\fI option \fR?\fIarg arg ...\fR?
+\fBfont\fI option \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
@@ -20,6 +20,7 @@ The \fBfont\fR command provides several facilities for dealing with
fonts, such as defining named fonts and inspecting the actual attributes of
a font. The command has several different forms, determined by the
first argument. The following forms are currently supported:
+.\" METHOD: actual
.TP
\fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? ?\fB\-\|\-\fR? ?\fIchar\fR?
.
@@ -38,6 +39,7 @@ that character, which will be different from the base font if the base
font does not contain the given character. If \fIchar\fR may be a hyphen, it
should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled
\fIoption\fR.
+.\" METHOD: configure
.TP
\fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
@@ -52,12 +54,13 @@ new attributes for the font. See \fBFONT OPTIONS\fR below for a list of the
possible attributes.
.RS
.PP
-Note that on Aqua/Mac OS X, the system fonts (see
+Note that on Aqua/macOS, the system fonts (see
\fBPLATFORM SPECIFIC FONTS\fR below) may not be actually altered because they
are implemented by the system theme. To achieve the effect of modification,
use \fBfont actual\fR to get their configuration and \fBfont create\fR to
synthesize a copy of the font which can be modified.
.RE
+.\" METHOD: create
.TP
\fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR?
.
@@ -67,8 +70,9 @@ form \fBfont\fIx\fR, where \fIx\fR is an integer. There may be any number
of \fIoption\fR\-\fIvalue\fR pairs, which provide the desired attributes for
the new named font. See \fBFONT OPTIONS\fR below for a list of the possible
attributes.
+.\" METHOD: delete
.TP
-\fBfont delete\fR \fIfontname\fR ?\fIfontname ...\fR?
+\fBfont delete\fI fontname\fR ?\fIfontname ...\fR?
.
Delete the specified named fonts. If there are widgets using the named font,
the named font will not actually be deleted until all the instances are
@@ -76,12 +80,14 @@ released. Those widgets will continue to display using the last known values
for the named font. If a deleted named font is subsequently recreated with
another call to \fBfont create\fR, the widgets will use the new named font
and redisplay themselves using the new attributes of that font.
+.\" METHOD: families
.TP
\fBfont families\fR ?\fB\-displayof \fIwindow\fR?
.
The return value is a list of the case-insensitive names of all font families
that exist on \fIwindow\fR's display. If the \fIwindow\fR argument is
omitted, it defaults to the main window.
+.\" METHOD: measure
.TP
\fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR
.
@@ -96,6 +102,7 @@ characters such as cursive
If the string contains newlines or tabs,
those characters are not expanded or treated specially when measuring the
string.
+.\" METHOD: metrics
.TP
\fBfont metrics \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR?
.
@@ -107,8 +114,10 @@ omitted, it defaults to the main window. If \fIoption\fR is specified,
returns the value of that metric; if it is omitted, the return value is a
list of all the metrics and their values. See \fBFONT METRICS\fR
below for a list of the possible metrics.
+.\" METHOD: names
.TP
\fBfont names\fR
+.
The return value is a list of all the named fonts that are currently defined.
.SH "FONT DESCRIPTIONS"
.PP
@@ -200,16 +209,19 @@ horizontal line where the bottom of most letters line up; certain letters,
such as lower-case
.QW g
stick below the baseline.
+.\" OPTION: -ascent
.TP
-\fB\-ascent \0\fR
+\fB\-ascent\fR
.
The amount in pixels that the tallest letter sticks up above the baseline of
the font, plus any extra blank space added by the designer of the font.
+.\" OPTION: -descent
.TP
-\fB\-descent \0\fR
+\fB\-descent\fR
.
The largest amount in pixels that any letter sticks down below the baseline
of the font, plus any extra blank space added by the designer of the font.
+.\" OPTION: -linespace
.TP
\fB\-linespace\fR
.
@@ -217,8 +229,9 @@ Returns how far apart vertically in pixels two lines of text using the same
font should be placed so that none of the characters in one line overlap any
of the characters in the other line. This is generally the sum of the ascent
above the baseline line plus the descent below the baseline.
+.\" OPTION: -fixed
.TP
-\fB\-fixed \0\fR
+\fB\-fixed\fR
.
Returns a boolean flag that is
.QW \fB1\fR
@@ -235,6 +248,7 @@ included when calculating this value.
The following options are supported on all platforms, and are used when
constructing a named font or when specifying a font using style [5] as
above:
+.\" OPTION: -family
.TP
\fB\-family \fIname\fR
.
@@ -251,6 +265,7 @@ The \fIname\fR may also be the name of a native, platform-specific font
family; in that case it will work as desired on one platform but may not
display correctly on other platforms. If the family is unspecified or
unrecognized, a platform-specific default font will be chosen.
+.\" OPTION: -size
.TP
\fB\-size \fIsize\fR
.
@@ -270,6 +285,7 @@ to a fixed-size bitmap. The mapping between points and pixels is set when
the application starts, based on properties of the installed monitor, but it
can be overridden by calling the \fBtk scaling\fR command.
.RE
+.\" OPTION: -weight
.TP
\fB\-weight \fIweight\fR
.
@@ -277,20 +293,26 @@ The nominal thickness of the characters in the font. The value
\fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a
bold font. The closest available weight to the one specified will
be chosen. The default weight is \fBnormal\fR.
+.\" OPTION: -slant
.TP
\fB\-slant \fIslant\fR
+.
The amount the characters in the font are slanted away from the
vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR.
A roman font is the normal, upright appearance of a font, while
an italic font is one that is tilted some number of degrees from upright.
The closest available slant to the one specified will be chosen.
The default slant is \fBroman\fR.
+.\" OPTION: -underline
.TP
\fB\-underline \fIboolean\fR
+.
The value is a boolean flag that specifies whether characters in this
font should be underlined. The default value for underline is \fBfalse\fR.
+.\" OPTION: -overstrike
.TP
\fB\-overstrike \fIboolean\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.
@@ -298,41 +320,23 @@ for overstrike is \fBfalse\fR.
.PP
The following named fonts are supported on all systems, and default to values
that match appropriate system defaults.
-.TP
-\fBTkDefaultFont\fR
-.
+.IP \fBTkDefaultFont\fR
This font is the default for all GUI items not otherwise specified.
-.TP
-\fBTkTextFont\fR
-.
+.IP \fBTkTextFont\fR
This font should be used for user text in entry widgets, listboxes etc.
-.TP
-\fBTkFixedFont\fR
-.
+.IP \fBTkFixedFont\fR
This font is the standard fixed-width font.
-.TP
-\fBTkMenuFont\fR
-.
+.IP \fBTkMenuFont\fR
This font is used for menu items.
-.TP
-\fBTkHeadingFont\fR
-.
+.IP \fBTkHeadingFont\fR
This font should be used for column headings in lists and tables.
-.TP
-\fBTkCaptionFont\fR
-.
+.IP \fBTkCaptionFont\fR
This font should be used for window and dialog caption bars.
-.TP
-\fBTkSmallCaptionFont\fR
-.
+.IP \fBTkSmallCaptionFont\fR
This font should be used for captions on contained windows or tool dialogs.
-.TP
-\fBTkIconFont\fR
-.
+.IP \fBTkIconFont\fR
This font should be used for icon captions.
-.TP
-\fBTkTooltipFont\fR
-.
+.IP \fBTkTooltipFont\fR
This font should be used for tooltip windows (transient information windows).
.LP
It is \fInot\fR advised to change these fonts, as they may be modified by Tk
@@ -343,9 +347,11 @@ modify that.
The following system fonts are supported:
.TP
\fBX Windows\fR
+.
All valid X font names, including those listed by xlsfonts(1), are available.
.TP
\fBMS Windows\fR
+.
The following fonts are supported, and are mapped to the user's
style defaults.
.RS
@@ -356,7 +362,8 @@ style defaults.
.DE
.RE
.TP
-\fBMac OS X\fR
+\fBmacOS\fR
+.
The following fonts are supported, and are mapped to the user's
style defaults.
.RS
@@ -386,17 +393,17 @@ theme fonts:
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
+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 {} \e
+foreach family [lsort -dictionary [\fBfont families\fR]] {
+ .t tag configure f[incr count] -font [list $family 10]
+ .t insert end ${family}:\et {} \e
"This is a simple sampler\en" f$count
- set w [\fBfont measure\fR [.t cget \-font] ${family}:]
- if {$w+5 > $tabwidth} {
- set tabwidth [expr {$w+5}]
- .t configure \-tabs $tabwidth
+ set w [\fBfont measure\fR [.t cget -font] ${family}:]
+ if {$w + 5 > $tabwidth} {
+ set tabwidth [expr {$w + 5}]
+ .t configure -tabs $tabwidth
}
}
.CE