<?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="PangoEngineShape">
<refmeta>
<refentrytitle role="top_of_page" id="PangoEngineShape.top_of_page">PangoEngineShape</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>PANGO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>PangoEngineShape</refname>
<refpurpose>Rendering-system dependent script engines</refpurpose>
</refnamediv>
<refsect1 id="PangoEngineShape.stability-level">
<title>Stability Level</title>
<acronym>Unstable</acronym>, unless otherwise indicated
</refsect1>

<refsect1 id="PangoEngineShape.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="PANGO-ENGINE-SHAPE-DEFINE-TYPE:CAPS">PANGO_ENGINE_SHAPE_DEFINE_TYPE</link><phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="PangoEngineShape.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="PangoEngineShape-struct">PangoEngineShape</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="PangoEngineShapeClass">PangoEngineShapeClass</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="PANGO-ENGINE-TYPE-SHAPE:CAPS">PANGO_ENGINE_TYPE_SHAPE</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="PangoEngineShape.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="PangoEngine">PangoEngine</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> PangoEngineShape
</screen>
</refsect1>


<refsect1 id="PangoEngineShape.description" role="desc">
<title role="desc.title">Description</title>
<para>The <firstterm>shape engines</firstterm> are rendering-system dependent
engines that convert character strings into glyph strings.
These engines are used in <link linkend="pango-shape"><function>pango_shape()</function></link>.</para>

</refsect1>
<refsect1 id="PangoEngineShape.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="PANGO-ENGINE-SHAPE-DEFINE-TYPE:CAPS" role="macro" condition="deprecated:1.38">
<title>PANGO_ENGINE_SHAPE_DEFINE_TYPE()</title>
<indexterm zone="PANGO-ENGINE-SHAPE-DEFINE-TYPE:CAPS" role="deprecated"><primary>PANGO_ENGINE_SHAPE_DEFINE_TYPE</primary></indexterm>
<programlisting language="C">#define             PANGO_ENGINE_SHAPE_DEFINE_TYPE(name, prefix, class_init, instance_init)</programlisting>
<warning><para><literal>PANGO_ENGINE_SHAPE_DEFINE_TYPE</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Outputs the necessary code for GObject type registration for a
<link linkend="PangoEngineShape"><type>PangoEngineShape</type></link> class defined in a module. Two static symbols
are defined.</para>
<programlisting>
 static GType <replaceable>prefix</replaceable>_type;
 static void <replaceable>prefix</replaceable>_register_type (GTypeModule module);
</programlisting>
<para>The <function><replaceable>prefix</replaceable><link linkend="register-type"><function>_register_type()</function></link></function>
function should be called in your <link linkend="script-engine-init"><function>script_engine_init()</function></link> function for
each type that your module implements, and then your <link linkend="script-engine-create"><function>script_engine_create()</function></link>
function can create instances of the object as follows:</para>
<informalexample><programlisting>
 PangoEngine *engine = g_object_new (<replaceable>prefix</replaceable>_type, NULL);
</programlisting></informalexample>
<refsect3 id="PANGO-ENGINE-SHAPE-DEFINE-TYPE.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>name</para></entry>
<entry role="parameter_description"><para>Name of the the type to register (for example:, <literal>ArabicEngineFc</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>prefix</para></entry>
<entry role="parameter_description"><para>Prefix for symbols that will be defined (for example:, <literal>arabic_engine_fc</literal></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>class_init</para></entry>
<entry role="parameter_description"><para>Class initialization function for the new type, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>instance_init</para></entry>
<entry role="parameter_description"><para>Instance initialization function for the new type, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="PangoEngineShape.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="PangoEngineShape-struct" role="struct">
<title>PangoEngineShape</title>
<indexterm zone="PangoEngineShape-struct" role="deprecated"><primary>PangoEngineShape</primary></indexterm>
<programlisting language="C">typedef struct _PangoEngineShape PangoEngineShape;</programlisting>
<warning><para><literal>PangoEngineShape</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>The <link linkend="PangoEngineShape"><type>PangoEngineShape</type></link> class is implemented by engines that
customize the rendering-system dependent part of the
Pango pipeline for a particular script or language.
A <link linkend="PangoEngineShape"><type>PangoEngineShape</type></link> implementation is then specific to both
a particular rendering system or group of rendering systems
and to a particular script. For instance, there is one
<link linkend="PangoEngineShape"><type>PangoEngineShape</type></link> implementation to handle shaping Arabic
for Fontconfig-based backends.</para>
</refsect2>
<refsect2 id="PangoEngineShapeClass" role="struct" condition="deprecated:1.38">
<title>struct PangoEngineShapeClass</title>
<indexterm zone="PangoEngineShapeClass" role="deprecated"><primary>PangoEngineShapeClass</primary></indexterm>
<programlisting language="C">struct PangoEngineShapeClass {
  void (*script_shape) (PangoEngineShape    *engine,
			PangoFont           *font,
			const char          *item_text,
			unsigned int         item_length,
			const PangoAnalysis *analysis,
			PangoGlyphString    *glyphs,
			const char          *paragraph_text,
			unsigned int         paragraph_length);
  PangoCoverageLevel (*covers)   (PangoEngineShape *engine,
				  PangoFont        *font,
				  PangoLanguage    *language,
				  gunichar          wc);
};
</programlisting>
<warning><para><literal>PangoEngineShapeClass</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>Class structure for <link linkend="PangoEngineShape"><type>PangoEngineShape</type></link></para>
<refsect3 id="PangoEngineShapeClass.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><structfield id="PangoEngineShapeClass.script-shape">script_shape</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Given a font, a piece of text, and a <link linkend="PangoAnalysis"><type>PangoAnalysis</type></link>
structure, converts characters to glyphs and positions the
resulting glyphs. The results are stored in the <link linkend="PangoGlyphString"><type>PangoGlyphString</type></link>
that is passed in. (The implementation should resize it
appropriately using <link linkend="pango-glyph-string-set-size"><function>pango_glyph_string_set_size()</function></link>). All fields
of the <parameter>log_clusters</parameter>
and <parameter>glyphs</parameter>
array must be filled in, with
the exception that Pango will automatically generate
<literal>glyphs->glyphs[i].attr.is_cluster_start</literal>
using the <parameter>log_clusters</parameter>
array. Each input character must occur in one
of the output logical clusters;
if no rendering is desired for a character, this may involve
inserting glyphs with the <link linkend="PangoGlyph"><type>PangoGlyph</type></link> ID <link linkend="PANGO-GLYPH-EMPTY:CAPS"><type>PANGO_GLYPH_EMPTY</type></link>, which
is guaranteed never to render. If the shaping fails for any reason,
the shaper should return with an empty (zero-size) glyph string.
If the shaper has not set the size on the glyph string yet, simply
returning signals the failure too.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="PangoEngineShapeClass.covers">covers</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Returns the characters that this engine can cover
with a given font for a given language. If not overridden, the default
implementation simply returns the coverage information for the
font itself unmodified.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="PANGO-ENGINE-TYPE-SHAPE:CAPS" role="macro" condition="deprecated:1.38">
<title>PANGO_ENGINE_TYPE_SHAPE</title>
<indexterm zone="PANGO-ENGINE-TYPE-SHAPE:CAPS" role="deprecated"><primary>PANGO_ENGINE_TYPE_SHAPE</primary></indexterm>
<programlisting language="C">#define PANGO_ENGINE_TYPE_SHAPE "PangoEngineShape"
</programlisting>
<warning><para><literal>PANGO_ENGINE_TYPE_SHAPE</literal> has been deprecated since version 1.38 and should not be used in newly-written code.</para></warning>
<para>A string constant defining the engine type for shaping engines.
These engines derive from <link linkend="PangoEngineShape"><type>PangoEngineShape</type></link>.</para>
</refsect2>

</refsect1>

</refentry>
