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.

  • ptr

    Untyped pointer to the underlying PangoLogAttr instance.

    Declaration

    Swift

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

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

LogAttr Record: LogAttrProtocol extension (methods and fields)

  • 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(text: UnsafePointer<CChar>!, length: Int, analysis: AnalysisRef? = nil, 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<AnalysisT>(text: UnsafePointer<CChar>!, length: Int, analysis: AnalysisT?, attrsLen: Int) where AnalysisT : AnalysisProtocol
  • Convert the characters in item into glyphs.

    This is similar to [funcPango.shape_with_flags], except it takes a PangoItem instead of separate item_text and analysis arguments. It also takes log_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 as paragraph_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 method

    if set, can break line in front of character

    Declaration

    Swift

    @inlinable
    var isLineBreak: guint { get set }
  • isMandatoryBreak Extension method

    if set, must break line in front of character

    Declaration

    Swift

    @inlinable
    var isMandatoryBreak: guint { get set }
  • isCharBreak Extension method

    if set, can break here when doing character wrapping

    Declaration

    Swift

    @inlinable
    var isCharBreak: guint { get set }
  • isWhite Extension method

    is whitespace character

    Declaration

    Swift

    @inlinable
    var isWhite: guint { get set }
  • isCursorPosition Extension method

    if 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 method

    is first character in a word

    Declaration

    Swift

    @inlinable
    var isWordStart: guint { get set }
  • isWordEnd Extension method

    is first non-word char after a word Note that in degenerate cases, you could have both is_word_start and is_word_end set for some character.

    Declaration

    Swift

    @inlinable
    var isWordEnd: guint { get set }
  • isSentenceBoundary Extension method

    is 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, so is_sentence_start/is_sentence_end mark the boundaries of those sentences.

    Declaration

    Swift

    @inlinable
    var isSentenceBoundary: guint { get set }
  • isSentenceStart Extension method

    is first character in a sentence

    Declaration

    Swift

    @inlinable
    var isSentenceStart: guint { get set }
  • isSentenceEnd Extension method

    is first char after a sentence. Note that in degenerate cases, you could have both is_sentence_start and is_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 method

    if 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 method

    is a whitespace character that can possibly be expanded for justification purposes. (Since: 1.18)

    Declaration

    Swift

    @inlinable
    var isExpandableSpace: guint { get set }
  • isWordBoundary Extension method

    is a word boundary, as defined by UAX29. 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 method

    when breaking lines before this char, insert a hyphen. Since: 1.50

    Declaration

    Swift

    @inlinable
    var breakInsertsHyphen: guint { get set }
  • breakRemovesPreceding Extension method

    when breaking lines before this char, remove the preceding char. Since 1.50

    Declaration

    Swift

    @inlinable
    var breakRemovesPreceding: guint { get set }
  • reserved Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var reserved: guint { get set }