TabArray
- class TabArray(**kwargs)
- Constructors:
new(initial_size:int, positions_in_pixels:bool) -> Pango.TabArray
Constructors
- class TabArray
- classmethod new(initial_size: int, positions_in_pixels: bool) TabArray
Creates an array of
initial_size
tab stops.Tab stops are specified in pixel units if
positions_in_pixels
isTrue
, otherwise in Pango units. All stops are initially at position 0.- Parameters:
initial_size – Initial number of tab stops to allocate, can be 0
positions_in_pixels – whether positions are in pixel units
Methods
- class TabArray
-
- from_string(text: str) TabArray | None
Deserializes a
PangoTabArray
from a string.This is the counterpart to
to_string
. See that functions for details about the format.Added in version 1.50.
- Parameters:
text – a string
- get_decimal_point(tab_index: int) str
Gets the Unicode character to use as decimal point.
This is only relevant for tabs with
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.
Added in version 1.50.
- Parameters:
tab_index – the index of a tab stop
- get_positions_in_pixels() bool
Returns
True
if the tab positions are in pixels,False
if they are in Pango units.
- get_tab(tab_index: int) tuple[TabAlign, int]
Gets the alignment and position of a tab stop.
- Parameters:
tab_index – tab stop index
- get_tabs() tuple[TabAlign, list[int]]
If non-
None
,alignments
andlocations
are filled with allocated arrays.The arrays are of length
get_size
. You must free the returned array.
- resize(new_size: int) None
Resizes a tab array.
You must subsequently initialize any tabs that were added as a result of growing the array.
- Parameters:
new_size – new size of the array
- set_decimal_point(tab_index: int, decimal_point: str) None
Sets the Unicode character to use as decimal point.
This is only relevant for tabs with
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.
Added in version 1.50.
- Parameters:
tab_index – the index of a tab stop
decimal_point – the decimal point to use
- set_positions_in_pixels(positions_in_pixels: bool) None
Sets whether positions in this array are specified in pixels.
Added in version 1.50.
- Parameters:
positions_in_pixels – whether positions are in pixels
- set_tab(tab_index: int, alignment: TabAlign, location: int) None
Sets the alignment and location of a tab stop.
- Parameters:
tab_index – the index of a tab stop
alignment – tab alignment
location – tab location in Pango units