PgLayoutLine

A PangoLayoutLine represents one of the lines resulting from laying out a paragraph via PangoLayout.

PangoLayoutLine structures are obtained by calling [method@Pango.Layout.get_line] and are only valid until the text, attributes, or settings of the parent PangoLayout are modified.

Constructors

this
this(PangoLayoutLine* pangoLayoutLine, bool ownedRef)

Sets our main struct and passes it to the parent class.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

getExtents
void getExtents(PangoRectangle inkRect, PangoRectangle logicalRect)

Computes the logical and ink extents of a layout line. See [method@Pango.Font.get_glyph_extents] for details about the interpretation of the rectangles.

getHeight
void getHeight(int height)

Computes the height of the line, i.e. the distance between this and the previous lines baseline.

getPgLayoutLineStruct
PangoLayoutLine* getPgLayoutLineStruct(bool transferOwnership)

Get the main Gtk struct

getPixelExtents
void getPixelExtents(PangoRectangle inkRect, PangoRectangle logicalRect)

Computes the logical and ink extents of @layout_line in device units.

getStruct
void* getStruct()

the main Gtk struct as a void*

getXRanges
void getXRanges(int startIndex, int endIndex, int[] ranges)

Gets a list of visual ranges corresponding to a given logical range. This list is not necessarily minimal - there may be consecutive ranges which are adjacent. The ranges will be sorted from left to right. The ranges are with respect to the left edge of the entire layout, not with respect to the line.

indexToX
void indexToX(int index, bool trailing, int xPos)

Converts an index within a line to a X position.

ref_
PgLayoutLine ref_()

Increase the reference count of a PangoLayoutLine by one.

unref
void unref()

Decrease the reference count of a PangoLayoutLine by one. If the result is zero, the line and all associated memory will be freed.

xToIndex
bool xToIndex(int xPos, int index, int trailing)

Converts from x offset to the byte index of the corresponding character within the text of the layout. If @x_pos is outside the line, @index_ and @trailing will point to the very first or very last position in the line. This determination is based on the resolved direction of the paragraph; for example, if the resolved direction is right-to-left, then an X position to the right of the line (after it) results in 0 being stored in @index_ and @trailing. An X position to the left of the line results in @index_ pointing to the (logical) last grapheme in the line and @trailing being set to the number of characters in that grapheme. The reverse is true for a left-to-right line.

Properties

isParagraphStart
uint isParagraphStart [@property getter]
uint isParagraphStart [@property setter]

#TRUE if this is the first line of the paragraph

layout
PgLayout layout [@property getter]
PgLayout layout [@property setter]

the layout this line belongs to, might be %NULL

length
int length [@property getter]
int length [@property setter]

length of line in bytes

resolvedDir
uint resolvedDir [@property getter]
uint resolvedDir [@property setter]

#Resolved PangoDirection of line

runs
ListSG runs [@property getter]
ListSG runs [@property setter]

list of runs in the line, from left to right

startIndex
int startIndex [@property getter]
int startIndex [@property setter]

start of line as byte index into layout->text

Static functions

getType
GType getType()

Variables

ownedRef
bool ownedRef;
Undocumented in source.
pangoLayoutLine
PangoLayoutLine* pangoLayoutLine;

the main Gtk struct

Meta