Name
playout:GetLogAttrs -- get logical attributes for characters
Synopsis
t = playout:GetLogAttrs()
Function
Retrieves an array of logical attributes for each character in the layout. This function will return a table that contains a subtable for each character in the layout. Each subtable will be have the following fields initialized:

IsLineBreak
If set, can break line in front of character.
IsMandatoryBreak
If set, must break line in front of character.
IsCharBreak
If set, can break here when doing character wrapping.
IsWhite
Is whitespace character.
IsCursorPosition
If set, cursor can appear in front of character. i.e. this is a grapheme boundary, or the first character in the text. This flag implements Unicode's Grapheme Cluster Boundaries semantics.
IsWordStart
Is first character in a word.
IsWordEnd
Is first non-word char after a word. Note that in degenerate cases, you could have both IsWordStart and IsWordEnd set for some character.
IsSentenceBoundary
Is a sentence boundary. There are two ways to divide sentences. The first assigns all inter-sentence whitespace/control/format chars to some sentence, so all chars are in some sentence; IsSentenceBoundary denotes the boundaries there. The second way doesn't assign between-sentence spaces, etc. to any sentence, so IsSentenceStart / IsSentenceEnd mark the boundaries of those sentences.
IsSentenceStart
Is first character in a sentence.
IsSentenceEnd
Is first char after a sentence. Note that in degenerate cases, you could have both IsSentenceStart and IsSentenceEnd set for some character. (e.g. no space after a period, so the next sentence starts right away).
BackspaceDeletesCharacter
If set, backspace deletes one character rather than the entire grapheme cluster. This field is only meaningful on grapheme boundaries (where IsCursorPosition is set). In some languages, the full grapheme (e.g. letter + diacritics) is considered a unit, while in others, each decomposed character in the grapheme is a unit. In the default implementation of pango break, this bit is set on all grapheme boundaries except those following Latin, Cyrillic or Greek base characters.
IsExpandableSpace
Is a whitespace character that can possibly be expanded for justification purposes.
IsWordBoundary
Is a word boundary, as defined by UAX#29. More specifically, means that this is not a position in the middle of a word. For example, both sides of a punctuation mark are considered word boundaries. This flag is particularly useful when selecting text word-by-word. This flag implements Unicode’s Word Boundaries semantics.

The number of attributes returned in the table will be one more than the total number of characters in the layout, since there need to be attributes corresponding to both the position before the first character and the position after the last character.

Inputs
none

Results
t
table containing an array of logical attributes

Show TOC