pango.Font
pango.Font — a rendering-system independent font
representation.
Methods
pango.Font.describe
The describe() method returns a
description of the font in a pango.FontDescription
object.
pango.Font.get_metrics
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.
pango.Font.get_glyph_extents
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.
pango.Font.get_font_map
Note
This method is available in PyGTK 2.10 and above.
Gets the font map for which the font was created.
Functions
pango.PIXELS
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.
pango.ASCENT
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.
pango.DESCENT
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.
pango.RBEARING
rect : | a 4-tuple representing an extent rectangle's
(x, y, width, height) value |
Returns : | the right bearing value of
rect |
The pango.RBEARING() function returns the
right bearing value of the extent rectangle specified by
rect.
pango.LBEARING
rect : | a 4-tuple representing an extent rectangle's
(x, y, width, height) value |
Returns : | the left bearing value of
rect |
The pango.LBEARING() function returns the
left bearing value of the extent rectangle specified by
rect.