2.26 <PangoTabArray>

Structure: <PangoTabArray>

A <PangoTabArray> contains an array of tab stops.

<PangoTabArray> can be used to set tab stops in a <PangoLayout>. Each tab stop has an alignment, a position, and optionally a character to use as decimal point.

Procedures

Method: tab-array:copy self ⇒ %return
Method: copy self ⇒ %return

Copies a <PangoTabArray>.

self

Passed: a <PangoTabArray>.

<PangoTabArray> to copy

%return

Returned: a <PangoTabArray>.

the newly allocated <PangoTabArray>, which should be freed with tab-array:free.

Method: tab-array:free self
Method: free self

Frees a tab array and associated resources.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

Procedure: tab-array:from-string text ⇒ %return

Deserializes a <PangoTabArray> from a string.

This is the counterpart to tab-array:to-string. See that functions for details about the format.

text

Passed: a string.

a string

%return

Returned: a <PangoTabArray>, or #f.

a new <PangoTabArray>

Method: tab-array:get-decimal-point self tab-index ⇒ %return
Method: get-decimal-point self tab-index ⇒ %return

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.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

tab-index

Passed: a 32-bit integer.

the index of a tab stop

%return

Returned: a character.

Method: tab-array:get-positions-in-pixels? self ⇒ %return
Method: get-positions-in-pixels? self ⇒ %return

Returns #t if the tab positions are in pixels, #f if they are in Pango units.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

%return

Returned: a boolean.

whether positions are in pixels.

Method: tab-array:get-size self ⇒ %return
Method: get-size self ⇒ %return

Gets the number of tab stops in self.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

%return

Returned: a 32-bit integer.

the number of tab stops in the array.

Method: tab-array:get-tab self tab-index ⇒ alignment location
Method: get-tab self tab-index ⇒ alignment location

Gets the alignment and position of a tab stop.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

tab-index

Passed: a 32-bit integer.

tab stop index

alignment

Returned: a <PangoTabAlign>.

location to store alignment

location

Returned: a 32-bit integer.

location to store tab position

Method: tab-array:get-tabs self ⇒ alignments locations
Method: get-tabs self ⇒ alignments locations

If non-#f, alignments and locations are filled with allocated arrays.

The arrays are of length tab-array:get-size. You must free the returned array.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

alignments

Returned: a <PangoTabAlign>.

location to store an array of tab stop alignments

locations

Returned: a foreign pointer.

location to store an array of tab positions

Procedure: tab-array:new initial-size positions-in-pixels ⇒ %return

Creates an array of initial-size tab stops.

Tab stops are specified in pixel units if positions-in-pixels is #t, otherwise in Pango units. All stops are initially at position 0.

initial-size

Passed: a 32-bit integer.

Initial number of tab stops to allocate, can be 0

positions-in-pixels

Passed: a boolean.

whether positions are in pixel units

%return

Returned: a <PangoTabArray>.

the newly allocated <PangoTabArray>, which should be freed with tab-array:free.

Method: tab-array:resize self new-size
Method: resize self new-size

Resizes a tab array.

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

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

new-size

Passed: a 32-bit integer.

new size of the array

Method: tab-array:set-decimal-point self tab-index decimal-point
Method: set-decimal-point self tab-index decimal-point

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.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

tab-index

Passed: a 32-bit integer.

the index of a tab stop

decimal-point

Passed: a character.

the decimal point to use

Method: tab-array:set-positions-in-pixels self positions-in-pixels
Method: set-positions-in-pixels self positions-in-pixels

Sets whether positions in this array are specified in pixels.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

positions-in-pixels

Passed: a boolean.

whether positions are in pixels

Method: tab-array:set-tab self tab-index alignment location
Method: set-tab self tab-index alignment location

Sets the alignment and location of a tab stop.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

tab-index

Passed: a 32-bit integer.

the index of a tab stop

alignment

Passed: a <PangoTabAlign>, or one of its symbols.

tab alignment

location

Passed: a 32-bit integer.

tab location in Pango units

Method: tab-array:sort self
Method: sort self

Utility function to ensure that the tab stops are in increasing order.

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

Method: tab-array:to-string self ⇒ %return
Method: to-string self ⇒ %return

Serializes a <PangoTabArray> 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

self

Passed: a <PangoTabArray>.

a <PangoTabArray>

%return

Returned: a string.

a newly allocated string