FontId.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: FontId.3,v 1.3 2000/07/25 21:14:34 jenglish Exp $
- '"
- .so man.macros
- .TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName - accessor functions for
- fonts
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- Font
- fBTk_FontId(fItkfontfB)fR
- .sp
- void
- fBTk_GetFontMetrics(fItkfont, fmPtrfB)fR
- .sp
- int
- fBTk_PostscriptFontName(fItkfont, dsPtrfB)fR
- .SH ARGUMENTS
- .AS Tk_FontMetrics *dsPtr
- .AP Tk_Font tkfont in
- Opaque font token being queried. Must have been returned by a previous
- call to fBTk_GetFontfR.
- .AP Tk_FontMetrics *fmPtr out
- Pointer to structure in which the font metrics for fItkfontfR will
- be stored.
- .AP Tcl_DString *dsPtr out
- Pointer to an initialized fBTcl_DStringfR to which the name of the
- Postscript font that corresponds to fItkfontfR will be appended.
- .BE
- .SH DESCRIPTION
- .PP
- Given a fItkfontfR, fBTk_FontIdfR returns the token that should be
- selected into an XGCValues structure in order to construct a graphics
- context that can be used to draw text in the specified font.
- .PP
- fBTk_GetFontMetricsfR computes the ascent, descent, and linespace of the
- fItkfontfR in pixels and stores those values in the structure pointer to by
- fIfmPtrfR. These values can be used in computations such as to space
- multiple lines of text, to align the baselines of text in different
- fonts, and to vertically align text in a given region. See the
- documentation for the fBfontfR command for definitions of the terms
- ascent, descent, and linespace, used in font metrics.
- .PP
- fBTk_PostscriptFontNamefR maps a fItkfontfR to the corresponding
- Postcript font name that should be used when printing. The return value
- is the size in points of the fItkfontfR and the Postscript font name is
- appended to fIdsPtrfR. fIDsPtrfR must refer to an initialized
- fBTcl_DStringfR. Given a ``reasonable'' Postscript printer, the
- following screen font families should print correctly:
- .IP
- fBAvant GardefR, fBArialfR, fBBookmanfR, fBCourierfR,
- fBCourier NewfR, fBGenevafR, fBHelveticafR, fBMonacofR,
- fBNew Century SchoolbookfR, fBNew YorkfR, fBPalatinofR, fBSymbolfR,
- fBTimesfR, fBTimes New RomanfR, fBZapf ChanceryfR, and
- fBZapf DingbatsfR.
- .PP
- Any other font families may not print correctly because the computed
- Postscript font name may be incorrect or not exist on the printer.
- .VS 8.0 br
- .SH "DATA STRUCTURES"
- The Tk_FontMetrics data structure is used by Tk_GetFontMetrics to return
- information about a font and is defined as follows:
- .CS
- typedef struct Tk_FontMetrics {
- int ascent;
- int descent;
- int linespace;
- } Tk_FontMetrics;
- .CE
- The fIlinespacefR field is the amount in pixels that the tallest
- letter sticks up above the baseline, plus any extra blank space added
- by the designer of the font.
- .PP
- The fIdescentfR is the largest amount in pixels that any letter
- sticks below the baseline, plus any extra blank space added by the
- designer of the font.
- .PP
- The fIlinespacefR is the sum of the ascent and descent. How far
- apart two lines of text in the same font should be placed so that none
- of the characters in one line overlap any of the characters in the
- other line.
- .VE
- .SH KEYWORDS
- font