diff options
Diffstat (limited to 'libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml')
-rw-r--r-- | libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml | 925 |
1 files changed, 0 insertions, 925 deletions
diff --git a/libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml b/libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml deleted file mode 100644 index 3be82a2..0000000 --- a/libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml +++ /dev/null @@ -1,925 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ -<!ENTITY version SYSTEM "version.xml"> -]> -<refentry id="cairo-cairo-scaled-font-t"> -<refmeta> -<refentrytitle role="top_of_page" id="cairo-cairo-scaled-font-t.top_of_page">cairo_scaled_font_t</refentrytitle> -<manvolnum>3</manvolnum> -<refmiscinfo>CAIRO Library</refmiscinfo> -</refmeta> -<refnamediv> -<refname>cairo_scaled_font_t</refname> -<refpurpose>Font face at particular size and options</refpurpose> -</refnamediv> - -<refsect1 id="cairo-cairo-scaled-font-t.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="function_type"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link> * -</entry><entry role="function_name"><link linkend="cairo-scaled-font-create">cairo_scaled_font_create</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link> * -</entry><entry role="function_name"><link linkend="cairo-scaled-font-reference">cairo_scaled_font_reference</link> <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="cairo-scaled-font-destroy">cairo_scaled_font_destroy</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -</entry><entry role="function_name"><link linkend="cairo-scaled-font-status">cairo_scaled_font_status</link> <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="cairo-scaled-font-extents">cairo_scaled_font_extents</link> <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="cairo-scaled-font-text-extents">cairo_scaled_font_text_extents</link> <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="cairo-scaled-font-glyph-extents">cairo_scaled_font_glyph_extents</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -</entry><entry role="function_name"><link linkend="cairo-scaled-font-text-to-glyphs">cairo_scaled_font_text_to_glyphs</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-font-face-t"><returnvalue>cairo_font_face_t</returnvalue></link> * -</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-font-face">cairo_scaled_font_get_font_face</link> <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="cairo-scaled-font-get-font-options">cairo_scaled_font_get_font_options</link> <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="cairo-scaled-font-get-font-matrix">cairo_scaled_font_get_font_matrix</link> <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="cairo-scaled-font-get-ctm">cairo_scaled_font_get_ctm</link> <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="cairo-scaled-font-get-scale-matrix">cairo_scaled_font_get_scale_matrix</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-font-type-t"><returnvalue>cairo_font_type_t</returnvalue></link> -</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-type">cairo_scaled_font_get_type</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type">unsigned <link linkend="int"><returnvalue>int</returnvalue></link> -</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-reference-count">cairo_scaled_font_get_reference_count</link> <phrase role="c_punctuation">()</phrase></entry></row> -<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -</entry><entry role="function_name"><link linkend="cairo-scaled-font-set-user-data">cairo_scaled_font_set_user_data</link> <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="cairo-scaled-font-get-user-data">cairo_scaled_font_get_user_data</link> <phrase role="c_punctuation">()</phrase></entry></row> - -</tbody> -</tgroup> -</informaltable> -</refsect1> -<refsect1 id="cairo-cairo-scaled-font-t.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="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link></entry></row> -<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="cairo-font-extents-t">cairo_font_extents_t</link></entry></row> -<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="cairo-text-extents-t">cairo_text_extents_t</link></entry></row> - -</tbody> -</tgroup> -</informaltable> -</refsect1> - - -<refsect1 id="cairo-cairo-scaled-font-t.description" role="desc"> -<title role="desc.title">Description</title> -<para><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> represents a realization of a font face at a particular -size and transformation and a certain set of font options.</para> - -</refsect1> -<refsect1 id="cairo-cairo-scaled-font-t.functions_details" role="details"> -<title role="details.title">Functions</title> -<refsect2 id="cairo-scaled-font-create" role="function" condition="since:1.0"> -<title>cairo_scaled_font_create ()</title> -<indexterm zone="cairo-scaled-font-create" role="1.0"><primary sortas="scaled_font_create">cairo_scaled_font_create</primary></indexterm> -<programlisting language="C"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link> * -cairo_scaled_font_create (<parameter><link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> *font_face</parameter>, - <parameter>const <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *font_matrix</parameter>, - <parameter>const <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *ctm</parameter>, - <parameter>const <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link> *options</parameter>);</programlisting> -<para>Creates a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> object from a font face and matrices that -describe the size of the font and the environment in which it will -be used.</para> -<refsect3 id="cairo-scaled-font-create.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>font_face</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>font_matrix</para></entry> -<entry role="parameter_description"><para>font space to user space transformation matrix for the -font. In the simplest case of a N point font, this matrix is -just a scale by N, but it can also be used to shear the font -or stretch it unequally along the two axes. See -<link linkend="cairo-set-font-matrix"><function>cairo_set_font_matrix()</function></link>.</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>ctm</para></entry> -<entry role="parameter_description"><para>user to device transformation matrix with which the font will -be used.</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>options</para></entry> -<entry role="parameter_description"><para>options to use when getting metrics for the font and -rendering with it.</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-create.returns" role="returns"> -<title>Returns</title> -<para> a newly created <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>. Destroy with -<link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link></para> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-reference" role="function" condition="since:1.0"> -<title>cairo_scaled_font_reference ()</title> -<indexterm zone="cairo-scaled-font-reference" role="1.0"><primary sortas="scaled_font_reference">cairo_scaled_font_reference</primary></indexterm> -<programlisting language="C"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link> * -cairo_scaled_font_reference (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>Increases the reference count on <parameter>scaled_font</parameter> - by one. This prevents -<parameter>scaled_font</parameter> - from being destroyed until a matching call to -<link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link> is made.</para> -<para>Use <link linkend="cairo-scaled-font-get-reference-count"><function>cairo_scaled_font_get_reference_count()</function></link> to get the number of -references to a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>.</para> -<refsect3 id="cairo-scaled-font-reference.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>, (may be <link linkend="NULL:CAPS"><literal>NULL</literal></link> in which case -this function does nothing)</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-reference.returns" role="returns"> -<title>Returns</title> -<para> the referenced <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-destroy" role="function" condition="since:1.0"> -<title>cairo_scaled_font_destroy ()</title> -<indexterm zone="cairo-scaled-font-destroy" role="1.0"><primary sortas="scaled_font_destroy">cairo_scaled_font_destroy</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_destroy (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>Decreases the reference count on <parameter>font</parameter> - by one. If the result -is zero, then <parameter>font</parameter> - and all associated resources are freed. -See <link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link>.</para> -<refsect3 id="cairo-scaled-font-destroy.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-status" role="function" condition="since:1.0"> -<title>cairo_scaled_font_status ()</title> -<indexterm zone="cairo-scaled-font-status" role="1.0"><primary sortas="scaled_font_status">cairo_scaled_font_status</primary></indexterm> -<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -cairo_scaled_font_status (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>Checks whether an error has previously occurred for this -scaled_font.</para> -<refsect3 id="cairo-scaled-font-status.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-status.returns" role="returns"> -<title>Returns</title> -<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or another error such as -<link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link>.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-extents" role="function" condition="since:1.0"> -<title>cairo_scaled_font_extents ()</title> -<indexterm zone="cairo-scaled-font-extents" role="1.0"><primary sortas="scaled_font_extents">cairo_scaled_font_extents</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> *extents</parameter>);</programlisting> -<para>Gets the metrics for a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>.</para> -<refsect3 id="cairo-scaled-font-extents.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>extents</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> which to store the retrieved extents.</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-text-extents" role="function" condition="since:1.2"> -<title>cairo_scaled_font_text_extents ()</title> -<indexterm zone="cairo-scaled-font-text-extents" role="1.2"><primary sortas="scaled_font_text_extents">cairo_scaled_font_text_extents</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_text_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter>const <link linkend="char"><type>char</type></link> *utf8</parameter>, - <parameter><link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> *extents</parameter>);</programlisting> -<para>Gets the extents for a string of text. The extents describe a -user-space rectangle that encloses the "inked" portion of the text -drawn at the origin (0,0) (as it would be drawn by <link linkend="cairo-show-text"><function>cairo_show_text()</function></link> -if the cairo graphics state were set to the same font_face, -font_matrix, ctm, and font_options as <parameter>scaled_font</parameter> -). Additionally, -the x_advance and y_advance values indicate the amount by which the -current point would be advanced by <link linkend="cairo-show-text"><function>cairo_show_text()</function></link>.</para> -<para>Note that whitespace characters do not directly contribute to the -size of the rectangle (extents.width and extents.height). They do -contribute indirectly by changing the position of non-whitespace -characters. In particular, trailing whitespace characters are -likely to not affect the size of the rectangle, though they will -affect the x_advance and y_advance values.</para> -<refsect3 id="cairo-scaled-font-text-extents.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>utf8</para></entry> -<entry role="parameter_description"><para>a NUL-terminated string of text, encoded in UTF-8</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>extents</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> which to store the retrieved extents.</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-glyph-extents" role="function" condition="since:1.0"> -<title>cairo_scaled_font_glyph_extents ()</title> -<indexterm zone="cairo-scaled-font-glyph-extents" role="1.0"><primary sortas="scaled_font_glyph_extents">cairo_scaled_font_glyph_extents</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_glyph_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter>const <link linkend="cairo-glyph-t"><type>cairo_glyph_t</type></link> *glyphs</parameter>, - <parameter><link linkend="int"><type>int</type></link> num_glyphs</parameter>, - <parameter><link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> *extents</parameter>);</programlisting> -<para>Gets the extents for an array of glyphs. The extents describe a -user-space rectangle that encloses the "inked" portion of the -glyphs, (as they would be drawn by <link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link> if the cairo -graphics state were set to the same font_face, font_matrix, ctm, -and font_options as <parameter>scaled_font</parameter> -). Additionally, the x_advance and -y_advance values indicate the amount by which the current point -would be advanced by <link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link>.</para> -<para>Note that whitespace glyphs do not contribute to the size of the -rectangle (extents.width and extents.height).</para> -<refsect3 id="cairo-scaled-font-glyph-extents.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>glyphs</para></entry> -<entry role="parameter_description"><para>an array of glyph IDs with X and Y offsets.</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>num_glyphs</para></entry> -<entry role="parameter_description"><para>the number of glyphs in the <parameter>glyphs</parameter> -array</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>extents</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> which to store the retrieved extents.</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-scaled-font-text-to-glyphs" role="function" condition="since:1.8"> -<title>cairo_scaled_font_text_to_glyphs ()</title> -<indexterm zone="cairo-scaled-font-text-to-glyphs" role="1.8"><primary sortas="scaled_font_text_to_glyphs">cairo_scaled_font_text_to_glyphs</primary></indexterm> -<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -cairo_scaled_font_text_to_glyphs (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="double"><type>double</type></link> x</parameter>, - <parameter><link linkend="double"><type>double</type></link> y</parameter>, - <parameter>const <link linkend="char"><type>char</type></link> *utf8</parameter>, - <parameter><link linkend="int"><type>int</type></link> utf8_len</parameter>, - <parameter><link linkend="cairo-glyph-t"><type>cairo_glyph_t</type></link> **glyphs</parameter>, - <parameter><link linkend="int"><type>int</type></link> *num_glyphs</parameter>, - <parameter><link linkend="cairo-text-cluster-t"><type>cairo_text_cluster_t</type></link> **clusters</parameter>, - <parameter><link linkend="int"><type>int</type></link> *num_clusters</parameter>, - <parameter><link linkend="cairo-text-cluster-flags-t"><type>cairo_text_cluster_flags_t</type></link> *cluster_flags</parameter>);</programlisting> -<para>Converts UTF-8 text to an array of glyphs, optionally with cluster -mapping, that can be used to render later using <parameter>scaled_font</parameter> -.</para> -<para>If <parameter>glyphs</parameter> - initially points to a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> value, that array is used -as a glyph buffer, and <parameter>num_glyphs</parameter> - should point to the number of glyph -entries available there. If the provided glyph array is too short for -the conversion, a new glyph array is allocated using <link linkend="cairo-glyph-allocate"><function>cairo_glyph_allocate()</function></link> -and placed in <parameter>glyphs</parameter> -. Upon return, <parameter>num_glyphs</parameter> - always contains the -number of generated glyphs. If the value <parameter>glyphs</parameter> - points to has changed -after the call, the user is responsible for freeing the allocated glyph -array using <link linkend="cairo-glyph-free"><function>cairo_glyph_free()</function></link>. This may happen even if the provided -array was large enough.</para> -<para>If <parameter>clusters</parameter> - is not <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <parameter>num_clusters</parameter> - and <parameter>cluster_flags</parameter> - should not be <link linkend="NULL:CAPS"><literal>NULL</literal></link>, -and cluster mapping will be computed. -The semantics of how cluster array allocation works is similar to the glyph -array. That is, -if <parameter>clusters</parameter> - initially points to a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> value, that array is used -as a cluster buffer, and <parameter>num_clusters</parameter> - should point to the number of cluster -entries available there. If the provided cluster array is too short for -the conversion, a new cluster array is allocated using <link linkend="cairo-text-cluster-allocate"><function>cairo_text_cluster_allocate()</function></link> -and placed in <parameter>clusters</parameter> -. Upon return, <parameter>num_clusters</parameter> - always contains the -number of generated clusters. If the value <parameter>clusters</parameter> - points at has changed -after the call, the user is responsible for freeing the allocated cluster -array using <link linkend="cairo-text-cluster-free"><function>cairo_text_cluster_free()</function></link>. This may happen even if the provided -array was large enough.</para> -<para>In the simplest case, <parameter>glyphs</parameter> - and <parameter>clusters</parameter> - can point to <link linkend="NULL:CAPS"><literal>NULL</literal></link> initially -and a suitable array will be allocated. In code:</para> -<informalexample><programlisting> -cairo_status_t status; - -cairo_glyph_t *glyphs = NULL; -int num_glyphs; -cairo_text_cluster_t *clusters = NULL; -int num_clusters; -cairo_text_cluster_flags_t cluster_flags; - -status = cairo_scaled_font_text_to_glyphs (scaled_font, - x, y, - utf8, utf8_len, - &glyphs, &num_glyphs, - &clusters, &num_clusters, &cluster_flags); - -if (status == CAIRO_STATUS_SUCCESS) { - cairo_show_text_glyphs (cr, - utf8, utf8_len, - glyphs, num_glyphs, - clusters, num_clusters, cluster_flags); - - cairo_glyph_free (glyphs); - cairo_text_cluster_free (clusters); -} -</programlisting></informalexample> -<para>If no cluster mapping is needed:</para> -<informalexample><programlisting> -cairo_status_t status; - -cairo_glyph_t *glyphs = NULL; -int num_glyphs; - -status = cairo_scaled_font_text_to_glyphs (scaled_font, - x, y, - utf8, utf8_len, - &glyphs, &num_glyphs, - NULL, NULL, - NULL); - -if (status == CAIRO_STATUS_SUCCESS) { - cairo_show_glyphs (cr, glyphs, num_glyphs); - cairo_glyph_free (glyphs); -} -</programlisting></informalexample> -<para>If stack-based glyph and cluster arrays are to be used for small -arrays:</para> -<informalexample><programlisting> -cairo_status_t status; - -cairo_glyph_t stack_glyphs[40]; -cairo_glyph_t *glyphs = stack_glyphs; -int num_glyphs = sizeof (stack_glyphs) / sizeof (stack_glyphs[0]); -cairo_text_cluster_t stack_clusters[40]; -cairo_text_cluster_t *clusters = stack_clusters; -int num_clusters = sizeof (stack_clusters) / sizeof (stack_clusters[0]); -cairo_text_cluster_flags_t cluster_flags; - -status = cairo_scaled_font_text_to_glyphs (scaled_font, - x, y, - utf8, utf8_len, - &glyphs, &num_glyphs, - &clusters, &num_clusters, &cluster_flags); - -if (status == CAIRO_STATUS_SUCCESS) { - cairo_show_text_glyphs (cr, - utf8, utf8_len, - glyphs, num_glyphs, - clusters, num_clusters, cluster_flags); - - if (glyphs != stack_glyphs) - cairo_glyph_free (glyphs); - if (clusters != stack_clusters) - cairo_text_cluster_free (clusters); -} -</programlisting></informalexample> -<para>For details of how <parameter>clusters</parameter> -, <parameter>num_clusters</parameter> -, and <parameter>cluster_flags</parameter> - map input -UTF-8 text to the output glyphs see <link linkend="cairo-show-text-glyphs"><function>cairo_show_text_glyphs()</function></link>.</para> -<para>The output values can be readily passed to <link linkend="cairo-show-text-glyphs"><function>cairo_show_text_glyphs()</function></link> -<link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link>, or related functions, assuming that the exact -same <parameter>scaled_font</parameter> - is used for the operation.</para> -<refsect3 id="cairo-scaled-font-text-to-glyphs.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>x</para></entry> -<entry role="parameter_description"><para>X position to place first glyph</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>y</para></entry> -<entry role="parameter_description"><para>Y position to place first glyph</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>utf8</para></entry> -<entry role="parameter_description"><para>a string of text encoded in UTF-8</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>utf8_len</para></entry> -<entry role="parameter_description"><para>length of <parameter>utf8</parameter> -in bytes, or -1 if it is NUL-terminated</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>glyphs</para></entry> -<entry role="parameter_description"><para>pointer to array of glyphs to fill</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>num_glyphs</para></entry> -<entry role="parameter_description"><para>pointer to number of glyphs</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>clusters</para></entry> -<entry role="parameter_description"><para>pointer to array of cluster mapping information to fill, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>num_clusters</para></entry> -<entry role="parameter_description"><para>pointer to number of clusters, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>cluster_flags</para></entry> -<entry role="parameter_description"><para>pointer to location to store cluster flags corresponding to the -output <parameter>clusters</parameter> -, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-text-to-glyphs.returns" role="returns"> -<title>Returns</title> -<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> upon success, or an error status -if the input values are wrong or if conversion failed. If the input -values are correct but the conversion failed, the error status is also -set on <parameter>scaled_font</parameter> -.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.8">1.8</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-font-face" role="function" condition="since:1.2"> -<title>cairo_scaled_font_get_font_face ()</title> -<indexterm zone="cairo-scaled-font-get-font-face" role="1.2"><primary sortas="scaled_font_get_font_face">cairo_scaled_font_get_font_face</primary></indexterm> -<programlisting language="C"><link linkend="cairo-font-face-t"><returnvalue>cairo_font_face_t</returnvalue></link> * -cairo_scaled_font_get_font_face (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>Gets the font face that this scaled font uses. This might be the -font face passed to <link linkend="cairo-scaled-font-create"><function>cairo_scaled_font_create()</function></link>, but this does not -hold true for all possible cases.</para> -<refsect3 id="cairo-scaled-font-get-font-face.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-get-font-face.returns" role="returns"> -<title>Returns</title> -<para> The <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> with which <parameter>scaled_font</parameter> -was -created. This object is owned by cairo. To keep a reference to it, -you must call <link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link>.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-font-options" role="function" condition="since:1.2"> -<title>cairo_scaled_font_get_font_options ()</title> -<indexterm zone="cairo-scaled-font-get-font-options" role="1.2"><primary sortas="scaled_font_get_font_options">cairo_scaled_font_get_font_options</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_get_font_options (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link> *options</parameter>);</programlisting> -<para>Stores the font options with which <parameter>scaled_font</parameter> - was created into -<parameter>options</parameter> -.</para> -<refsect3 id="cairo-scaled-font-get-font-options.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>options</para></entry> -<entry role="parameter_description"><para>return value for the font options</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-font-matrix" role="function" condition="since:1.2"> -<title>cairo_scaled_font_get_font_matrix ()</title> -<indexterm zone="cairo-scaled-font-get-font-matrix" role="1.2"><primary sortas="scaled_font_get_font_matrix">cairo_scaled_font_get_font_matrix</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_get_font_matrix (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *font_matrix</parameter>);</programlisting> -<para>Stores the font matrix with which <parameter>scaled_font</parameter> - was created into -<parameter>matrix</parameter> -.</para> -<refsect3 id="cairo-scaled-font-get-font-matrix.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>font_matrix</para></entry> -<entry role="parameter_description"><para>return value for the matrix</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-ctm" role="function" condition="since:1.2"> -<title>cairo_scaled_font_get_ctm ()</title> -<indexterm zone="cairo-scaled-font-get-ctm" role="1.2"><primary sortas="scaled_font_get_ctm">cairo_scaled_font_get_ctm</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_get_ctm (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *ctm</parameter>);</programlisting> -<para>Stores the CTM with which <parameter>scaled_font</parameter> - was created into <parameter>ctm</parameter> -. -Note that the translation offsets (x0, y0) of the CTM are ignored -by <link linkend="cairo-scaled-font-create"><function>cairo_scaled_font_create()</function></link>. So, the matrix this -function returns always has 0,0 as x0,y0.</para> -<refsect3 id="cairo-scaled-font-get-ctm.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>ctm</para></entry> -<entry role="parameter_description"><para>return value for the CTM</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-scale-matrix" role="function" condition="since:1.8"> -<title>cairo_scaled_font_get_scale_matrix ()</title> -<indexterm zone="cairo-scaled-font-get-scale-matrix" role="1.8"><primary sortas="scaled_font_get_scale_matrix">cairo_scaled_font_get_scale_matrix</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> -cairo_scaled_font_get_scale_matrix (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *scale_matrix</parameter>);</programlisting> -<para>Stores the scale matrix of <parameter>scaled_font</parameter> - into <parameter>matrix</parameter> -. -The scale matrix is product of the font matrix and the ctm -associated with the scaled font, and hence is the matrix mapping from -font space to device space.</para> -<refsect3 id="cairo-scaled-font-get-scale-matrix.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>scale_matrix</para></entry> -<entry role="parameter_description"><para>return value for the matrix</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><para role="since">Since: <link linkend="api-index-1.8">1.8</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-type" role="function" condition="since:1.2"> -<title>cairo_scaled_font_get_type ()</title> -<indexterm zone="cairo-scaled-font-get-type" role="1.2"><primary sortas="scaled_font_get_type">cairo_scaled_font_get_type</primary></indexterm> -<programlisting language="C"><link linkend="cairo-font-type-t"><returnvalue>cairo_font_type_t</returnvalue></link> -cairo_scaled_font_get_type (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>This function returns the type of the backend used to create -a scaled font. See <link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link> for available types. -However, this function never returns <link linkend="CAIRO-FONT-TYPE-TOY:CAPS"><literal>CAIRO_FONT_TYPE_TOY</literal></link>.</para> -<refsect3 id="cairo-scaled-font-get-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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-get-type.returns" role="returns"> -<title>Returns</title> -<para> The type of <parameter>scaled_font</parameter> -.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-reference-count" role="function" condition="since:1.4"> -<title>cairo_scaled_font_get_reference_count ()</title> -<indexterm zone="cairo-scaled-font-get-reference-count" role="1.4"><primary sortas="scaled_font_get_reference_count">cairo_scaled_font_get_reference_count</primary></indexterm> -<programlisting language="C">unsigned <link linkend="int"><returnvalue>int</returnvalue></link> -cairo_scaled_font_get_reference_count (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting> -<para>Returns the current reference count of <parameter>scaled_font</parameter> -.</para> -<refsect3 id="cairo-scaled-font-get-reference-count.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-get-reference-count.returns" role="returns"> -<title>Returns</title> -<para> the current reference count of <parameter>scaled_font</parameter> -. If the -object is a nil object, 0 will be returned.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2> -<refsect2 id="cairo-scaled-font-set-user-data" role="function" condition="since:1.4"> -<title>cairo_scaled_font_set_user_data ()</title> -<indexterm zone="cairo-scaled-font-set-user-data" role="1.4"><primary sortas="scaled_font_set_user_data">cairo_scaled_font_set_user_data</primary></indexterm> -<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link> -cairo_scaled_font_set_user_data (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter>const <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> *key</parameter>, - <parameter><link linkend="void"><type>void</type></link> *user_data</parameter>, - <parameter><link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> destroy</parameter>);</programlisting> -<para>Attach user data to <parameter>scaled_font</parameter> -. To remove user data from a surface, -call this function with the key that was used to set it and <link linkend="NULL:CAPS"><literal>NULL</literal></link> -for <parameter>data</parameter> -.</para> -<refsect3 id="cairo-scaled-font-set-user-data.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>key</para></entry> -<entry role="parameter_description"><para>the address of a <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> to attach the user data to</para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>user_data</para></entry> -<entry role="parameter_description"><para>the user data to attach to the <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>destroy</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> which will be called when the -<link linkend="cairo-t"><type>cairo_t</type></link> is destroyed or when new user data is attached using the -same key.</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-set-user-data.returns" role="returns"> -<title>Returns</title> -<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or <link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link> if a -slot could not be allocated for the user data.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2> -<refsect2 id="cairo-scaled-font-get-user-data" role="function" condition="since:1.4"> -<title>cairo_scaled_font_get_user_data ()</title> -<indexterm zone="cairo-scaled-font-get-user-data" role="1.4"><primary sortas="scaled_font_get_user_data">cairo_scaled_font_get_user_data</primary></indexterm> -<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link> * -cairo_scaled_font_get_user_data (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>, - <parameter>const <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> *key</parameter>);</programlisting> -<para>Return user data previously attached to <parameter>scaled_font</parameter> - using the -specified key. If no user data has been attached with the given -key this function returns <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para> -<refsect3 id="cairo-scaled-font-get-user-data.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>scaled_font</para></entry> -<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry> -<entry role="parameter_annotations"></entry></row> -<row><entry role="parameter_name"><para>key</para></entry> -<entry role="parameter_description"><para>the address of the <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> the user data was -attached to</para></entry> -<entry role="parameter_annotations"></entry></row> -</tbody></tgroup></informaltable> -</refsect3><refsect3 id="cairo-scaled-font-get-user-data.returns" role="returns"> -<title>Returns</title> -<para> the user data previously attached or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para> -</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2> - -</refsect1> -<refsect1 id="cairo-cairo-scaled-font-t.other_details" role="details"> -<title role="details.title">Types and Values</title> -<refsect2 id="cairo-scaled-font-t" role="typedef" condition="since:1.0"> -<title>cairo_scaled_font_t</title> -<indexterm zone="cairo-scaled-font-t" role="1.0"><primary sortas="scaled_font_t">cairo_scaled_font_t</primary></indexterm> -<programlisting language="C">typedef struct _cairo_scaled_font cairo_scaled_font_t; -</programlisting> -<para>A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> is a font scaled to a particular size and device -resolution. A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> is most useful for low-level font -usage where a library or application wants to cache a reference -to a scaled font to speed up the computation of metrics.</para> -<para>There are various types of scaled fonts, depending on the -<firstterm>font backend</firstterm> they use. The type of a -scaled font can be queried using <link linkend="cairo-scaled-font-get-type"><function>cairo_scaled_font_get_type()</function></link>.</para> -<para>Memory management of <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> is done with -<link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link> and <link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link>.</para> -<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-font-extents-t" role="struct" condition="since:1.0"> -<title>cairo_font_extents_t</title> -<indexterm zone="cairo-font-extents-t" role="1.0"><primary sortas="font_extents_t">cairo_font_extents_t</primary></indexterm> -<programlisting language="C">typedef struct { - double ascent; - double descent; - double height; - double max_x_advance; - double max_y_advance; -} cairo_font_extents_t; -</programlisting> -<para>The <link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> structure stores metric information for -a font. Values are given in the current user-space coordinate -system.</para> -<para>Because font metrics are in user-space coordinates, they are -mostly, but not entirely, independent of the current transformation -matrix. If you call <literal>cairo_scale(cr, 2.0, 2.0)</literal>, -text will be drawn twice as big, but the reported text extents will -not be doubled. They will change slightly due to hinting (so you -can't assume that metrics are independent of the transformation -matrix), but otherwise will remain unchanged.</para> -<refsect3 id="cairo-font-extents-t.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><link linkend="double"><type>double</type></link> <structfield id="cairo-font-extents-t.ascent">ascent</structfield>;</para></entry> -<entry role="struct_member_description"><para>the distance that the font extends above the baseline. -Note that this is not always exactly equal to the maximum -of the extents of all the glyphs in the font, but rather -is picked to express the font designer's intent as to -how the font should align with elements above it.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-font-extents-t.descent">descent</structfield>;</para></entry> -<entry role="struct_member_description"><para>the distance that the font extends below the baseline. -This value is positive for typical fonts that include -portions below the baseline. Note that this is not always -exactly equal to the maximum of the extents of all the -glyphs in the font, but rather is picked to express the -font designer's intent as to how the font should -align with elements below it.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-font-extents-t.height">height</structfield>;</para></entry> -<entry role="struct_member_description"><para>the recommended vertical distance between baselines when -setting consecutive lines of text with the font. This -is greater than <parameter>ascent</parameter> -+<parameter>descent</parameter> -by a -quantity known as the <firstterm>line spacing</firstterm> -or <firstterm>external leading</firstterm>. When space -is at a premium, most fonts can be set with only -a distance of <parameter>ascent</parameter> -+<parameter>descent</parameter> -between lines.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-font-extents-t.max-x-advance">max_x_advance</structfield>;</para></entry> -<entry role="struct_member_description"><para>the maximum distance in the X direction that -the origin is advanced for any glyph in the font.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-font-extents-t.max-y-advance">max_y_advance</structfield>;</para></entry> -<entry role="struct_member_description"><para>the maximum distance in the Y direction that -the origin is advanced for any glyph in the font. -This will be zero for normal fonts used for horizontal -writing. (The scripts of East Asia are sometimes written -vertically.)</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -</tbody></tgroup></informaltable> -</refsect3> -<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> -<refsect2 id="cairo-text-extents-t" role="struct" condition="since:1.0"> -<title>cairo_text_extents_t</title> -<indexterm zone="cairo-text-extents-t" role="1.0"><primary sortas="text_extents_t">cairo_text_extents_t</primary></indexterm> -<programlisting language="C">typedef struct { - double x_bearing; - double y_bearing; - double width; - double height; - double x_advance; - double y_advance; -} cairo_text_extents_t; -</programlisting> -<para>The <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> structure stores the extents of a single -glyph or a string of glyphs in user-space coordinates. Because text -extents are in user-space coordinates, they are mostly, but not -entirely, independent of the current transformation matrix. If you call -<literal>cairo_scale(cr, 2.0, 2.0)</literal>, text will -be drawn twice as big, but the reported text extents will not be -doubled. They will change slightly due to hinting (so you can't -assume that metrics are independent of the transformation matrix), -but otherwise will remain unchanged.</para> -<refsect3 id="cairo-text-extents-t.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><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.x-bearing">x_bearing</structfield>;</para></entry> -<entry role="struct_member_description"><para>the horizontal distance from the origin to the -leftmost part of the glyphs as drawn. Positive if the -glyphs lie entirely to the right of the origin.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.y-bearing">y_bearing</structfield>;</para></entry> -<entry role="struct_member_description"><para>the vertical distance from the origin to the -topmost part of the glyphs as drawn. Positive only if the -glyphs lie completely below the origin; will usually be -negative.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.width">width</structfield>;</para></entry> -<entry role="struct_member_description"><para>width of the glyphs as drawn</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.height">height</structfield>;</para></entry> -<entry role="struct_member_description"><para>height of the glyphs as drawn</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.x-advance">x_advance</structfield>;</para></entry> -<entry role="struct_member_description"><para>distance to advance in the X direction -after drawing these glyphs</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link> <structfield id="cairo-text-extents-t.y-advance">y_advance</structfield>;</para></entry> -<entry role="struct_member_description"><para>distance to advance in the Y direction -after drawing these glyphs. Will typically be zero except -for vertical text layout as found in East-Asian languages.</para></entry> -<entry role="struct_member_annotations"></entry> -</row> -</tbody></tgroup></informaltable> -</refsect3> -<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2> - -</refsect1> -<refsect1 id="cairo-cairo-scaled-font-t.see-also"> -<title>See Also</title> -<para><link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>, <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link>, <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link></para> - -</refsect1> - -</refentry> |