<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="pango-Miscellaneous-Utilities">
<refmeta>
<refentrytitle role="top_of_page" id="pango-Miscellaneous-Utilities.top_of_page">Miscellaneous Utilities</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PANGO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Miscellaneous Utilities</refname>
<refpurpose>Various convenience and utility functions</refpurpose>
</refnamediv>

<refsect1 id="pango-Miscellaneous-Utilities.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;**
</entry><entry role="function_name"><link linkend="pango-split-file-list">pango_split_file_list</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="pango-trim-string">pango_trim_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint"><returnvalue>gint</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-read-line">pango_read_line</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-skip-space">pango_skip_space</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-scan-word">pango_scan_word</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-scan-string">pango_scan_string</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-scan-int">pango_scan_int</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-parse-enum">pango_parse_enum</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-parse-style">pango_parse_style</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-parse-variant">pango_parse_variant</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-parse-weight">pango_parse_weight</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-parse-stretch">pango_parse_stretch</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="pango-log2vis-get-embedding-levels">pango_log2vis_get_embedding_levels</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-is-zero-width">pango_is_zero_width</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="pango-quantize-line-geometry">pango_quantize_line_geometry</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="pango-Miscellaneous-Utilities.description" role="desc">
<title role="desc.title">Description</title>
<para>The functions and utilities in this section are mostly used from Pango
backends and modules, but may be useful for other purposes too.</para>

</refsect1>
<refsect1 id="pango-Miscellaneous-Utilities.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="pango-split-file-list" role="function" condition="deprecated:1.38">
<title>pango_split_file_list&#160;()</title>
<indexterm zone="pango-split-file-list" role="deprecated"><primary>pango_split_file_list</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;**
pango_split_file_list (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<warning><para><literal>pango_split_file_list</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Splits a <link linkend="G-SEARCHPATH-SEPARATOR:CAPS"><literal>G_SEARCHPATH_SEPARATOR</literal></link>-separated list of files, stripping
white space and substituting ~/ with $HOME/.</para>
<refsect3 id="pango-split-file-list.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a <link linkend="G-SEARCHPATH-SEPARATOR:CAPS"><literal>G_SEARCHPATH_SEPARATOR</literal></link> separated list of filenames</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-split-file-list.returns" role="returns">
<title>Returns</title>
<para>a list of
strings to be freed with <link linkend="g-strfreev"><function>g_strfreev()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>array</acronym> zero-terminated=1]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="pango-trim-string" role="function" condition="deprecated:1.38">
<title>pango_trim_string&#160;()</title>
<indexterm zone="pango-trim-string" role="deprecated"><primary>pango_trim_string</primary></indexterm>
<programlisting language="C"><link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
pango_trim_string (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<warning><para><literal>pango_trim_string</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Trims leading and trailing whitespace from a string.</para>
<refsect3 id="pango-trim-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a string</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-trim-string.returns" role="returns">
<title>Returns</title>
<para> A newly-allocated string that must be freed with <link linkend="g-free"><function>g_free()</function></link></para>
</refsect3></refsect2>
<refsect2 id="pango-read-line" role="function" condition="deprecated:1.38">
<title>pango_read_line&#160;()</title>
<indexterm zone="pango-read-line" role="deprecated"><primary>pango_read_line</primary></indexterm>
<programlisting language="C"><link linkend="gint"><returnvalue>gint</returnvalue></link>
pango_read_line (<parameter><link linkend="FILE:CAPS"><type>FILE</type></link> *stream</parameter>,
                 <parameter><link linkend="GString"><type>GString</type></link> *str</parameter>);</programlisting>
<warning><para><literal>pango_read_line</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Reads an entire line from a file into a buffer. Lines may
be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter
is not written into the buffer. Text after a '#' character is treated as
a comment and skipped. '\' can be used to escape a # character.
'\' proceeding a line delimiter combines adjacent lines. A '\' proceeding
any other character is ignored and written into the output buffer
unmodified.</para>
<refsect3 id="pango-read-line.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>stream</para></entry>
<entry role="parameter_description"><para>a stdio stream</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para><link linkend="GString"><type>GString</type></link> buffer into which to write the result</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-read-line.returns" role="returns">
<title>Returns</title>
<para> 0 if the stream was already at an <link linkend="EOF:CAPS"><literal>EOF</literal></link> character, otherwise
the number of lines read (this is useful for maintaining
a line number counter which doesn't combine lines with '\')</para>
</refsect3></refsect2>
<refsect2 id="pango-skip-space" role="function" condition="deprecated:1.38">
<title>pango_skip_space&#160;()</title>
<indexterm zone="pango-skip-space" role="deprecated"><primary>pango_skip_space</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_skip_space (<parameter>const <link linkend="char"><type>char</type></link> **pos</parameter>);</programlisting>
<warning><para><literal>pango_skip_space</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Skips 0 or more characters of white space.</para>
<refsect3 id="pango-skip-space.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pos</para></entry>
<entry role="parameter_description"><para>in/out string position. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-skip-space.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if skipping the white space leaves
the position at a '\0' character.</para>
</refsect3></refsect2>
<refsect2 id="pango-scan-word" role="function" condition="deprecated:1.38">
<title>pango_scan_word&#160;()</title>
<indexterm zone="pango-scan-word" role="deprecated"><primary>pango_scan_word</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_scan_word (<parameter>const <link linkend="char"><type>char</type></link> **pos</parameter>,
                 <parameter><link linkend="GString"><type>GString</type></link> *out</parameter>);</programlisting>
<warning><para><literal>pango_scan_word</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Scans a word into a <link linkend="GString"><type>GString</type></link> buffer. A word consists
of [A-Za-z_] followed by zero or more [A-Za-z_0-9]
Leading white space is skipped.</para>
<refsect3 id="pango-scan-word.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pos</para></entry>
<entry role="parameter_description"><para>in/out string position. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>out</para></entry>
<entry role="parameter_description"><para>a <link linkend="GString"><type>GString</type></link> into which to write the result</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-scan-word.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if a parse error occurred.</para>
</refsect3></refsect2>
<refsect2 id="pango-scan-string" role="function" condition="deprecated:1.38">
<title>pango_scan_string&#160;()</title>
<indexterm zone="pango-scan-string" role="deprecated"><primary>pango_scan_string</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_scan_string (<parameter>const <link linkend="char"><type>char</type></link> **pos</parameter>,
                   <parameter><link linkend="GString"><type>GString</type></link> *out</parameter>);</programlisting>
<warning><para><literal>pango_scan_string</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Scans a string into a <link linkend="GString"><type>GString</type></link> buffer. The string may either
be a sequence of non-white-space characters, or a quoted
string with '"'. Instead a quoted string, '\"' represents
a literal quote. Leading white space outside of quotes is skipped.</para>
<refsect3 id="pango-scan-string.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pos</para></entry>
<entry role="parameter_description"><para>in/out string position. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>out</para></entry>
<entry role="parameter_description"><para>a <link linkend="GString"><type>GString</type></link> into which to write the result</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-scan-string.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if a parse error occurred.</para>
</refsect3></refsect2>
<refsect2 id="pango-scan-int" role="function" condition="deprecated:1.38">
<title>pango_scan_int&#160;()</title>
<indexterm zone="pango-scan-int" role="deprecated"><primary>pango_scan_int</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_scan_int (<parameter>const <link linkend="char"><type>char</type></link> **pos</parameter>,
                <parameter><link linkend="int"><type>int</type></link> *out</parameter>);</programlisting>
<warning><para><literal>pango_scan_int</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Scans an integer.
Leading white space is skipped.</para>
<refsect3 id="pango-scan-int.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pos</para></entry>
<entry role="parameter_description"><para>in/out string position. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>out</para></entry>
<entry role="parameter_description"><para>an int into which to write the result. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-scan-int.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if a parse error occurred.</para>
</refsect3></refsect2>
<refsect2 id="pango-parse-enum" role="function" condition="deprecated:1.38|since:1.16">
<title>pango_parse_enum&#160;()</title>
<indexterm zone="pango-parse-enum" role="deprecated"><primary>pango_parse_enum</primary></indexterm><indexterm zone="pango-parse-enum" role="1.16"><primary>pango_parse_enum</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_parse_enum (<parameter><link linkend="GType"><type>GType</type></link> type</parameter>,
                  <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                  <parameter><link linkend="int"><type>int</type></link> *value</parameter>,
                  <parameter><link linkend="gboolean"><type>gboolean</type></link> warn</parameter>,
                  <parameter><link linkend="char"><type>char</type></link> **possible_values</parameter>);</programlisting>
<warning><para><literal>pango_parse_enum</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Parses an enum type and stores the result in <parameter>value</parameter>
.</para>
<para>If <parameter>str</parameter>
 does not match the nick name of any of the possible values for the
enum and is not an integer, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> is returned, a warning is issued
if <parameter>warn</parameter>
 is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, and a
string representing the list of possible values is stored in
<parameter>possible_values</parameter>
.  The list is slash-separated, eg.
"none/start/middle/end".  If failed and <parameter>possible_values</parameter>
 is not <link linkend="NULL:CAPS"><literal>NULL</literal></link>,
returned string should be freed using <link linkend="g-free"><function>g_free()</function></link>.</para>
<refsect3 id="pango-parse-enum.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>type</para></entry>
<entry role="parameter_description"><para>enum type to parse, eg. <link linkend="PANGO-TYPE-ELLIPSIZE-MODE:CAPS"><literal>PANGO_TYPE_ELLIPSIZE_MODE</literal></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>string to parse.  May be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>integer to store the result in, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>warn</para></entry>
<entry role="parameter_description"><para>if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, issue a <link linkend="g-warning"><function>g_warning()</function></link> on bad input.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>possible_values</para></entry>
<entry role="parameter_description"><para>place to store list of possible values on failure, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-parse-enum.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>str</parameter>
was successfully parsed.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.16">1.16</link></para></refsect2>
<refsect2 id="pango-parse-style" role="function">
<title>pango_parse_style&#160;()</title>
<indexterm zone="pango-parse-style"><primary>pango_parse_style</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_parse_style (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                   <parameter><link linkend="PangoStyle"><type>PangoStyle</type></link> *style</parameter>,
                   <parameter><link linkend="gboolean"><type>gboolean</type></link> warn</parameter>);</programlisting>
<para>Parses a font style. The allowed values are "normal",
"italic" and "oblique", case variations being
ignored.</para>
<refsect3 id="pango-parse-style.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a string to parse.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>style</para></entry>
<entry role="parameter_description"><para>a <link linkend="PangoStyle"><type>PangoStyle</type></link> to store the result
in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>warn</para></entry>
<entry role="parameter_description"><para>if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, issue a <link linkend="g-warning"><function>g_warning()</function></link> on bad input.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-parse-style.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>str</parameter>
was successfully parsed.</para>
</refsect3></refsect2>
<refsect2 id="pango-parse-variant" role="function">
<title>pango_parse_variant&#160;()</title>
<indexterm zone="pango-parse-variant"><primary>pango_parse_variant</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_parse_variant (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                     <parameter><link linkend="PangoVariant"><type>PangoVariant</type></link> *variant</parameter>,
                     <parameter><link linkend="gboolean"><type>gboolean</type></link> warn</parameter>);</programlisting>
<para>Parses a font variant. The allowed values are "normal"
and "smallcaps" or "small_caps", case variations being
ignored.</para>
<refsect3 id="pango-parse-variant.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a string to parse.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>variant</para></entry>
<entry role="parameter_description"><para>a <link linkend="PangoVariant"><type>PangoVariant</type></link> to store the
result in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>warn</para></entry>
<entry role="parameter_description"><para>if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, issue a <link linkend="g-warning"><function>g_warning()</function></link> on bad input.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-parse-variant.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>str</parameter>
was successfully parsed.</para>
</refsect3></refsect2>
<refsect2 id="pango-parse-weight" role="function">
<title>pango_parse_weight&#160;()</title>
<indexterm zone="pango-parse-weight"><primary>pango_parse_weight</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_parse_weight (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                    <parameter><link linkend="PangoWeight"><type>PangoWeight</type></link> *weight</parameter>,
                    <parameter><link linkend="gboolean"><type>gboolean</type></link> warn</parameter>);</programlisting>
<para>Parses a font weight. The allowed values are "heavy",
"ultrabold", "bold", "normal", "light", "ultraleight"
and integers. Case variations are ignored.</para>
<refsect3 id="pango-parse-weight.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a string to parse.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>weight</para></entry>
<entry role="parameter_description"><para>a <link linkend="PangoWeight"><type>PangoWeight</type></link> to store the result
in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>warn</para></entry>
<entry role="parameter_description"><para>if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, issue a <link linkend="g-warning"><function>g_warning()</function></link> on bad input.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-parse-weight.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>str</parameter>
was successfully parsed.</para>
</refsect3></refsect2>
<refsect2 id="pango-parse-stretch" role="function">
<title>pango_parse_stretch&#160;()</title>
<indexterm zone="pango-parse-stretch"><primary>pango_parse_stretch</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_parse_stretch (<parameter>const <link linkend="char"><type>char</type></link> *str</parameter>,
                     <parameter><link linkend="PangoStretch"><type>PangoStretch</type></link> *stretch</parameter>,
                     <parameter><link linkend="gboolean"><type>gboolean</type></link> warn</parameter>);</programlisting>
<para>Parses a font stretch. The allowed values are
"ultra_condensed", "extra_condensed", "condensed",
"semi_condensed", "normal", "semi_expanded", "expanded",
"extra_expanded" and "ultra_expanded". Case variations are
ignored and the '_' characters may be omitted.</para>
<refsect3 id="pango-parse-stretch.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>str</para></entry>
<entry role="parameter_description"><para>a string to parse.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>stretch</para></entry>
<entry role="parameter_description"><para>a <link linkend="PangoStretch"><type>PangoStretch</type></link> to store the
result in. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>warn</para></entry>
<entry role="parameter_description"><para>if <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, issue a <link linkend="g-warning"><function>g_warning()</function></link> on bad input.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-parse-stretch.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>str</parameter>
was successfully parsed.</para>
</refsect3></refsect2>
<refsect2 id="pango-log2vis-get-embedding-levels" role="function" condition="since:1.4">
<title>pango_log2vis_get_embedding_levels&#160;()</title>
<indexterm zone="pango-log2vis-get-embedding-levels" role="1.4"><primary>pango_log2vis_get_embedding_levels</primary></indexterm>
<programlisting language="C"><link linkend="guint8"><returnvalue>guint8</returnvalue></link>&#160;*
pango_log2vis_get_embedding_levels (<parameter>const <link linkend="gchar"><type>gchar</type></link> *text</parameter>,
                                    <parameter><link linkend="int"><type>int</type></link> length</parameter>,
                                    <parameter><link linkend="PangoDirection"><type>PangoDirection</type></link> *pbase_dir</parameter>);</programlisting>
<para>This will return the bidirectional embedding levels of the input paragraph
as defined by the Unicode Bidirectional Algorithm available at:</para>
<para>  http://www.unicode.org/reports/tr9/</para>
<para>If the input base direction is a weak direction, the direction of the
characters in the text will determine the final resolved direction.</para>
<refsect3 id="pango-log2vis-get-embedding-levels.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>text</para></entry>
<entry role="parameter_description"><para>the text to itemize.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>length</para></entry>
<entry role="parameter_description"><para>the number of bytes (not characters) to process, or -1
if <parameter>text</parameter>
is nul-terminated and the length should be calculated.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pbase_dir</para></entry>
<entry role="parameter_description"><para>input base direction, and output resolved direction.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-log2vis-get-embedding-levels.returns" role="returns">
<title>Returns</title>
<para> a newly allocated array of embedding levels, one item per
character (not byte), that should be freed using g_free.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>
<refsect2 id="pango-is-zero-width" role="function" condition="since:1.10">
<title>pango_is_zero_width&#160;()</title>
<indexterm zone="pango-is-zero-width" role="1.10"><primary>pango_is_zero_width</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
pango_is_zero_width (<parameter><link linkend="gunichar"><type>gunichar</type></link> ch</parameter>);</programlisting>
<para>Checks <parameter>ch</parameter>
 to see if it is a character that should not be
normally rendered on the screen.  This includes all Unicode characters
with "ZERO WIDTH" in their name, as well as <firstterm>bidi</firstterm> formatting characters, and
a few other ones.  This is totally different from <link linkend="g-unichar-iszerowidth"><function>g_unichar_iszerowidth()</function></link>
and is at best misnamed.</para>
<refsect3 id="pango-is-zero-width.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>ch</para></entry>
<entry role="parameter_description"><para>a Unicode character</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="pango-is-zero-width.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>ch</parameter>
is a zero-width character, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.10">1.10</link></para></refsect2>
<refsect2 id="pango-quantize-line-geometry" role="function" condition="since:1.12">
<title>pango_quantize_line_geometry&#160;()</title>
<indexterm zone="pango-quantize-line-geometry" role="1.12"><primary>pango_quantize_line_geometry</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
pango_quantize_line_geometry (<parameter><link linkend="int"><type>int</type></link> *thickness</parameter>,
                              <parameter><link linkend="int"><type>int</type></link> *position</parameter>);</programlisting>
<para>Quantizes the thickness and position of a line, typically an
underline or strikethrough, to whole device pixels, that is integer
multiples of <link linkend="PANGO-SCALE:CAPS"><literal>PANGO_SCALE</literal></link>. The purpose of this function is to avoid
such lines looking blurry.</para>
<para>Care is taken to make sure <parameter>thickness</parameter>
 is at least one pixel when this
function returns, but returned <parameter>position</parameter>
 may become zero as a result
of rounding.</para>
<refsect3 id="pango-quantize-line-geometry.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>thickness</para></entry>
<entry role="parameter_description"><para>pointer to the thickness of a line, in Pango units. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>position</para></entry>
<entry role="parameter_description"><para>corresponding position. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>inout</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.12">1.12</link></para></refsect2>

</refsect1>

</refentry>
