diff options
Diffstat (limited to 'doc/MeasureChar.3')
-rw-r--r-- | doc/MeasureChar.3 | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3 index 059d8e8..c8164f3 100644 --- a/doc/MeasureChar.3 +++ b/doc/MeasureChar.3 @@ -19,10 +19,8 @@ int int \fBTk_TextWidth(\fItkfont, string, numBytes\fB)\fR .sp -void \fBTk_DrawChars(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fB)\fR .sp -void \fBTk_UnderlineChars(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fB)\fR .sp .SH ARGUMENTS @@ -35,24 +33,22 @@ Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a platform-dependent manner. -.VS 8.1 .AP int numBytes in The maximum number of bytes to consider when measuring or drawing \fIstring\fR. Must be greater than or equal to 0. -.VE 8.1 .AP int maxPixels in If \fImaxPixels\fR is >= 0, it specifies the longest permissible line length in pixels. Characters from \fIstring\fR are processed only until this many pixels have been covered. If \fImaxPixels\fR is < 0, then the line length is unbounded and the \fIflags\fR argument is ignored. .AP int flags in -Various flag bits OR-ed together: TK_PARTIAL_OK means include a character +Various flag bits OR-ed together: \fBTK_PARTIAL_OK\fR means include a character as long as any part of it fits in the length given by \fImaxPixels\fR; otherwise, a character must fit completely to be considered. -TK_WHOLE_WORDS means stop on a word boundary, if possible. If -TK_AT_LEAST_ONE is set, it means return at least one character even if no +\fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If +\fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no characters could fit in the length given by \fImaxPixels\fR. If -TK_AT_LEAST_ONE is set and TK_WHOLE_WORDS is also set, it means that if +\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. @@ -69,7 +65,6 @@ must be the same as the \fItkfont\fR. .AP int "x, y" in Coordinates at which to place the left edge of the baseline when displaying \fIstring\fR. -.VS 8.1 .AP int firstByte in The index of the first byte of the first character to underline in the \fIstring\fR. Underlining begins at the left edge of this character. @@ -77,23 +72,19 @@ The index of the first byte of the first character to underline in the The index of the first byte of the last character up to which the underline will be drawn. The character specified by \fIlastByte\fR will not itself be underlined. -.VE 8.1 .BE - .SH DESCRIPTION .PP These routines are for measuring and displaying simple single-font, -single-line, strings. To measure and display single-font, multi-line, +single-line strings. To measure and display single-font, multi-line, justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR. There is no programming interface in the core of Tk that supports multi-font, multi-line text; support for that behavior must be built on top of simpler layers. -.VS 8.1 Note that the interfaces described here are byte-oriented not character-oriented, so index values coming from Tcl scripts need to be converted to byte offsets using the \fBTcl_UtfAtIndex\fR and related routines. -.VE 8.1 .PP A glyph is the displayable picture of a letter, number, or some other symbol. Not all character codes in a given font have a glyph. @@ -125,11 +116,12 @@ space in pixels the given \fIstring\fR needs. given \fIdrawable\fR. .PP \fBTk_UnderlineChars\fR underlines the given range of characters in the -given \fIstring\fR. It doesn't draw the characters (which are assumed to +given \fIstring\fR. It does not draw the characters (which are assumed to have been displayed previously by \fBTk_DrawChars\fR); it just draws the underline. This procedure is used to underline a few characters without having to construct an underlined font. To produce natively underlined text, the appropriate underlined font should be constructed and used. - +.SH "SEE ALSO" +font(n), FontId(3) .SH KEYWORDS -font +font, measurement |