LogAttrProtocol
public protocol LogAttrProtocol
The PangoLogAttr structure stores information about the attributes of a
single character.
The LogAttrProtocol protocol exposes the methods and properties of an underlying PangoLogAttr instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see LogAttr.
Alternatively, use LogAttrRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
PangoLogAttrinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
_ptrDefault implementationTyped pointer to the underlying
PangoLogAttrinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoLogAttrinstance.Declaration
Swift
var _ptr: UnsafeMutablePointer<PangoLogAttr>! { get } -
Required Initialiser for types conforming to
LogAttrProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
defaultBreak(text:Extension methodlength: analysis: attrsLen: ) This is the default break algorithm.
It applies rules from the Unicode Line Breaking Algorithm without language-specific tailoring, therefore the
analyisargument is unused and can benil.See [func
Pango.tailor_break] for language-specific breaks.See [func
Pango.attr_break] for attribute-based customization.Declaration
Swift
@inlinable func defaultBreak(text: UnsafePointer<CChar>!, length: Int, analysis: AnalysisRef? = nil, attrsLen: Int) -
defaultBreak(text:Extension methodlength: analysis: attrsLen: ) This is the default break algorithm.
It applies rules from the Unicode Line Breaking Algorithm without language-specific tailoring, therefore the
analyisargument is unused and can benil.See [func
Pango.tailor_break] for language-specific breaks.See [func
Pango.attr_break] for attribute-based customization.Declaration
Swift
@inlinable func defaultBreak<AnalysisT>(text: UnsafePointer<CChar>!, length: Int, analysis: AnalysisT?, attrsLen: Int) where AnalysisT : AnalysisProtocol -
shape(item:Extension methodparagraphText: paragraphLength: glyphs: flags: ) Convert the characters in
iteminto glyphs.This is similar to [func
Pango.shape_with_flags], except it takes aPangoIteminstead of separateitem_textandanalysisarguments. It also takeslog_attrs, which may be used in implementing text transforms.Note that the extra attributes in the
analyisthat is returned from [funcPango.itemize] have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraph_text, you need to subtract the item offset from their indices before calling [funcPango.shape_with_flags].Declaration
Swift
@inlinable func shape<GlyphStringT, ItemT>(item: ItemT, paragraphText: UnsafePointer<CChar>? = nil, paragraphLength: Int, glyphs: GlyphStringT, flags: ShapeFlags) where GlyphStringT : GlyphStringProtocol, ItemT : ItemProtocol -
isLineBreakExtension methodif set, can break line in front of character
Declaration
Swift
@inlinable var isLineBreak: guint { get set } -
isMandatoryBreakExtension methodif set, must break line in front of character
Declaration
Swift
@inlinable var isMandatoryBreak: guint { get set } -
isCharBreakExtension methodif set, can break here when doing character wrapping
Declaration
Swift
@inlinable var isCharBreak: guint { get set } -
isWhiteExtension methodis whitespace character
Declaration
Swift
@inlinable var isWhite: guint { get set } -
isCursorPositionExtension methodif 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.
Declaration
Swift
@inlinable var isCursorPosition: guint { get set } -
isWordStartExtension methodis first character in a word
Declaration
Swift
@inlinable var isWordStart: guint { get set } -
isWordEndExtension methodis first non-word char after a word Note that in degenerate cases, you could have both
is_word_startandis_word_endset for some character.Declaration
Swift
@inlinable var isWordEnd: guint { get set } -
isSentenceBoundaryExtension methodis 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;
is_sentence_boundarydenotes the boundaries there. The second way doesn’t assign between-sentence spaces, etc. to any sentence, sois_sentence_start/is_sentence_endmark the boundaries of those sentences.Declaration
Swift
@inlinable var isSentenceBoundary: guint { get set } -
isSentenceStartExtension methodis first character in a sentence
Declaration
Swift
@inlinable var isSentenceStart: guint { get set } -
isSentenceEndExtension methodis first char after a sentence. Note that in degenerate cases, you could have both
is_sentence_startandis_sentence_endset for some character. (e.g. no space after a period, so the next sentence starts right away)Declaration
Swift
@inlinable var isSentenceEnd: guint { get set } -
backspaceDeletesCharacterExtension methodif set, backspace deletes one character rather than the entire grapheme cluster. This field is only meaningful on grapheme boundaries (where
is_cursor_positionis 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 [funcbreak], this bit is set on all grapheme boundaries except those following Latin, Cyrillic or Greek base characters.Declaration
Swift
@inlinable var backspaceDeletesCharacter: guint { get set } -
isExpandableSpaceExtension methodis a whitespace character that can possibly be expanded for justification purposes. (Since: 1.18)
Declaration
Swift
@inlinable var isExpandableSpace: guint { get set } -
isWordBoundaryExtension methodis 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. (Since: 1.22)Declaration
Swift
@inlinable var isWordBoundary: guint { get set } -
breakInsertsHyphenExtension methodwhen breaking lines before this char, insert a hyphen. Since: 1.50
Declaration
Swift
@inlinable var breakInsertsHyphen: guint { get set } -
breakRemovesPrecedingExtension methodwhen breaking lines before this char, remove the preceding char. Since 1.50
Declaration
Swift
@inlinable var breakRemovesPreceding: guint { get set } -
reservedExtension methodUndocumented
Declaration
Swift
@inlinable var reserved: guint { get set }
View on GitHub
Install in Dash
LogAttrProtocol Protocol Reference