pango Constants — the built-in constants of the pango module
Pango Alignment Constants Pango Attribute Type Constants Pango Coverage Level Constants Pango Direction Constants Pango Ellipsize Mode Constants Pango Font Mask Flag Constants Pango Render Part Constants Pango Scale Constants Pango Stretch Constants Pango Style Constants Pango Tab Constants Pango Underline Constants Pango Variant Constants Pango Weight Constants Pango Wrap Mode Constants
The Alignment constants specify how to align the lines of a
pango.Layout
within the available space. If the pango.Layout
is
set to justify using the pango.Layout.set_justify
()
method, then this only has an effect for partial lines.
| Put all available space on the right |
| Center the line within the available space |
| Put all available space on the left |
The Attribute Type constants specify the type of a pango.Attribute
.Along
with the predefined values, it is possible to allocate additional values for
custom attributes using the pango.attr_type_register
()
function. The predefined values are given below. The type of structure used
to store the attribute is listed in parentheses after the
description.
| Specifies a pango.Language . |
| Specifies a font family name list as a string. |
| Specifies a font slant style. See the pango.AttrStyle ()
function for more details. |
| Specifies a font weight. See the pango.AttrWeight ()
function for more detail. |
| Specifies a font variant (normal or small caps). See the
pango.AttrVariant ()
function for more detail. |
| Specifies a font stretch. See the pango.AttrStretch ()
function for more details. |
| Specifies a font size in thousandths of a point. |
| Specifies a pango.FontDescription . |
| Specifies a foreground pango.Color . |
| Specifies a background pango.Color . |
| Specifies an underline style. See the pango.AttrUnderline ()
function for more details. |
| If True the text is struck
through. |
| Specifies the displacement of the text from the baseline. |
| Specifies a shape. See the pango.AttrShape ()
function for more details. |
| Specifies a font size scale factor. |
| if True , fallback to other fonts is
enabled ( |
| The character is not representable with the font. |
| The character is represented in a way that may be comprehensible but is not the correct graphical form. For instance, a Hangul character represented as a a sequence of Jamos, or a Latin transliteration of a Cyrillic word. |
| The character is represented as basically the correct graphical form, but with a stylistic variant inappropriate for the current script. |
| The character is represented as the correct graphical form. |
The pango Direction constants specify a direction in the Unicode bidirectional algorithm. Not every value in this enumeration makes sense for every usage of pango Direction.
The pango.DIRECTION_TTB_LTR
,
pango.DIRECTION_TTB_RTL
values come from an earlier
interpretation of this enumeration as the writing direction of a block of
text and are no longer used; See the Text module of the CSS3 spec for how
vertical text is planned to be handled in a future version of Pango. The
explanation of why pango.DIRECTION_TTB_LTR
is treated as
pango.DIRECTION_RTL
can be found there as well.
| A strong left-to-right direction |
| A strong right-to-left direction |
| Deprecated value; treated the same as
pango.DIRECTION_RTL . |
| Deprecated value; treated the same as
pango.DIRECTION_LTR |
| A weak left-to-right direction |
| A weak right-to-left direction |
| No direction specified |
The Ellipsize Mode constants specify what sort of (if any) ellipsization should be applied to a line of text. In the ellipsization process characters are removed from the text in order to make it fit to a given width and replaced with an ellipsis (...).
| No ellipsization. |
| Omit characters at the start of the text. |
| Omit characters in the middle of the text. |
| Omit characters at the end of the text. |
The Font Mask flag constants are bit-flags that correspond to
fields in a pango.FontDescription
that have been set.
| the font family is specified. |
| the font style is specified. |
| the font variant is specified. |
| the font weight is specified. |
| the font stretch is specified. |
| the font size is specified. |
| The pango.RENDER_PART constants
define different items to render for purposes such as setting
colors. Available since PyGTK 2.8. |
| The text itself. |
| The area behind the text. |
| The underlined areas. |
| The strikethrough areas. |
| The pango.SCALE constant represents
the scale between dimensions used for Pango distances and device
units. (The definition of device units is dependent on the
output device; it will typically be pixels for a screen, and
points for a printer.) pango.SCALE is
currently 1024, but this may be changed in the future. When
setting font sizes, device units are always considered to be
points (as in "12 point font"), rather than pixels. |
| The scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)). |
| The scale factor for two shrinking steps (1 / (1.2 * 1.2)). |
| The scale factor for one shrinking step (1 / 1.2). |
| The scale factor for normal size (1.0). |
| The scale factor for one magnification step (1.2). |
| he scale factor for two magnification steps (1.2 * 1.2). |
| The scale factor for three magnification steps (1.2 * 1.2 * 1.2). |
The Stretch constants specify the width of the font relative to other designs within a family.
| The most narrow width |
| |
| |
| |
| The normal width. |
| |
| |
| |
| The most expanded width |
The Style constants specify the various slant styles possible for a font.
| The font is upright. |
| The font is slanted in a roman style. |
| The font is slanted in an italic style. |
The Tab constants specify where a tab stop appears relative to the text.
| the tab stop appears to the left of the text. |
The Underline constants specify he type of underlining (if any) to be used.
| No underline should be drawn. |
| A single underline should be drawn. |
| A double underline should be drawn. |
| A single underline should be drawn at a position
beneath the ink extents of the text being underlined. This should be used
only for underlining single characters, such as for keyboard accelerators.
pango.UNDERLINE_SINGLE should be used for extended
portions of text. |
| a wavy underline should be drawn below. This underline is typically used to indicate an error such as a possilble mispelling; in some cases a contrasting color may automatically be used. This type of underlining is available since Pango 1.4. |
The Variant constants specify the capitalization variant of the font.
| A normal font. |
| A font with the lower case characters replaced by smaller variants of the capital characters. |
The Weight constants specify the weight (boldness) of a font. This is a numerical value ranging from 100 to 900, but there are some predefined values:
| The ultralight weight (= 200). |
| The light weight (=300). |
| The default weight (= 400). |
| The bold weight (= 700). |
| The ultrabold weight (= 800). |
| The heavy weight (= 900). |
The Wrap Mode constants specify how to wrap the lines of a pango.Layout
to
the desired width.
| wrap lines at word boundaries. |
| wrap lines at character boundaries. |
| wrap lines at word boundaries, but fall back to character boundaries if there is not enough space for a full word. |