Blame man/XmbTextPerCharExtents.man

Packit 5bd3a9
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
Packit 5bd3a9
.\" Copyright \(co 2000  The XFree86 Project, Inc.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Permission is hereby granted, free of charge, to any person obtaining
Packit 5bd3a9
.\" a copy of this software and associated documentation files (the
Packit 5bd3a9
.\" "Software"), to deal in the Software without restriction, including
Packit 5bd3a9
.\" without limitation the rights to use, copy, modify, merge, publish,
Packit 5bd3a9
.\" distribute, sublicense, and/or sell copies of the Software, and to
Packit 5bd3a9
.\" permit persons to whom the Software is furnished to do so, subject to
Packit 5bd3a9
.\" the following conditions:
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" The above copyright notice and this permission notice shall be included
Packit 5bd3a9
.\" in all copies or substantial portions of the Software.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Packit 5bd3a9
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 5bd3a9
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Packit 5bd3a9
.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit 5bd3a9
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit 5bd3a9
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit 5bd3a9
.\" OTHER DEALINGS IN THE SOFTWARE.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Except as contained in this notice, the name of the X Consortium shall
Packit 5bd3a9
.\" not be used in advertising or otherwise to promote the sale, use or
Packit 5bd3a9
.\" other dealings in this Software without prior written authorization
Packit 5bd3a9
.\" from the X Consortium.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
Packit 5bd3a9
.\" Digital Equipment Corporation
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Portions Copyright \(co 1990, 1991 by
Packit 5bd3a9
.\" Tektronix, Inc.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" Permission to use, copy, modify and distribute this documentation for
Packit 5bd3a9
.\" any purpose and without fee is hereby granted, provided that the above
Packit 5bd3a9
.\" copyright notice appears in all copies and that both that copyright notice
Packit 5bd3a9
.\" and this permission notice appear in all copies, and that the names of
Packit 5bd3a9
.\" Digital and Tektronix not be used in in advertising or publicity pertaining
Packit 5bd3a9
.\" to this documentation without specific, written prior permission.
Packit 5bd3a9
.\" Digital and Tektronix makes no representations about the suitability
Packit 5bd3a9
.\" of this documentation for any purpose.
Packit 5bd3a9
.\" It is provided ``as is'' without express or implied warranty.
Packit 5bd3a9
.\"
Packit 5bd3a9
.\" 
Packit 5bd3a9
.ds xT X Toolkit Intrinsics \- C Language Interface
Packit 5bd3a9
.ds xW Athena X Widgets \- C Language X Toolkit Interface
Packit 5bd3a9
.ds xL Xlib \- C Language X Interface
Packit 5bd3a9
.ds xC Inter-Client Communication Conventions Manual
Packit 5bd3a9
.na
Packit 5bd3a9
.de Ds
Packit 5bd3a9
.nf
Packit 5bd3a9
.\\$1D \\$2 \\$1
Packit 5bd3a9
.ft CW
Packit 5bd3a9
.\".ps \\n(PS
Packit 5bd3a9
.\".if \\n(VS>=40 .vs \\n(VSu
Packit 5bd3a9
.\".if \\n(VS<=39 .vs \\n(VSp
Packit 5bd3a9
..
Packit 5bd3a9
.de De
Packit 5bd3a9
.ce 0
Packit 5bd3a9
.if \\n(BD .DF
Packit 5bd3a9
.nr BD 0
Packit 5bd3a9
.in \\n(OIu
Packit 5bd3a9
.if \\n(TM .ls 2
Packit 5bd3a9
.sp \\n(DDu
Packit 5bd3a9
.fi
Packit 5bd3a9
..
Packit 5bd3a9
.de IN		\" send an index entry to the stderr
Packit 5bd3a9
..
Packit 5bd3a9
.de Pn
Packit 5bd3a9
.ie t \\$1\fB\^\\$2\^\fR\\$3
Packit 5bd3a9
.el \\$1\fI\^\\$2\^\fP\\$3
Packit 5bd3a9
..
Packit 5bd3a9
.de ZN
Packit 5bd3a9
.ie t \fB\^\\$1\^\fR\\$2
Packit 5bd3a9
.el \fI\^\\$1\^\fP\\$2
Packit 5bd3a9
..
Packit 5bd3a9
.de hN
Packit 5bd3a9
.ie t <\fB\\$1\fR>\\$2
Packit 5bd3a9
.el <\fI\\$1\fP>\\$2
Packit 5bd3a9
..
Packit 5bd3a9
.ny0
Packit 5bd3a9
.TH XmbTextPerCharExtents __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
Packit 5bd3a9
.SH NAME
Packit 5bd3a9
XmbTextPerCharExtents, XwcTextPerCharExtents, Xutf8TextPerCharExtents \- obtain per-character information for a text string
Packit 5bd3a9
.SH SYNTAX
Packit 5bd3a9
.HP
Packit 5bd3a9
Status XmbTextPerCharExtents\^(\^XFontSet \fIfont_set\fP\^, char
Packit 5bd3a9
*\fIstring\fP\^, int \fInum_bytes\fP\^, XRectangle *\fIink_array_return\fP\^,
Packit 5bd3a9
XRectangle *\fIlogical_array_return\fP\^, int \fIarray_size\fP\^, int
Packit 5bd3a9
*\fInum_chars_return\fP\^, XRectangle *\fIoverall_ink_return\fP\^, XRectangle
Packit 5bd3a9
*\fIoverall_logical_return\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
Status XwcTextPerCharExtents\^(\^XFontSet \fIfont_set\fP\^, wchar_t
Packit 5bd3a9
*\fIstring\fP\^, int \fInum_wchars\fP\^, XRectangle
Packit 5bd3a9
*\fIink_array_return\fP\^, XRectangle *\fIlogical_array_return\fP, int
Packit 5bd3a9
\fIarray_size\fP\^, int *\fInum_chars_return\fP\^, XRectangle
Packit 5bd3a9
*\fIoverall_ink_return\fP\^, XRectangle *\fIoverall_logical_return\fP\^); 
Packit 5bd3a9
.HP
Packit 5bd3a9
Status Xutf8TextPerCharExtents\^(\^XFontSet \fIfont_set\fP\^, char
Packit 5bd3a9
*\fIstring\fP\^, int \fInum_bytes\fP\^, XRectangle *\fIink_array_return\fP\^,
Packit 5bd3a9
XRectangle *\fIlogical_array_return\fP\^, int \fIarray_size\fP\^, int
Packit 5bd3a9
*\fInum_chars_return\fP\^, XRectangle *\fIoverall_ink_return\fP\^, XRectangle
Packit 5bd3a9
*\fIoverall_logical_return\fP\^);
Packit 5bd3a9
.SH ARGUMENTS
Packit 5bd3a9
.IP \fIarray_size\fP 1i
Packit 5bd3a9
Specifies the size of ink_array_return and logical_array_return.
Packit 5bd3a9
The caller must pass in arrays of this size.
Packit 5bd3a9
.IP \fIfont_set\fP 1i
Packit 5bd3a9
Specifies the font set.
Packit 5bd3a9
.IP \fIink_array_return\fP 1i
Packit 5bd3a9
Returns the ink dimensions for each character.
Packit 5bd3a9
.IP \fIlogical_array_return\fP 1i
Packit 5bd3a9
Returns the logical dimensions for each character.
Packit 5bd3a9
.IP \fInum_bytes\fP 1i
Packit 5bd3a9
Specifies the number of bytes in the string argument.
Packit 5bd3a9
.IP \fInum_chars_return\fP 1i
Packit 5bd3a9
Returns the number of characters in the string argument.
Packit 5bd3a9
.IP \fInum_wchars\fP 1i
Packit 5bd3a9
Specifies the number of characters in the string argument.
Packit 5bd3a9
.ds Ov extents of the entire string
Packit 5bd3a9
.IP \fIoverall_ink_return\fP 1i
Packit 5bd3a9
Returns the overall ink \*(Ov.
Packit 5bd3a9
.IP \fIoverall_logical_return\fP 1i
Packit 5bd3a9
Returns the overall logical \*(Ov.
Packit 5bd3a9
.IP \fIstring\fP 1i
Packit 5bd3a9
Specifies the character string.
Packit 5bd3a9
.SH DESCRIPTION
Packit 5bd3a9
The
Packit 5bd3a9
.ZN XmbTextPerCharExtents ,
Packit 5bd3a9
.ZN XwcTextPerCharExtents
Packit 5bd3a9
and
Packit 5bd3a9
.ZN Xutf8TextPerCharExtents
Packit 5bd3a9
functions return the text dimensions of each character of the specified text,
Packit 5bd3a9
using the fonts loaded for the specified font set.
Packit 5bd3a9
Each successive element of ink_array_return and logical_array_return
Packit 5bd3a9
is set to the successive character's drawn metrics,
Packit 5bd3a9
relative to the drawing origin of the string and one 
Packit 5bd3a9
rectangle
Packit 5bd3a9
for each character in the supplied text string.
Packit 5bd3a9
The number of elements of ink_array_return and logical_array_return
Packit 5bd3a9
that have been set is returned to num_chars_return.
Packit 5bd3a9
.LP
Packit 5bd3a9
Each element of ink_array_return is set to the bounding box 
Packit 5bd3a9
of the corresponding character's drawn foreground color.
Packit 5bd3a9
Each element of logical_array_return is set to the bounding box 
Packit 5bd3a9
that provides minimum spacing to other graphical features
Packit 5bd3a9
for the corresponding character.
Packit 5bd3a9
Other graphical features should not intersect any of the
Packit 5bd3a9
logical_array_return rectangles.
Packit 5bd3a9
.LP
Packit 5bd3a9
Note that an 
Packit 5bd3a9
.ZN XRectangle
Packit 5bd3a9
represents the effective drawing dimensions of the character,
Packit 5bd3a9
regardless of the number of font glyphs that are used to draw
Packit 5bd3a9
the character or the direction in which the character is drawn.
Packit 5bd3a9
If multiple characters map to a single character glyph,
Packit 5bd3a9
the dimensions of all the 
Packit 5bd3a9
.ZN XRectangles
Packit 5bd3a9
of those characters are the same.
Packit 5bd3a9
.LP
Packit 5bd3a9
When the 
Packit 5bd3a9
.ZN XFontSet
Packit 5bd3a9
has missing charsets, metrics for each unavailable
Packit 5bd3a9
character are taken from the default string returned by 
Packit 5bd3a9
.ZN XCreateFontSet
Packit 5bd3a9
so that the metrics represent the text as it will actually be drawn.
Packit 5bd3a9
The behavior for an invalid codepoint is undefined.
Packit 5bd3a9
.LP
Packit 5bd3a9
If the array_size is too small for the number of characters in the
Packit 5bd3a9
supplied text, the functions return zero
Packit 5bd3a9
and num_chars_return is set to the number of rectangles required.
Packit 5bd3a9
Otherwise, the functions return a nonzero value.
Packit 5bd3a9
.LP
Packit 5bd3a9
If the overall_ink_return or overall_logical_return argument is non-NULL,
Packit 5bd3a9
.ZN XmbTextPerCharExtents ,
Packit 5bd3a9
.ZN XwcTextPerCharExtents
Packit 5bd3a9
and 
Packit 5bd3a9
.ZN Xutf8TextPerCharExtents
Packit 5bd3a9
return the maximum extent of the string's metrics to overall_ink_return
Packit 5bd3a9
or overall_logical_return, as returned by 
Packit 5bd3a9
.ZN XmbTextExtents ,
Packit 5bd3a9
.ZN XwcTextExtents
Packit 5bd3a9
or 
Packit 5bd3a9
.ZN Xutf8TextExtents .
Packit 5bd3a9
.LP
Packit 5bd3a9
The function
Packit 5bd3a9
.ZN Xutf8TextPerCharExtents
Packit 5bd3a9
is an extension introduced by The XFree86 Project, Inc. in their 4.0.2
Packit 5bd3a9
release. Its presence is
Packit 5bd3a9
indicated by the macro
Packit 5bd3a9
.ZN X_HAVE_UTF8_STRING .
Packit 5bd3a9
.SH "SEE ALSO"
Packit 5bd3a9
XmbTextEscapement(__libmansuffix__),
Packit 5bd3a9
XmbTextExtents(__libmansuffix__)
Packit 5bd3a9
\fI\*(xL\fP