Git init
[external/pango1.0.git] / docs / xml / pangofc-decoder.xml
1 <refentry id="PangoFcDecoder">
2 <refmeta>
3 <refentrytitle role="top_of_page" id="PangoFcDecoder.top_of_page">PangoFcDecoder</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>PANGO Library</refmiscinfo>
6 </refmeta>
7
8 <refnamediv>
9 <refname>PangoFcDecoder</refname>
10 <refpurpose>Custom font encoding handling</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv id="PangoFcDecoder.synopsis" role="synopsis">
14 <title role="synopsis.title">Synopsis</title>
15
16 <synopsis>
17                     <link linkend="PangoFcDecoder-struct">PangoFcDecoder</link>;
18                     <link linkend="PangoFcDecoderClass">PangoFcDecoderClass</link>;
19 <link linkend="FcCharSet">FcCharSet</link> *         <link linkend="pango-fc-decoder-get-charset">pango_fc_decoder_get_charset</link>        (<link linkend="PangoFcDecoder">PangoFcDecoder</link> *decoder,
20                                                          <link linkend="PangoFcFont">PangoFcFont</link> *fcfont);
21 <link linkend="PangoGlyph">PangoGlyph</link>          <link linkend="pango-fc-decoder-get-glyph">pango_fc_decoder_get_glyph</link>          (<link linkend="PangoFcDecoder">PangoFcDecoder</link> *decoder,
22                                                          <link linkend="PangoFcFont">PangoFcFont</link> *fcfont,
23                                                          <link linkend="guint32">guint32</link> wc);
24 </synopsis>
25 </refsynopsisdiv>
26
27 <refsect1 id="PangoFcDecoder.object-hierarchy" role="object_hierarchy">
28 <title role="object_hierarchy.title">Object Hierarchy</title>
29 <synopsis>
30   <link linkend="GObject">GObject</link>
31    +----PangoFcDecoder
32 </synopsis>
33 </refsect1>
34
35
36
37
38
39
40
41
42 <refsect1 id="PangoFcDecoder.description" role="desc">
43 <title role="desc.title">Description</title>
44 <para>
45 PangoFcDecoder represents a decoder that an application provides
46 for handling a font that is encoded in a custom way.
47 </para>
48 </refsect1>
49
50 <refsect1 id="PangoFcDecoder.details" role="details">
51 <title role="details.title">Details</title>
52 <refsect2 id="PangoFcDecoder-struct" role="struct">
53 <title>PangoFcDecoder</title>
54 <indexterm zone="PangoFcDecoder-struct" role="1.6"><primary sortas="PangoFcDecoder">PangoFcDecoder</primary></indexterm><programlisting>typedef struct _PangoFcDecoder PangoFcDecoder;</programlisting>
55 <para>
56 <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link> is a virtual base class that implementations will
57 inherit from.  It's the interface that is used to define a custom
58 encoding for a font.  These objects are created in your code from a
59 function callback that was originally registered with
60 <link linkend="pango-fc-font-map-add-decoder-find-func"><function>pango_fc_font_map_add_decoder_find_func()</function></link>.  Pango requires
61 information about the supported charset for a font as well as the
62 individual character to glyph conversions.  Pango gets that
63 information via the <link linkend="get-charset"><type>get_charset</type></link> and <link linkend="get-glyph"><type>get_glyph</type></link> callbacks into your
64 object implementation.</para>
65 <para>
66 </para><para role="since">Since 1.6</para></refsect2>
67 <refsect2 id="PangoFcDecoderClass" role="struct" condition="since:1.6">
68 <title>PangoFcDecoderClass</title>
69 <indexterm zone="PangoFcDecoderClass" role="1.6"><primary sortas="PangoFcDecoderClass">PangoFcDecoderClass</primary></indexterm><programlisting>typedef struct {
70   FcCharSet  *(*get_charset) (PangoFcDecoder *decoder,
71                               PangoFcFont    *fcfont);
72   PangoGlyph  (*get_glyph)   (PangoFcDecoder *decoder,
73                               PangoFcFont    *fcfont,
74                               guint32         wc);
75 } PangoFcDecoderClass;
76 </programlisting>
77 <para>
78 Class structure for <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link>.</para>
79 <para>
80 </para><variablelist role="struct">
81 <varlistentry>
82 <term><structfield>get_charset</structfield>&#160;()</term>
83 <listitem><simpara> This returns an <link linkend="FcCharset"><type>FcCharset</type></link> given a <link linkend="PangoFcFont"><type>PangoFcFont</type></link> that
84  includes a list of supported characters in the font.  The
85  <link linkend="FcCharSet"><type>FcCharSet</type></link> that is returned should be an internal reference to your
86  code.  Pango will not free this structure.  It is important that
87  you make this callback fast because this callback is called
88  separately for each character to determine Unicode coverage.
89 </simpara></listitem>
90 </varlistentry>
91 <varlistentry>
92 <term><structfield>get_glyph</structfield>&#160;()</term>
93 <listitem><simpara> This returns a single <link linkend="PangoGlyph"><type>PangoGlyph</type></link> for a given Unicode
94  code point.
95 </simpara></listitem>
96 </varlistentry>
97 </variablelist><para role="since">Since 1.6</para></refsect2>
98 <refsect2 id="pango-fc-decoder-get-charset" role="function" condition="since:1.6">
99 <title>pango_fc_decoder_get_charset ()</title>
100 <indexterm zone="pango-fc-decoder-get-charset" role="1.6"><primary sortas="pango_fc_decoder_get_charset">pango_fc_decoder_get_charset</primary></indexterm><programlisting><link linkend="FcCharSet">FcCharSet</link> *         pango_fc_decoder_get_charset        (<link linkend="PangoFcDecoder">PangoFcDecoder</link> *decoder,
101                                                          <link linkend="PangoFcFont">PangoFcFont</link> *fcfont);</programlisting>
102 <para>
103 Generates an <link linkend="FcCharSet"><type>FcCharSet</type></link> of supported characters for the fcfont
104 given.  The returned <link linkend="FcCharSet"><type>FcCharSet</type></link> will be a reference to an
105 internal value stored by the <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link> and must not
106 be modified or freed.</para>
107 <para>
108 </para><variablelist role="params">
109 <varlistentry><term><parameter>decoder</parameter>&#160;:</term>
110 <listitem><simpara> a <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link>
111 </simpara></listitem></varlistentry>
112 <varlistentry><term><parameter>fcfont</parameter>&#160;:</term>
113 <listitem><simpara> the <link linkend="PangoFcFont"><type>PangoFcFont</type></link> to query.
114 </simpara></listitem></varlistentry>
115 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="FcCharset"><type>FcCharset</type></link> for <parameter>fcfont</parameter>; must not be modified
116   or freed.
117
118 </simpara></listitem></varlistentry>
119 </variablelist><para role="since">Since 1.6</para></refsect2>
120 <refsect2 id="pango-fc-decoder-get-glyph" role="function" condition="since:1.6">
121 <title>pango_fc_decoder_get_glyph ()</title>
122 <indexterm zone="pango-fc-decoder-get-glyph" role="1.6"><primary sortas="pango_fc_decoder_get_glyph">pango_fc_decoder_get_glyph</primary></indexterm><programlisting><link linkend="PangoGlyph">PangoGlyph</link>          pango_fc_decoder_get_glyph          (<link linkend="PangoFcDecoder">PangoFcDecoder</link> *decoder,
123                                                          <link linkend="PangoFcFont">PangoFcFont</link> *fcfont,
124                                                          <link linkend="guint32">guint32</link> wc);</programlisting>
125 <para>
126 Generates a <link linkend="PangoGlyph"><type>PangoGlyph</type></link> for the given Unicode point using the
127 custom decoder. For complex scripts where there can be multiple
128 glyphs for a single character, the decoder will return whatever
129 glyph is most convenient for it. (Usually whatever glyph is directly
130 in the fonts character map table.)</para>
131 <para>
132 </para><variablelist role="params">
133 <varlistentry><term><parameter>decoder</parameter>&#160;:</term>
134 <listitem><simpara> a <link linkend="PangoFcDecoder"><type>PangoFcDecoder</type></link>
135 </simpara></listitem></varlistentry>
136 <varlistentry><term><parameter>fcfont</parameter>&#160;:</term>
137 <listitem><simpara> a <link linkend="PangoFcFont"><type>PangoFcFont</type></link> to query.
138 </simpara></listitem></varlistentry>
139 <varlistentry><term><parameter>wc</parameter>&#160;:</term>
140 <listitem><simpara> the Unicode code point to convert to a single <link linkend="PangoGlyph"><type>PangoGlyph</type></link>.
141 </simpara></listitem></varlistentry>
142 <varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the glyph index, or 0 if the glyph isn't
143 covered by the font.
144
145 </simpara></listitem></varlistentry>
146 </variablelist><para role="since">Since 1.6</para></refsect2>
147
148 </refsect1>
149
150
151
152
153 </refentry>