1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1996 Sun Microsystems, Inc.
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" RCS: @(#) $Id: FontId.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
|
11 |
|
|
.BS
|
12 |
|
|
.SH NAME
|
13 |
|
|
Tk_FontId, Tk_FontMetrics, Tk_PostscriptFontName \- accessor functions for
|
14 |
|
|
fonts
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
.nf
|
17 |
|
|
\fB#include \fR
|
18 |
|
|
.sp
|
19 |
|
|
Font
|
20 |
|
|
\fBTk_FontId(\fItkfont\fB)\fR
|
21 |
|
|
.sp
|
22 |
|
|
void
|
23 |
|
|
\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR
|
24 |
|
|
.sp
|
25 |
|
|
int
|
26 |
|
|
\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR
|
27 |
|
|
|
28 |
|
|
.SH ARGUMENTS
|
29 |
|
|
.AS Tk_FontMetrics *dsPtr
|
30 |
|
|
.AP Tk_Font tkfont in
|
31 |
|
|
Opaque font token being queried. Must have been returned by a previous
|
32 |
|
|
call to \fBTk_GetFont\fR.
|
33 |
|
|
.AP Tk_FontMetrics *fmPtr out
|
34 |
|
|
Pointer to structure in which the font metrics for \fItkfont\fR will
|
35 |
|
|
be stored.
|
36 |
|
|
.AP Tcl_DString *dsPtr out
|
37 |
|
|
Pointer to an initialized \fBTcl_DString\fR to which the name of the
|
38 |
|
|
Postscript font that corresponds to \fItkfont\fR will be appended.
|
39 |
|
|
.BE
|
40 |
|
|
|
41 |
|
|
.SH DESCRIPTION
|
42 |
|
|
.PP
|
43 |
|
|
Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be
|
44 |
|
|
selected into an XGCValues structure in order to construct a graphics
|
45 |
|
|
context that can be used to draw text in the specified font.
|
46 |
|
|
.PP
|
47 |
|
|
\fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the
|
48 |
|
|
\fItkfont\fR in pixels and stores those values in the structure pointer to by
|
49 |
|
|
\fIfmPtr\fR. These values can be used in computations such as to space
|
50 |
|
|
multiple lines of text, to align the baselines of text in different
|
51 |
|
|
fonts, and to vertically align text in a given region. See the
|
52 |
|
|
documentation for the \fBfont\fR command for definitions of the terms
|
53 |
|
|
ascent, descent, and linespace, used in font metrics.
|
54 |
|
|
.PP
|
55 |
|
|
\fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding
|
56 |
|
|
Postcript font name that should be used when printing. The return value
|
57 |
|
|
is the size in points of the \fItkfont\fR and the Postscript font name is
|
58 |
|
|
appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized
|
59 |
|
|
\fBTcl_DString\fR. Given a ``reasonable'' Postscript printer, the
|
60 |
|
|
following screen font families should print correctly:
|
61 |
|
|
.IP
|
62 |
|
|
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
|
63 |
|
|
\fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR,
|
64 |
|
|
\fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR,
|
65 |
|
|
\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and
|
66 |
|
|
\fBZapf Dingbats\fR.
|
67 |
|
|
.PP
|
68 |
|
|
Any other font families may not print correctly because the computed
|
69 |
|
|
Postscript font name may be incorrect or not exist on the printer.
|
70 |
|
|
.VS 8.0 br
|
71 |
|
|
.SH DATA STRUCTURES
|
72 |
|
|
The Tk_FontMetrics data structure is used by Tk_GetFontMetrics to return
|
73 |
|
|
information about a font and is defined as follows:
|
74 |
|
|
.CS
|
75 |
|
|
typedef struct Tk_FontMetrics {
|
76 |
|
|
int ascent;
|
77 |
|
|
int descent;
|
78 |
|
|
int linespace;
|
79 |
|
|
} Tk_FontMetrics;
|
80 |
|
|
.CE
|
81 |
|
|
The \fIlinespace\fR field is the amount in pixels that the tallest
|
82 |
|
|
letter sticks up above the baseline, plus any extra blank space added
|
83 |
|
|
by the designer of the font.
|
84 |
|
|
.PP
|
85 |
|
|
The \fIdescent\fR is the largest amount in pixels that any letter
|
86 |
|
|
sticks below the baseline, plus any extra blank space added by the
|
87 |
|
|
designer of the font.
|
88 |
|
|
.PP
|
89 |
|
|
The \fIlinespace\fR is the sum of the ascent and descent. How far
|
90 |
|
|
apart two lines of text in the same font should be placed so that none
|
91 |
|
|
of the characters in one line overlap any of the characters in the
|
92 |
|
|
other line.
|
93 |
|
|
.VE
|
94 |
|
|
.SH KEYWORDS
|
95 |
|
|
font
|