<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xmbtextman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->
<!--  Copyright \(co 2000  The XFree86 Project, Inc. -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->

<!--  $XFree86: xc/doc/man/X11/XmbTExt.man,v 1.5 2003/04/28 22:17:58 herrb Exp $ -->
<!--   -->
<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XmbTextExtents</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XmbTextExtents</refname>
<refname>XwcTextExtents</refname>
<refname>Xutf8TextExtents</refname>
<refpurpose>compute text extents</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>int XmbTextExtents&hairsp;(&hairsp;XFontSet <emphasis remap='I'>font_set</emphasis>&hairsp;, char *<emphasis remap='I'>string</emphasis>&hairsp;, int
<emphasis remap='I'>num_bytes</emphasis>&hairsp;, XRectangle *<emphasis remap='I'>overall_ink_return</emphasis>&hairsp;, XRectangle
*<emphasis remap='I'>overall_logical_return</emphasis>&hairsp;);</para> 

<para>int XwcTextExtents&hairsp;(&hairsp;XFontSet <emphasis remap='I'>font_set</emphasis>&hairsp;, wchar_t *<emphasis remap='I'>string</emphasis>&hairsp;, int
<emphasis remap='I'>num_wchars</emphasis>&hairsp;, XRectangle *<emphasis remap='I'>overall_ink_return</emphasis>&hairsp;, XRectangle
*<emphasis remap='I'>overall_logical_return</emphasis>&hairsp;);</para> 

<para>int Xutf8TextExtents&hairsp;(&hairsp;XFontSet <emphasis remap='I'>font_set</emphasis>&hairsp;, char *<emphasis remap='I'>string</emphasis>&hairsp;, int
<emphasis remap='I'>num_bytes</emphasis>&hairsp;, XRectangle *<emphasis remap='I'>overall_ink_return</emphasis>&hairsp;, XRectangle
*<emphasis remap='I'>overall_logical_return</emphasis>&hairsp;);</para>
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>font_set</emphasis></term>
  <listitem>
<para>Specifies the font set.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>num_bytes</emphasis></term>
  <listitem>
<para>Specifies the number of bytes in the string argument.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>num_wchars</emphasis></term>
  <listitem>
<para>Specifies the number of characters in the string argument.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>overall_ink_return</emphasis></term>
  <listitem>
<para>Returns the overall ink dimensions.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>overall_logical_return</emphasis></term>
  <listitem>
<para>Returns the overall logical dimensions.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>string</emphasis></term>
  <listitem>
<para>Specifies the character string.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XmbTextExtents&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;XwcTextExtents&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;Xutf8TextExtents&hairsp;</emphasis>
functions set the components of the specified overall_ink_return and
overall_logical_return
arguments to the overall bounding box of the string's image
and a logical bounding box for spacing purposes, respectively.
They return the value returned by 
<emphasis remap='I'>&hairsp;XmbTextEscapement&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;XwcTextEscapement&hairsp;</emphasis>
or
<emphasis remap='I'>&hairsp;Xutf8TextEscapement&hairsp;</emphasis>.
These metrics are relative to the drawing origin of the string,
using the fonts loaded for the specified font set.</para>

<para>If the overall_ink_return argument is non-NULL,
it is set to the bounding box of the string's character ink.
The overall_ink_return for a nondescending, horizontally drawn
Latin character is conventionally entirely above the baseline;
that is, overall_ink_return.height &lt;= -overall_ink_return.y.
The overall_ink_return for a nonkerned character
is entirely at, and to the right of, the origin;
that is, overall_ink_return.x &gt;= 0.
A character consisting of a single pixel at the origin would set
overall_ink_return fields y = 0, x = 0, width = 1, and height = 1.</para>

<para>If the overall_logical_return argument is non-NULL,
it is set to the bounding box that provides minimum spacing
to other graphical features for the string.
Other graphical features, for example, a border surrounding the text,
should not intersect this rectangle.</para>

<para>When the 
<emphasis remap='I'>&hairsp;XFontSet&hairsp;</emphasis>
has missing charsets,
metrics for each unavailable character are taken 
from the default string returned by 
<emphasis remap='I'>&hairsp;XCreateFontSet&hairsp;</emphasis>
so that the metrics represent the text as it will actually be drawn.
The behavior for an invalid codepoint is undefined.</para>

<para>The function
<emphasis remap='I'>&hairsp;Xutf8TextExtents&hairsp;</emphasis>
is an XFree86 extension introduced in XFree86 4.0.2. Its presence is
indicated by the macro
<emphasis remap='I'>&hairsp;X_HAVE_UTF8_STRING&hairsp;</emphasis>.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XmbTextEscapement(3X11),
XmbTextPerCharExtents(3X11)
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

