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.

  • ptr

    Untyped pointer to the underlying PangoAnalysis instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed 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)

Analysis Record: AnalysisProtocol extension (methods and fields)

  • 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 [funcPango.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)
  • 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 be nil.

    See [funcPango.tailor_break] for language-specific breaks.

    See [funcPango.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 [funcPango.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 as paragraph_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
  • Apply language-specific tailoring to the breaks in attrs.

    The line breaks are assumed to have been produced by [funcPango.default_break].

    If offset is not -1, it is used to apply attributes from analysis 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 method

    unused, reserved

    Declaration

    Swift

    @inlinable
    var shapeEngine: UnsafeMutablePointer<PangoEngineShape>! { get set }
  • langEngine Extension method

    unused, reserved

    Declaration

    Swift

    @inlinable
    var langEngine: UnsafeMutablePointer<PangoEngineLang>! { get set }
  • font Extension method

    the font for this segment.

    Declaration

    Swift

    @inlinable
    var font: FontRef! { get set }
  • level Extension method

    the bidirectional level for this segment.

    Declaration

    Swift

    @inlinable
    var level: guint8 { get set }
  • gravity Extension method

    the glyph orientation for this segment (A PangoGravity).

    Declaration

    Swift

    @inlinable
    var gravity: guint8 { get set }
  • flags Extension method

    boolean flags for this segment (Since: 1.16).

    Declaration

    Swift

    @inlinable
    var flags: guint8 { get set }
  • script Extension method

    the detected script for this segment (A PangoScript) (Since: 1.18).

    Declaration

    Swift

    @inlinable
    var script: guint8 { get set }
  • language Extension method

    the detected language for this segment.

    Declaration

    Swift

    @inlinable
    var language: LanguageRef! { get set }
  • extraAttrs Extension method

    extra attributes for this segment.

    Declaration

    Swift

    @inlinable
    var extraAttrs: SListRef! { get set }