Pango.TabArray¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Pango.TabArray¶
A
PangoTabArray
contains an array of tab stops.PangoTabArray
can be used to set tab stops in aPangoLayout
. Each tab stop has an alignment, a position, and optionally a character to use as decimal point.- classmethod from_string(text)[source]¶
- Parameters:
text (
str
) – a string- Returns:
a new
PangoTabArray
- Return type:
Deserializes a
PangoTabArray
from a string.This is the counterpart to [method`Pango`.TabArray.to_string]. See that functions for details about the format.
New in version 1.50.
- classmethod new(initial_size, positions_in_pixels)[source]¶
- Parameters:
- Returns:
the newly allocated
PangoTabArray
, which should be freed with [method`Pango`.TabArray.free].- Return type:
Creates an array of initial_size tab stops.
Tab stops are specified in pixel units if positions_in_pixels is
True
, otherwise in Pango units. All stops are initially at position 0.
- copy()[source]¶
- Returns:
the newly allocated
PangoTabArray
, which should be freed with [method`Pango`.TabArray.free].- Return type:
Copies a
PangoTabArray
.
- get_decimal_point(tab_index)[source]¶
-
Gets the Unicode character to use as decimal point.
This is only relevant for tabs with
Pango.TabAlign.DECIMAL
alignment, which align content at the first occurrence of the decimal point character.The default value of 0 means that Pango will use the decimal point according to the current locale.
New in version 1.50.
- get_positions_in_pixels()[source]¶
- Returns:
whether positions are in pixels.
- Return type:
Returns
True
if the tab positions are in pixels,False
if they are in Pango units.
- get_size()[source]¶
- Returns:
the number of tab stops in the array.
- Return type:
Gets the number of tab stops in self.
- get_tab(tab_index)[source]¶
- Parameters:
tab_index (
int
) – tab stop index- Returns:
- alignment:
location to store alignment
- location:
location to store tab position
- Return type:
(alignment:
Pango.TabAlign
, location:int
)
Gets the alignment and position of a tab stop.
- get_tabs()[source]¶
- Returns:
- alignments:
location to store an array of tab stop alignments
- locations:
location to store an array of tab positions
- Return type:
(alignments:
Pango.TabAlign
, locations: [int
])
If non-
None
, alignments and locations are filled with allocated arrays.The arrays are of length [method`Pango`.TabArray.get_size]. You must free the returned array.
- resize(new_size)[source]¶
- Parameters:
new_size (
int
) – new size of the array
Resizes a tab array.
You must subsequently initialize any tabs that were added as a result of growing the array.
- set_decimal_point(tab_index, decimal_point)[source]¶
- Parameters:
Sets the Unicode character to use as decimal point.
This is only relevant for tabs with
Pango.TabAlign.DECIMAL
alignment, which align content at the first occurrence of the decimal point character.By default, Pango uses the decimal point according to the current locale.
New in version 1.50.
- set_positions_in_pixels(positions_in_pixels)[source]¶
- Parameters:
positions_in_pixels (
bool
) – whether positions are in pixels
Sets whether positions in this array are specified in pixels.
New in version 1.50.
- set_tab(tab_index, alignment, location)[source]¶
- Parameters:
tab_index (
int
) – the index of a tab stopalignment (
Pango.TabAlign
) – tab alignmentlocation (
int
) – tab location in Pango units
Sets the alignment and location of a tab stop.
- sort()[source]¶
Utility function to ensure that the tab stops are in increasing order.
New in version 1.50.
- to_string()[source]¶
- Returns:
a newly allocated string
- Return type:
Serializes a
PangoTabArray
to a string.No guarantees are made about the format of the string, it may change between Pango versions.
The intended use of this function is testing and debugging. The format is not meant as a permanent storage format.
New in version 1.50.