pango Constants

pango Constants — the built-in constants of the pango module

Synopsis

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

Description

Pango Alignment 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.

pango.ALIGN_LEFTPut all available space on the right
pango.ALIGN_CENTERCenter the line within the available space
pango.ALIGN_RIGHTPut all available space on the left

Pango Attribute Type Constants

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.

pango.ATTR_LANGUAGESpecifies a pango.Language.
pango.ATTR_FAMILYSpecifies a font family name list as a string.
pango.ATTR_STYLESpecifies a font slant style. See the pango.AttrStyle() function for more details.
pango.ATTR_WEIGHTSpecifies a font weight. See the pango.AttrWeight() function for more detail.
pango.ATTR_VARIANTSpecifies a font variant (normal or small caps). See the pango.AttrVariant() function for more detail.
pango.ATTR_STRETCHSpecifies a font stretch. See the pango.AttrStretch() function for more details.
pango.ATTR_SIZESpecifies a font size in thousandths of a point.
pango.ATTR_FONT_DESCSpecifies a pango.FontDescription.
pango.ATTR_FOREGROUNDSpecifies a foreground pango.Color.
pango.ATTR_BACKGROUNDSpecifies a background pango.Color.
pango.ATTR_UNDERLINESpecifies an underline style. See the pango.AttrUnderline() function for more details.
pango.ATTR_STRIKETHROUGHIf TRUE the text is struck through.
pango.ATTR_RISESpecifies the displacement of the text from the baseline.
pango.ATTR_SHAPESpecifies a shape. See the pango.AttrShape() function for more details.
pango.ATTR_SCALESpecifies a font size scale factor.
pango.ATTR_FALLBACKif TRUE, fallback to other fonts is enabled (

Pango Coverage Level Constants

pango.COVERAGE_NONEThe character is not representable with the font.
pango.COVERAGE_FALLBACKThe 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.
pango.COVERAGE_APPROXIMATEThe character is represented as basically the correct graphical form, but with a stylistic variant inappropriate for the current script.
pango.COVERAGE_EXACTThe character is represented as the correct graphical form.

Pango Direction Constants

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.

pango.DIRECTION_LTRA strong left-to-right direction
pango.DIRECTION_RTLA strong right-to-left direction
pango.DIRECTION_TTB_LTRDeprecated value; treated the same as pango.DIRECTION_RTL.
pango.DIRECTION_TTB_RTLDeprecated value; treated the same as pango.DIRECTION_LTR
pango.DIRECTION_WEAK_LTRA weak left-to-right direction
pango.DIRECTION_WEAK_RTLA weak right-to-left direction
pango.DIRECTION_NEUTRALNo direction specified

Pango Ellipsize Mode Constants

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 (...).

pango.ELLIPSIZE_NONE No ellipsization.
pango.ELLIPSIZE_STARTOmit characters at the start of the text.
pango.ELLIPSIZE_MIDDLE Omit characters in the middle of the text.
pango.ELLIPSIZE_END Omit characters at the end of the text.

Pango Font Mask Flag Constants

The Font Mask flag constants are bit-flags that correspond to fields in a pango.FontDescription that have been set.

pango.FONT_MASK_FAMILYthe font family is specified.
pango.FONT_MASK_STYLEthe font style is specified.
pango.FONT_MASK_VARIANTthe font variant is specified.
pango.FONT_MASK_WEIGHTthe font weight is specified.
pango.FONT_MASK_STRETCHthe font stretch is specified.
pango.FONT_MASK_SIZEthe font size is specified.

Pango Render Part Constants

pango.RENDER_PARTThe pango.RENDER_PART constants define different items to render for purposes such as setting colors. Available since PyGTK 2.8.
pango.RENDER_PART_FOREGROUNDThe text itself.
pango.RENDER_PART_BACKGROUNDThe area behind the text.
pango.RENDER_PART_UNDERLINEThe underlined areas.
pango.RENDER_PART_STRIKETHROUGHThe strikethrough areas.

Pango Scale Constants

pango.SCALEThe 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.
pango.SCALE_XX_SMALLThe scale factor for three shrinking steps (1 / (1.2 * 1.2 * 1.2)).
pango.SCALE_X_SMALLThe scale factor for two shrinking steps (1 / (1.2 * 1.2)).
pango.SCALE_SMALLThe scale factor for one shrinking step (1 / 1.2).
pango.SCALE_MEDIUMThe scale factor for normal size (1.0).
pango.SCALE_LARGEThe scale factor for one magnification step (1.2).
pango.SCALE_X_LARGEhe scale factor for two magnification steps (1.2 * 1.2).
pango.SCALE_XX_LARGEThe scale factor for three magnification steps (1.2 * 1.2 * 1.2).

Pango Stretch Constants

The Stretch constants specify the width of the font relative to other designs within a family.

pango.STRETCH_ULTRA_CONDENSEDThe most narrow width
pango.STRETCH_EXTRA_CONDENSED
pango.STRETCH_CONDENSED
pango.STRETCH_SEMI_CONDENSED
pango.STRETCH_NORMALThe normal width.
pango.STRETCH_SEMI_EXPANDED
pango.STRETCH_EXPANDED
pango.STRETCH_EXTRA_EXPANDED
pango.STRETCH_ULTRA_EXPANDEDThe most expanded width

Pango Style Constants

The Style constants specify the various slant styles possible for a font.

pango.STYLE_NORMALThe font is upright.
pango.STYLE_OBLIQUEThe font is slanted in a roman style.
pango.STYLE_ITALICThe font is slanted in an italic style.

Pango Tab Constants

The Tab constants specify where a tab stop appears relative to the text.

pango.TAB_LEFTthe tab stop appears to the left of the text.

Pango Underline Constants

The Underline constants specify he type of underlining (if any) to be used.

pango.UNDERLINE_NONENo underline should be drawn.
pango.UNDERLINE_SINGLEA single underline should be drawn.
pango.UNDERLINE_DOUBLEA double underline should be drawn.
pango.UNDERLINE_LOWA 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.

Pango Variant Constants

The Variant constants specify the capitalization variant of the font.

pango.VARIANT_NORMALA normal font.
pango.VARIANT_SMALL_CAPSA font with the lower case characters replaced by smaller variants of the capital characters.

Pango Weight Constants

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:

pango.WEIGHT_ULTRALIGHTThe ultralight weight (= 200).
pango.WEIGHT_LIGHTThe light weight (=300).
pango.WEIGHT_NORMALThe default weight (= 400).
pango.WEIGHT_BOLDThe bold weight (= 700).
pango.WEIGHT_ULTRABOLDThe ultrabold weight (= 800).
pango.WEIGHT_HEAVYThe heavy weight (= 900).

Pango Wrap Mode Constants

The Wrap Mode constants specify how to wrap the lines of a pango.Layout to the desired width.

pango.WRAP_WORDwrap lines at word boundaries.
pango.WRAP_CHARwrap lines at character boundaries.
pango.WRAP_WORD_CHARwrap lines at word boundaries, but fall back to character boundaries if there is not enough space for a full word.