AnalysisProtocol
public protocol AnalysisProtocol
The PangoAnalysis structure stores information about
the properties of a segment of text.
The AnalysisProtocol protocol exposes the methods and properties of an underlying PangoAnalysis 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 Analysis.
Alternatively, use AnalysisRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
PangoAnalysisinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
_ptrDefault implementationTyped pointer to the underlying
PangoAnalysisinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoAnalysisinstance.Declaration
Swift
var _ptr: UnsafeMutablePointer<PangoAnalysis>! { get } -
Required Initialiser for types conforming to
AnalysisProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
break_(text:Extension methodlength: attrs: attrsLen: ) Determines possible line, word, and character breaks for a string of Unicode text with a single analysis.
For most purposes you may want to use [func
Pango.get_log_attrs].break is deprecated: Use [func@Pango.default_break], [func@Pango.tailor_break] and [func@Pango.attr_break].
Declaration
Swift
@available(*, deprecated) @inlinable func break_(text: UnsafePointer<CChar>!, length: Int, attrs: UnsafeMutablePointer<PangoLogAttr>!, attrsLen: Int) -
defaultBreak(text:Extension methodlength: attrs: 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<LogAttrT>(text: UnsafePointer<CChar>!, length: Int, attrs: LogAttrT, attrsLen: Int) where LogAttrT : LogAttrProtocol -
Convert the characters in
textinto glyphs.Given a segment of text and the corresponding
PangoAnalysisstructure returned from [funcPango.itemize], convert the characters into glyphs. You may also pass in only a substring of the item from [funcPango.itemize].This is similar to [func
Pango.shape_full], except it also takes flags that can influence the shaping process.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 shapeWithFlags<GlyphStringT>(itemText: UnsafePointer<CChar>!, itemLength: Int, paragraphText: UnsafePointer<CChar>? = nil, paragraphLength: Int, glyphs: GlyphStringT, flags: ShapeFlags) where GlyphStringT : GlyphStringProtocol -
tailorBreak(text:Extension methodlength: offset: attrs: attrsLen: ) Apply language-specific tailoring to the breaks in
attrs.The line breaks are assumed to have been produced by [func
Pango.default_break].If
offsetis not -1, it is used to apply attributes fromanalysisthat are relevant to line breaking.Note that it is better to pass -1 for
offsetand use [funcPango.attr_break] to apply attributes to the whole paragraph.Declaration
Swift
@inlinable func tailorBreak(text: UnsafePointer<CChar>!, length: Int, offset: Int, attrs: UnsafeMutablePointer<PangoLogAttr>!, attrsLen: Int) -
shapeEngineExtension methodunused, reserved
Declaration
Swift
@inlinable var shapeEngine: UnsafeMutablePointer<PangoEngineShape>! { get set } -
langEngineExtension methodunused, reserved
Declaration
Swift
@inlinable var langEngine: UnsafeMutablePointer<PangoEngineLang>! { get set } -
fontExtension methodthe font for this segment.
Declaration
Swift
@inlinable var font: FontRef! { get set } -
levelExtension methodthe bidirectional level for this segment.
Declaration
Swift
@inlinable var level: guint8 { get set } -
gravityExtension methodthe glyph orientation for this segment (A
PangoGravity).Declaration
Swift
@inlinable var gravity: guint8 { get set } -
flagsExtension methodboolean flags for this segment (Since: 1.16).
Declaration
Swift
@inlinable var flags: guint8 { get set } -
scriptExtension methodthe detected script for this segment (A
PangoScript) (Since: 1.18).Declaration
Swift
@inlinable var script: guint8 { get set } -
languageExtension methodthe detected language for this segment.
Declaration
Swift
@inlinable var language: LanguageRef! { get set } -
extraAttrsExtension methodextra attributes for this segment.
Declaration
Swift
@inlinable var extraAttrs: SListRef! { get set }
View on GitHub
Install in Dash
AnalysisProtocol Protocol Reference