pango.Font — a rendering-system independent font representation.
class pango.Font( |
Functionsdef pango.PIXELS(size)def pango.ASCENT(rect)def pango.DESCENT(rect)def pango.RBEARING(rect)def pango.LBEARING(rect)
A pango.Font object
represents a font in a rendering-system independent way. A pango.Font is
returned from the pango.Context.load_font(),
pango.FontSet.get_font()
and pango.FontMap.load_font())
methods.
def describe()| Returns : | a pango.FontDescription
object. |
The describe() method returns a
description of the font in a pango.FontDescription
object.
def get_metrics(language)language : | a pango.Language
that determines the script to get the metrics for, or
None to get the metrics for the entire
font. |
| Returns : | a pango.FontMetrics
object. |
The get_metrics() method returns a
pango.FontMetrics
object containing the metric information for a font using the pango.Language
specified by language to limit the metrics to the
script(s) used by language. If the value of
language is None, the font metrics
for the entire font is returned.
def get_glyph_extents(glyph)glyph : | the glyph index |
| Returns : | a 2-tuple containing two 4-tuples representing
the ink and logical rectangles used to store the extents of
glyph as drawn. |
The get_glyph_extents() method returns a
2-tuple containing two 4-tuples representing the values of the logical and
ink extent rectangles of the specified glyph 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 pango.ASCENT(),
pango.DESCENT(), pango.LBEARING(),
and pango.RBEARING functions can be used to convert
from the extents rectangle to more traditional font metrics. The units of
the rectangles are in 1/pango.SCALE of a device
unit.
def get_font_map()| Returns : | the pango.FontMap
for the font |
This method is available in PyGTK 2.10 and above.
Gets the font map for which the font was created.
def pango.PIXELS(size)size : | the integer value to convert to pango pixels |
| Returns : | the pixel value |
The pango.PIXELS() function converts and
returns the integer value specified by size to pango
pixels.
def pango.ASCENT(rect)rect : | a 4-tuple representing an extent rectangle's (x, y, width, height) value |
| Returns : | the ascent value of
rect |
The pango.ASCENT() function returns the
ascent value of the extent rectangle specified by
rect.
def pango.DESCENT(rect)rect : | a 4-tuple representing an extent rectangle's (x, y, width, height) value |
| Returns : | the descent value of
rect |
The pango.DESCENT() function returns the
descent value of the extent rectangle specified by
rect.