Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Font.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "FONT 1"
.TH FONT 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
font \- Create and inspect fonts.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\ \fI$widget\fR\->\fBFont\fR(\fIoption\fR?, \fIarg, arg, ...\fR?)
.PP
\&\ \fI$font\fR\->\fIOption\fR?(\fIarg, arg, ...\fR)?
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fBFont\fR method 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:
.IP "\fI$font\fR\->\fBactual\fR(\fI\-option\fR?)" 4
.IX Item "$font->actual(-option?)"
.PD 0
.IP "\fI$widget\fR\->\fBfontActual\fR(\fIfont\fR?, \fI\-option\fR?)" 4
.IX Item "$widget->fontActual(font?, -option?)"
.PD
Returns information about the actual attributes that are obtained when
\&\fIfont\fR is used on \fI$font\fR's display; the actual attributes obtained
may differ from the attributes requested due to platform-dependant
limitations, such as the availability of font families and pointsizes.
\&\fIfont\fR is a font description; see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below. If
\&\fIoption\fR is specified, returns the value of that attribute; if it is
omitted, the return value is a list of all the attributes and their values.
See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the possible attributes.
.IP "\fI$font\fR\->\fBconfigure\fR(\fI\-option\fR??=>\fIvalue\fR, \fI\-option\fR=>\fIvalue\fR, ...?)" 4
.IX Item "$font->configure(-option??=>value, -option=>value, ...?)"
Query or modify the desired attributes for \fI$font\fR.
If no \fI\-option\fR is specified, returns a list describing
all the options and their values for \fIfontname\fR. If a single \fI\-option\fR
is specified with no \fIvalue\fR, then returns the current value of that
attribute. If one or more \fIoption-value\fR pairs are specified,
then the method modifies the given named font to have the given values; in
this case, all widgets using that font will redisplay themselves using the
new attributes for the font. See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the
possible attributes.
.Sp
Note: the above behaviour differs in detail to \fBconfigure\fR on widgets,
images etc.
.IP "\fI$font\fR = \fI$widget\fR\->\fBFont\fR(\fI\-option\fR=>\fIvalue\fR, ...>?)" 4
.IX Item "$font = $widget->Font(-option=>value, ...>?)"
.PD 0
.IP "\fI$font\fR = \fI$widget\fR\->\fBfontCreate\fR(?\fIfontname\fR??, \fI\-option\fR=>\fIvalue\fR, ...>?)" 4
.IX Item "$font = $widget->fontCreate(?fontname??, -option=>value, ...>?)"
.PD
Creates a new font object and returns a reference to it.
\&\fIfontname\fR specifies the name for the font; if it is omitted, then Tk generates
a new name of the form \fBfont\fR\fIx\fR, where \fIx\fR is an integer. There may be any
number of \fIoption-value\fR pairs, which provide the desired attributes for
the new named font. See \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below for a list of the possible
attributes.
.Sp
Note: the created font is \fInot\fR shared between widgets of different
MainWindows.
.IP "\fI$font\fR\->\fBdelete\fR" 4
.IX Item "$font->delete"
.PD 0
.IP "\fI$widget\fR\->\fBfontDelete\fR(\fIfontname\fR?, \fIfontname\fR, ...?)" 4
.IX Item "$widget->fontDelete(fontname?, fontname, ...?)"
.PD
Delete the specified named fonts. If there are widgets using the named font,
the named font won't actually be deleted until all the instances are
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 \fBfontCreate\fR, the widgets will use the new named font
and redisplay themselves using the new attributes of that font.
.IP "\fI$widget\fR\->\fBfontFamilies\fR" 4
.IX Item "$widget->fontFamilies"
The return value is a list of the case-insensitive names of all font families
that exist on \fI$widget\fR's display.
.IP "\fI$font\fR\->\fBmeasure\fR(\fItext\fR)" 4
.IX Item "$font->measure(text)"
.PD 0
.IP "\fI$widget\fR\->\fBfontMeasure\fR(\fIfont\fR, \fItext\fR)" 4
.IX Item "$widget->fontMeasure(font, text)"
.PD
Measures the amount of space the string \fItext\fR would use in the given
\&\fIfont\fR when displayed in \fI$widget\fR. \fIfont\fR is a font description;
see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below.
The return value is the total width in pixels
of \fItext\fR, not including the extra pixels used by highly exagerrated
characters such as cursive ``\fIf\fR''. If the string contains newlines or tabs,
those characters are not expanded or treated specially when measuring the
string.
.IP "\fI$font\fR\->\fBmetrics\fR(\fI\-option\fR?)" 4
.IX Item "$font->metrics(-option?)"
.PD 0
.IP "\fI$widget\fR\->\fBfontMetrics\fR(\fIfont\fR?, \fI\-option\fR?)" 4
.IX Item "$widget->fontMetrics(font?, -option?)"
.PD
Returns information about the metrics (the font-specific data), for
\&\fIfont\fR when it is used on \fI$widget\fR's display. \fIfont\fR is a font
description; see \*(L"\s-1FONT\s0 \s-1DESCRIPTION\s0\*(R" below.
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 \*(L"\s-1FONT\s0 \s-1METRICS\s0\*(R" below for a list
of the possible metrics.
.IP "\fI$widget\fR\->\fBfontNames\fR" 4
.IX Item "$widget->fontNames"
The return value is a list of all font objects that are currently defined for
\&\fI$widget\fR's MainWindow.
.SH "FONT DESCRIPTION"
.IX Header "FONT DESCRIPTION"
The following formats are accepted as a font description anywhere
\&\fIfont\fR is specified as an argument above; these same forms are also
permitted when specifying the \fB\-font\fR option for widgets.
.IP "[1] \fIfontname\fR" 4
.IX Item "[1] fontname"
The name of a named font, created using the \fBfontCreate\fR method. When
a widget uses a named font, it is guaranteed that this will never cause an
error, as long as the named font exists, no matter what potentially invalid
or meaningless set of attributes the named font has. If the named font
cannot be displayed with exactly the specified attributes, some other close
font will be substituted automatically.
.IP "[1a] \fI$font\fR" 4
.IX Item "[1a] $font"
A font object created using the \fBFont\fR method. This is essentially the same
as using a named font. The object is a reference to the name, and carries
additional information e.g. which MainWindow it relates to in an manner peculiar
to perl/Tk.
.IP "[3] \fIsystemfont\fR" 4
.IX Item "[3] systemfont"
The platform-specific name of a font, interpreted by the graphics server.
This also includes, under X, an \s-1XLFD\s0 (see [4]) for which a single ``\fB*\fR''
character was used to elide more than one field in the middle of the
name. See \*(L"\s-1PLATFORM\-SPECIFIC\s0 \s-1ISSUES\s0\*(R" for a list of the system fonts.
.IP "[3] [\fIfamily\fR,?\fIsize\fR,??\fIstyle\fR,??\fIstyle ...\fR?]" 4
.IX Item "[3] [family,?size,??style,??style ...?]"
A properly formed list whose first element is the desired font
\&\fIfamily\fR and whose optional second element is the desired \fIsize\fR.
The interpretation of the \fIsize\fR attribute follows the same rules
described for \-size in \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below. Any additional optional
arguments following the \fIsize\fR are font \fIstyle\fRs. Possible values
for the \fIstyle\fR arguments are as follows:
.Sp
.Vb 2
\& normal bold roman italic
\& underline overstrike
.Ve
.IP "[4] X\-font names (\s-1XLFD\s0)" 4
.IX Item "[4] X-font names (XLFD)"
A Unix-centric font name of the form
\&\fI\-foundry\-family\-weight\-slant\-setwidth\-addstyle\-pixel\-point\-resx\-resy\-spacing\-width\-charset\-encoding\fR.
The ``\fB*\fR'' character may be used to skip individual fields that the
user does not care about. There must be exactly one ``\fB*\fR'' for each
field skipped, except that a ``\fB*\fR'' at the end of the \s-1XLFD\s0 skips any
remaining fields; the shortest valid \s-1XLFD\s0 is simply ``\fB*\fR'', signifying
all fields as defaults. Any fields that were skipped are given default
values. For compatibility, an \s-1XLFD\s0 always chooses a font of the specified
pixel size (not point size); although this interpretation is not strictly
correct, all existing applications using XLFDs assumed that one ``point''
was in fact one pixel and would display incorrectly (generally larger) if
the correct size font were actually used.
.IP "[5] \fIoption value \fR?\fIoption value ...\fR?" 4
.IX Item "[5] option value ?option value ...?"
A properly formed list of \fIoption-value\fR pairs that specify
the desired attributes of the font, in the same format used when defining
a named font; see \*(L"\s-1FONT\s0 \s-1OPTIONS\s0\*(R" below.
.PP
When font description \fIfont\fR is used, the system attempts to parse the
description according to each of the above five rules, in the order specified.
Cases [1] and [2] must match the name of an existing named font or of a
system font. Cases [3], [4], and [5] are accepted on all
platforms and the closest available font will be used. In some situations
it may not be possible to find any close font (e.g., the font family was
a garbage value); in that case, some system-dependant default font is
chosen. If the font description does not match any of the above patterns,
an error is generated.
.SH "FONT METRICS"
.IX Header "FONT METRICS"
The following options are used by the \fBmetrics\fR/\fBfontMetrics\fR method to query
font-specific data determined when the font was created. These properties are
for the whole font itself and not for individual characters drawn in that
font. In the following definitions, the ``baseline'' of a font is the
horizontal line where the bottom of most letters line up; certain letters,
such as lower-case ``g'' stick below the baseline.
.IP "\fB\-ascent\fR" 4
.IX Item "-ascent"
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.
(\fI$font\fR\-<gt>\fBascent\fR is provided for compatibility.)
.IP "\fB\-descent\fR" 4
.IX Item "-descent"
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.
(\fI$font\fR\-<gt>\fBdescent\fR is provided for compatibility.)
.IP "\fB\-linespace\fR" 4
.IX Item "-linespace"
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.
.IP "\fB\-fixed\fR" 4
.IX Item "-fixed"
Returns a boolean flag that is ``\fB1\fR'' if this is a fixed-width font,
where each normal character is the the same width as all the other
characters, or is ``\fB0\fR'' if this is a proportionally-spaced font, where
individual characters have different widths. The widths of control
characters, tab characters, and other non-printing characters are not
included when calculating this value.
.SH "FONT OPTIONS"
.IX Header "FONT OPTIONS"
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:
.IP "\fB\-family\fR => \fIname\fR" 4
.IX Item "-family => name"
The case-insensitive font family name. Tk guarantees to support the font
families named \fBCourier\fR (a monospaced ``typewriter'' font), \fBTimes\fR
(a serifed ``newspaper'' font), and \fBHelvetica\fR (a sans-serif
``European'' font). The most closely matching native font family will
automatically be substituted when one of the above font families is used.
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.
.IP "\fB\-size\fR => \fIsize\fR" 4
.IX Item "-size => size"
The desired size of the font. If the \fIsize\fR argument is a positive
number, it is interpreted as a size in points. If \fIsize\fR is a negative
number, its absolute value is interpreted as a size in pixels. If a
font cannot be displayed at the specified size, a nearby size will be
chosen. If \fIsize\fR is unspecified or zero, a platform-dependent default
size will be chosen.
.Sp
The original Tcl/Tk authors believe sizes should normally be specified in points
so the application will remain the same ruler size on the screen, even when
changing screen resolutions or moving scripts across platforms. While this is an
admirable goal it does not work as well in practice as they hoped.
The mapping between points and pixels is set when the application starts, based
on alleged properties of the installed monitor, but it can be overridden by
calling the scaling command. However this can be
problematic when system has no way of telling if (say) an 11\*(L" or 22\*(R" monitor is
attached, also if it \fIcan\fR tell then some monitor sizes may result in poorer
quality scaled fonts being used rather than a \*(L"tuned\*(R" bitmap font.
In addition specifying pixels is useful in certain circumstances such as when a piece of text
must line up with respect to a fixed-size bitmap.
.Sp
At present the Tcl/Tk scheme is used unchanged, with \*(L"point\*(R" size being returned
by \fIactual\fR (as an integer), and used internally. Suggestions for work-rounds
to undesirable behaviour welcome.
.IP "\fB\-weight\fR => \fIweight\fR" 4
.IX Item "-weight => weight"
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.
.IP "\fB\-slant\fR => \fIslant\fR" 4
.IX Item "-slant => slant"
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.
.IP "\fB\-underline\fR => \fIboolean\fR" 4
.IX Item "-underline => boolean"
The value is a boolean flag that specifies whether characters in this
font should be underlined. The default value for underline is \fBfalse\fR.
.IP "\fB\-overstrike\fR => \fIboolean\fR" 4
.IX Item "-overstrike => boolean"
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"
.IX Header "PLATFORM-SPECIFIC ISSUES"
The following named system fonts are supported:
.IP "X Windows:" 4
.IX Item "X Windows:"
All valid X font names, including those listed by \fIxlsfonts\fR\|(1), are available.
.IP "\s-1MS\s0 Windows:" 4
.IX Item "MS Windows:"
.Vb 2
\& system ansi device
\& systemfixed ansifixed oemfixed
.Ve
.IP "Macintosh:" 4
.IX Item "Macintosh:"
.Vb 1
\& system application
.Ve
.SH "COMPATIBILITY WITH PREVIOUS VERSIONS"
.IX Header "COMPATIBILITY WITH PREVIOUS VERSIONS"
In prior versions of perl/Tk the \fI$widget\fR\->\fBFont\fR method was a perl
wrapper on the original \*(L"[4] X\-font names (\s-1XLFD\s0)\*(R" style as described above
(which was the only form supported by versions of core tk prior to version
tk8.0).
This module is provided in its original form (it has just been renamed)
via:
.PP
.Vb 2
\& use Tk::X11Font;
\& I<$widget>-E<gt>B<X11Font>(...)
.Ve
.PP
However the methods of the old scheme have been mimiced as closely as possible
with the new scheme. It is intended that code should work without modification,
except for the case of using :
.PP
.Vb 1
\& @names = $font->Name;
.Ve
.PP
i.e. the \fIName\fR method in an array/list context. This now returns one element
on all platforms (as it did on Win32), while previously on X systems it returned
a list of fonts that matched an under-specified pattern.
.PP
Briefly the methods supported for compatibilty are as follows:
.IP "$newfont = \fI$font\fR\->\fBClone\fR(\fI\-option\fR=>\fIvalue\fR, ...>?)" 4
.IX Item "$newfont = $font->Clone(-option=>value, ...>?)"
Returns a new font object \fI$newfont\fR related to the original \fI$font\fR by
changing the values of the specified \fI\-option\fRs.
.IP "\fI$font\fR\->Family \- maps to \-family" 4
.IX Item "$font->Family - maps to -family"
.PD 0
.IP "\fI$font\fR\->Weight \- maps to \-weight" 4
.IX Item "$font->Weight - maps to -weight"
.IP "\fI$font\fR\->Slant \- maps to \-slant" 4
.IX Item "$font->Slant - maps to -slant"
.IP "\fI$font\fR\->Pixel and Point \- map to \-size" 4
.IX Item "$font->Pixel and Point - map to -size"
.PD
.PP
New code should use \fI$font\fR\->\fBconfigure\fR to achieve same effect as last
four items above.
.IP "Foundry, Swidth, Adstyle, Xres, Yres, Space, Avgwidth, Registry, Encoding" 4
.IX Item "Foundry, Swidth, Adstyle, Xres, Yres, Space, Avgwidth, Registry, Encoding"
Are all ignored if set, and return '*' if queried.
.IP "\fI$font\fR\->\fBName\fR" 4
.IX Item "$font->Name"
Returns the name of a named font, or a string representation of an unnamed
font. Using \fI$font\fR in a scalar context does the same. Note this is distinctly
different from behaviour of X11Font's Name in
a list context.
.IP "\fI$font\fR\->\fBPattern\fR" 4
.IX Item "$font->Pattern"
Returns a \s-1XLFD\s0 string for the font based on \fIactual\fR values, and some heuristics
to map Tk's forms to the \*(L"standard\*(R" X conventions.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Tk::options
.PP
Tk::X11Font
.SH "KEYWORDS"
.IX Header "KEYWORDS"
font