File: class-pangofont.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (57 lines) | stat: -rw-r--r-- 15,211 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>pango.Font</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="pango-class-reference.html" title="The pango Class Reference"><link rel="previous" href="class-pangocontext.html" title="pango.Context"><link rel="next" href="class-pangofontdescription.html" title="pango.FontDescription"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">pango.Font</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pangocontext.html">Prev</a></td><th width="60%" align="center">The pango Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-pangofontdescription.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-pangofont"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>pango.Font</h2><p>pango.Font &#8212; a rendering-system independent font
representation.</p></div><div class="refsect1" lang="en"><a name="id3329319"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">pango.Font</span></span>(<span class="ooclass"><span class="classname"><a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a></span></span>):
<code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#method-pangofont--describe" title="pango.Font.describe">describe</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#method-pangofont--get-metrics" title="pango.Font.get_metrics">get_metrics</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>language</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#method-pangofont--get-glyph-extents" title="pango.Font.get_glyph_extents">get_glyph_extents</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>glyph</tt></b></span></span>)</code><br></pre></td></tr></table><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
<span class="bold"><b>Functions</b></span>

<code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#function-pango--PIXELS" title="pango.PIXELS">pango.PIXELS</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>size</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#function-pango--ASCENT" title="pango.ASCENT">pango.ASCENT</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#function-pango--DESCENT" title="pango.DESCENT">pango.DESCENT</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#function-pango--RBEARING" title="pango.RBEARING">pango.RBEARING</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a href="class-pangofont.html#function-pango--LBEARING" title="pango.LBEARING">pango.LBEARING</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id2946276"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
  +-- <a href="class-pangofont.html" title="pango.Font">pango.Font</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3005612"></a><h2>Description</h2><p>A <a href="class-pangofont.html" title="pango.Font"><tt class="classname">pango.Font</tt></a> object
represents a font in a rendering-system independent way. A <a href="class-pangofont.html" title="pango.Font"><tt class="classname">pango.Font</tt></a> is
returned from the <a href="class-pangocontext.html#method-pangocontext--load-font" title="pango.Context.load_font"><tt class="methodname">pango.Context.load_font</tt>()</a>, 
<a href="class-pangofontset.html#method-pangofontset--get-font" title="pango.Fontset.get_font"><tt class="methodname">pango.FontSet.get_font</tt>()</a> 
and <a href="class-pangofontmap.html#method-pangofontmap--load-font" title="pango.FontMap.load_font"><tt class="methodname">pango.FontMap.load_font</tt>()</a>) 
methods.</p></div><div class="refsect1" lang="en"><a name="id3078944"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-pangofont--describe"></a><h3>pango.Font.describe</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">describe</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-pangofontdescription.html" title="pango.FontDescription"><tt class="classname">pango.FontDescription</tt></a> 
object.</td></tr></tbody></table><p>The <tt class="methodname">describe</tt>() method returns a
description of the font in a <a href="class-pangofontdescription.html" title="pango.FontDescription"><tt class="classname">pango.FontDescription</tt></a> 
object.</p></div><div class="refsect2" lang="en"><a name="method-pangofont--get-metrics"></a><h3>pango.Font.get_metrics</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_metrics</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>language</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>language</tt></b>:</span></td><td>a <a href="class-pangolanguage.html" title="pango.Language"><tt class="classname">pango.Language</tt></a>
that determines the script to get the metrics for, or
<tt class="literal">None</tt> to get the metrics for the entire
font.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a <a href="class-pangofontmetrics.html" title="pango.FontMetrics"><tt class="classname">pango.FontMetrics</tt></a> 
object.</td></tr></tbody></table><p>The <tt class="methodname">get_metrics</tt>() method returns a
<a href="class-pangofontmetrics.html" title="pango.FontMetrics"><tt class="classname">pango.FontMetrics</tt></a> 
object containing the metric information for a font using the <a href="class-pangolanguage.html" title="pango.Language"><tt class="classname">pango.Language</tt></a>
specified by <i class="parameter"><tt>language</tt></i> to limit the metrics to the
script(s) used by <i class="parameter"><tt>language</tt></i>. If the value of
<i class="parameter"><tt>language</tt></i> is <tt class="literal">None</tt>, the font metrics
for the entire font is returned.</p></div><div class="refsect2" lang="en"><a name="method-pangofont--get-glyph-extents"></a><h3>pango.Font.get_glyph_extents</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_glyph_extents</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>glyph</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>glyph</tt></b>:</span></td><td>the glyph index</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a 2-tuple containing two 4-tuples representing
the ink and logical rectangles used to store the extents of
<i class="parameter"><tt>glyph</tt></i> as drawn.</td></tr></tbody></table><p>The <tt class="methodname">get_glyph_extents</tt>() method returns a
2-tuple containing two 4-tuples representing the values of the logical and
ink extent rectangles of the specified <i class="parameter"><tt>glyph</tt></i> within a
font. The coordinate system for each rectangle has its origin at the base
line and horizontal origin of the character with increasing coordinates
extending to the right and down. The <tt class="function">pango.ASCENT()</tt>,
<tt class="function">pango.DESCENT()</tt>, <tt class="function">pango.LBEARING()</tt>,
and <tt class="function">pango.RBEARING</tt> functions can be used to convert
from the extents rectangle to more traditional font metrics. The units of
the rectangles are in <tt class="literal">1/pango.SCALE</tt> of a device
unit.</p></div></div><div class="refsect1" lang="en"><a name="id2945154"></a><h2>Functions</h2><div class="refsect2" lang="en"><a name="function-pango--PIXELS"></a><h3>pango.PIXELS</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pango.PIXELS</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>size</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>size</tt></b>:</span></td><td>the integer value to convert to pango
pixels</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the pixel value</td></tr></tbody></table><p>The <tt class="function">pango.PIXELS</tt>() function converts and
returns the integer value specified by <i class="parameter"><tt>size</tt></i> to pango
pixels.</p></div><div class="refsect2" lang="en"><a name="function-pango--ASCENT"></a><h3>pango.ASCENT</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pango.ASCENT</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>rect</tt></b>:</span></td><td>a 4-tuple representing an extent rectangle's
(x, y, width, height) value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the ascent value of
<i class="parameter"><tt>rect</tt></i></td></tr></tbody></table><p>The <tt class="function">pango.ASCENT</tt>() function returns the
ascent value of the extent rectangle specified by
<i class="parameter"><tt>rect</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-pango--DESCENT"></a><h3>pango.DESCENT</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pango.DESCENT</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>rect</tt></b>:</span></td><td>a 4-tuple representing an extent rectangle's
(x, y, width, height) value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the descent value of
<i class="parameter"><tt>rect</tt></i></td></tr></tbody></table><p>The <tt class="function">pango.DESCENT</tt>() function returns the
descent value of the extent rectangle specified by
<i class="parameter"><tt>rect</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-pango--RBEARING"></a><h3>pango.RBEARING</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pango.RBEARING</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>rect</tt></b>:</span></td><td>a 4-tuple representing an extent rectangle's
(x, y, width, height) value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the right bearing value of
<i class="parameter"><tt>rect</tt></i></td></tr></tbody></table><p>The <tt class="function">pango.RBEARING</tt>() function returns the
right bearing value of the extent rectangle specified by
<i class="parameter"><tt>rect</tt></i>.</p></div><div class="refsect2" lang="en"><a name="function-pango--LBEARING"></a><h3>pango.LBEARING</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">pango.LBEARING</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>rect</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>rect</tt></b>:</span></td><td>a 4-tuple representing an extent rectangle's
(x, y, width, height) value</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the left bearing value of
<i class="parameter"><tt>rect</tt></i></td></tr></tbody></table><p>The <tt class="function">pango.LBEARING</tt>() function returns the
left bearing value of the extent rectangle specified by
<i class="parameter"><tt>rect</tt></i>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-pangocontext.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="pango-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-pangofontdescription.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pango.Context</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">pango.FontDescription</td></tr></table></div></body></html>