<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-pangoglyphstring">
  <refnamediv>
    <refname>pango.GlyphString</refname>
    <refpurpose>an object holding strings of glyphs and glyph
information.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>pango.GlyphString</classname></ooclass>
      <ooclass><classname>gobject.GBoxed</classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-pangoglyphstring">pango.GlyphString</link></methodname>
	<methodparam></methodparam>  </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--set-size">set_size</link></methodname>
	<methodparam><parameter
		       role="keyword">new_len</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--copy">copy</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--extents">extents</link></methodname>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--extents-range">extents_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start</parameter></methodparam>
	<methodparam><parameter role="keyword">end</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">font</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-pangoglyphstring--get-logical-widths">get_logical_widths</link></methodname>
	<methodparam><parameter
		       role="keyword">text</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">embedding_level</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"num_glyphs"</entry>
	      <entry>Read</entry>
	      <entry>The number of glyphs in the glyph string.</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
object contains strings of glyphs with geometry and visual attribute
information.</para>

  </refsect1>

  <refsect1 id="constructor-pangoglyphstring">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>pango.GlyphString</methodname>
	<methodparam></methodparam>  </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
containing no glyphs.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

  <refsect2 id="method-pangoglyphstring--set-size">
      <title>pango.GlyphString.set_size</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_size</methodname>
	  <methodparam><parameter
			 role="keyword">new_len</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">new_len</parameter>&nbsp;:</term>
	  <listitem><simpara>the new length of the
string.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_size</methodname>() method resizes the glyph
string to the length specified by <parameter>new_len</parameter>.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--copy">
      <title>pango.GlyphString.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method returns a <link
linkend="class-pangoglyphstring"><classname>pango.GlyphString</classname></link> 
that is a copy of the glyph string.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--extents">
      <title>pango.GlyphString.extents</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>extents</methodname>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangofont"><classname>pango.Font</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing two 4-tuples representing
the ink and logical extents rectangles of the glyph
string.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>extents</methodname>() method returns a 2-tuple
containing two 4-tuples representing the logical and ink extents rectangles
of the glyph string as rendered in the <link
linkend="class-pangofont"><classname>pango.Font</classname></link> specified
by <parameter>font</parameter>. See the <link
linkend="method-pangofont--get-glyph-extents"><methodname>pango.Font.get_glyph_extents</methodname>()</link> 
for details about the interpretation of the rectangles.</para>

    </refsect2>

    <refsect2 id="method-pangoglyphstring--extents-range">
      <title>pango.GlyphString.extents_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>extents_range</methodname>
	  <methodparam><parameter
			 role="keyword">start</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">end</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">font</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">start</parameter>&nbsp;:</term>
	  <listitem><simpara>start index</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">end</parameter>&nbsp;:</term>
	  <listitem><simpara>end index</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">font</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-pangofont"><classname>pango.Font</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing two 4-tuples representing
the ink and logical extents rectangles of the glyph string
range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>extents_range</methodname>() method returns a
2-tuple containing two 4-tuples representing the logical and ink extents
rectangles of a range (specified by <parameter>start</parameter> and
<parameter>end</parameter>) of the glyph string as rendered in the <link
linkend="class-pangofont"><classname>pango.Font</classname></link> specified
by <parameter>font</parameter>. The extents are relative to the start of the
glyph string range (the origin of their coordinate system is at the start of
the range, not at the start of the entire glyph string).</para>

    </refsect2>

  <refsect2 id="method-pangoglyphstring--get-logical-widths">
      <title>pango.GlyphString.get_logical_widths</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_logical_widths</methodname>
	  <methodparam><parameter
			 role="keyword">text</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">embedding_level</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">text</parameter>&nbsp;:</term>
	  <listitem><simpara>the text corresponding to the
glyphs</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">embedding_level</parameter>&nbsp;:</term>
	  <listitem><simpara>the embedding level of the
string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list containing the calculated character
widths.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_logical_widths</methodname>() method returns
a list of the screen width of the characters in the specified
<parameter>text</parameter> that corresponds to the glyph string. When
multiple characters compose a single cluster, the width of the entire
cluster is divided equally among the characters.</para>

    </refsect2>

  </refsect1>

</refentry>
