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
PangoLogAttr
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped pointer to the underlying
PangoLogAttr
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoLogAttr
instance.Declaration
Swift
var _ptr: UnsafeMutablePointer<PangoLogAttr>! { get }
-
Required Initialiser for types conforming to
LogAttrProtocol
Declaration
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
analyis
argument 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
analyis
argument 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
item
into glyphs.This is similar to [func
Pango.shape_with_flags
], except it takes aPangoItem
instead of separateitem_text
andanalysis
arguments. It also takeslog_attrs
, which may be used in implementing text transforms.Note that the extra attributes in the
analyis
that 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
-
isLineBreak
Extension methodif set, can break line in front of character
Declaration
Swift
@inlinable var isLineBreak: guint { get set }
-
isMandatoryBreak
Extension methodif set, must break line in front of character
Declaration
Swift
@inlinable var isMandatoryBreak: guint { get set }
-
isCharBreak
Extension methodif set, can break here when doing character wrapping
Declaration
Swift
@inlinable var isCharBreak: guint { get set }
-
isWhite
Extension methodis whitespace character
Declaration
Swift
@inlinable var isWhite: guint { get set }
-
isCursorPosition
Extension 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 }
-
isWordStart
Extension methodis first character in a word
Declaration
Swift
@inlinable var isWordStart: guint { get set }
-
isWordEnd
Extension methodis first non-word char after a word Note that in degenerate cases, you could have both
is_word_start
andis_word_end
set for some character.Declaration
Swift
@inlinable var isWordEnd: guint { get set }
-
isSentenceBoundary
Extension 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_boundary
denotes the boundaries there. The second way doesn’t assign between-sentence spaces, etc. to any sentence, sois_sentence_start
/is_sentence_end
mark the boundaries of those sentences.Declaration
Swift
@inlinable var isSentenceBoundary: guint { get set }
-
isSentenceStart
Extension methodis first character in a sentence
Declaration
Swift
@inlinable var isSentenceStart: guint { get set }
-
isSentenceEnd
Extension methodis first char after a sentence. Note that in degenerate cases, you could have both
is_sentence_start
andis_sentence_end
set 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 }
-
backspaceDeletesCharacter
Extension methodif set, backspace deletes one character rather than the entire grapheme cluster. This field is only meaningful on grapheme boundaries (where
is_cursor_position
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 [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 }
-
isExpandableSpace
Extension methodis a whitespace character that can possibly be expanded for justification purposes. (Since: 1.18)
Declaration
Swift
@inlinable var isExpandableSpace: guint { get set }
-
isWordBoundary
Extension 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 }
-
breakInsertsHyphen
Extension methodwhen breaking lines before this char, insert a hyphen. Since: 1.50
Declaration
Swift
@inlinable var breakInsertsHyphen: guint { get set }
-
breakRemovesPreceding
Extension methodwhen breaking lines before this char, remove the preceding char. Since 1.50
Declaration
Swift
@inlinable var breakRemovesPreceding: guint { get set }
-
reserved
Extension methodUndocumented
Declaration
Swift
@inlinable var reserved: guint { get set }