Class (GI Struct)

Pango-1.0PangoTabArray

A Pango.TabArray contains an array of tab stops.

Pango.TabArray can be used to set tab stops in a Pango.Layout. Each tab stop has an alignment, a position, and optionally a character to use as decimal point.

Index

Constructors

Properties

$gtype: GType<TabArray>

Methods

  • 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.

    Parameters

    • tab_index: number

      the index of a tab stop

    Returns string

  • Returns true if the tab positions are in pixels, false if they are in Pango units.

    Returns boolean

    whether positions are in pixels.

  • Gets the number of tab stops in tab_array.

    Returns number

    the number of tab stops in the array.

  • Resizes a tab array.

    You must subsequently initialize any tabs that were added as a result of growing the array.

    Parameters

    • new_size: number

      new size of the array

    Returns void

  • 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.

    Parameters

    • tab_index: number

      the index of a tab stop

    • decimal_point: string

      the decimal point to use

    Returns void

  • Sets whether positions in this array are specified in pixels.

    Parameters

    • positions_in_pixels: boolean

      whether positions are in pixels

    Returns void

  • Sets the alignment and location of a tab stop.

    Parameters

    • tab_index: number

      the index of a tab stop

    • alignment: Pango.TabAlign

      tab alignment

    • location: number

      tab location in Pango units

    Returns void

  • Serializes a Pango.TabArray to a string.

    In the resulting string, serialized tabs are separated by newlines or commas.

    Individual tabs are serialized to a string of the form

    [ALIGNMENT:]POSITION[:DECIMAL_POINT]
    

    Where ALIGNMENT is one of left, right, center or decimal, and POSITION is the position of the tab, optionally followed by the unit px. If ALIGNMENT is omitted, it defaults to left. If ALIGNMENT is decimal, the DECIMAL_POINT character may be specified as a Unicode codepoint.

    Note that all tabs in the array must use the same unit.

    A typical example:

    100px 200px center:300px right:400px
    

    Returns string

    a newly allocated string