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
PangoAnalysis
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped pointer to the underlying
PangoAnalysis
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoAnalysis
instance.Declaration
Swift
var _ptr: UnsafeMutablePointer<PangoAnalysis>! { get }
-
Required Initialiser for types conforming to
AnalysisProtocol
Declaration
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
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<LogAttrT>(text: UnsafePointer<CChar>!, length: Int, attrs: LogAttrT, attrsLen: Int) where LogAttrT : LogAttrProtocol
-
Convert the characters in
text
into glyphs.Given a segment of text and the corresponding
PangoAnalysis
structure 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
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 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
offset
is not -1, it is used to apply attributes fromanalysis
that are relevant to line breaking.Note that it is better to pass -1 for
offset
and 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)
-
shapeEngine
Extension methodunused, reserved
Declaration
Swift
@inlinable var shapeEngine: UnsafeMutablePointer<PangoEngineShape>! { get set }
-
langEngine
Extension methodunused, reserved
Declaration
Swift
@inlinable var langEngine: UnsafeMutablePointer<PangoEngineLang>! { get set }
-
font
Extension methodthe font for this segment.
Declaration
Swift
@inlinable var font: FontRef! { get set }
-
level
Extension methodthe bidirectional level for this segment.
Declaration
Swift
@inlinable var level: guint8 { get set }
-
gravity
Extension methodthe glyph orientation for this segment (A
PangoGravity
).Declaration
Swift
@inlinable var gravity: guint8 { get set }
-
flags
Extension methodboolean flags for this segment (Since: 1.16).
Declaration
Swift
@inlinable var flags: guint8 { get set }
-
script
Extension methodthe detected script for this segment (A
PangoScript
) (Since: 1.18).Declaration
Swift
@inlinable var script: guint8 { get set }
-
language
Extension methodthe detected language for this segment.
Declaration
Swift
@inlinable var language: LanguageRef! { get set }
-
extraAttrs
Extension methodextra attributes for this segment.
Declaration
Swift
@inlinable var extraAttrs: SListRef! { get set }