pango.Context
pango.Context — stores global information used to control
rendering.
Methods
pango.Context.list_families
The list_families() method returns a
tuple containing the list of all the pango.FontFamily
objects for a context.
pango.Context.load_font
The load_font() method loads and
returns the pango.Font from one
of the fontmaps in the context that is the closest match for the pango.FontDescription
specified by desc.
pango.Context.load_fontset
def load_fontset(desc, language)
|
The load_fontset() method loads and
returns a set of fonts (in a pango.FontSet)
from the context that can be used to render a font matching the pango.FontDescription
specified by desc with the pango.Language
specified by language.
pango.Context.get_metrics
def get_metrics(desc, language)
|
The get_metrics() method returns the
overall metric information for the font described by the pango.FontDescription
specified by desc. Since the metrics may be
substantially different for different scripts, a pango.Language
(specified by language) can be provided to indicate
that the metrics should correspond to the script(s) used by that language.
If the value of language is None,
the returned pango.FontMetrics
covers the entire font.
The family name in the pango.FontDescription
may be a comma separated list of families. If characters from multiple of
these families would be used to render the string, then the returned fonts
would be a composite of the metrics for the fonts loaded for the individual
families.
pango.Context.set_font_description
def set_font_description(desc)
|
The set_font_description() method sets
the default pango.FontDescription
(specified by desc) for the context.
pango.Context.get_font_description
def get_font_description()
|
Returns : | the default font description of the
context. |
The get_font_description() method
returns the default pango.FontDescription
for the context.
pango.Context.get_language
The get_language() method returns the
global pango.Language
for the context.
pango.Context.set_language
def set_language(language)
|
The set_language() method sets the
global pango.Language
for the context to the value specified by
language.
pango.Context.set_base_dir
def set_base_dir(direction)
|
direction : | the new base direction |
The set_base_dir() method sets the base
text direction for the context to the value specified by
direction. The value of
direction must be one of:
pango.DIRECTION_LTR | The text is written left-to-right |
pango.DIRECTION_RTL | The text is written right-to-left |
pango.DIRECTION_TTB_LTR | The text is written vertically top-to-bottom, with the
rows ordered from left to right. |
pango.DIRECTION_TTB_RTL | The text is written vertically top-to-bottom, with the
rows ordered from right to left. |
pango.Context.get_base_dir
Returns : | the base direction for the
context. |
The get_base_dir() method returns the
base text direction for the context. See the set_base_dir()
method for more information.