GlyphGeometryProtocol

public protocol GlyphGeometryProtocol

The PangoGlyphGeometry structure contains width and positioning information for a single glyph.

Note that width is not guaranteed to be the same as the glyph extents. Kerning and other positioning applied during shaping will affect both the width and the x_offset for the glyphs in the glyph string that results from shaping.

The information in this struct is intended for rendering the glyphs, as follows:

  1. Assume the current point is (x, y)
  2. Render the current glyph at (x + x_offset, y + y_offset),
  3. Advance the current point to (x + width, y)
  4. Render the next glyph

The GlyphGeometryProtocol protocol exposes the methods and properties of an underlying PangoGlyphGeometry 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 GlyphGeometry. Alternatively, use GlyphGeometryRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying PangoGlyphGeometry instance.

    Declaration

    Swift

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

    Typed pointer to the underlying PangoGlyphGeometry instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the PangoGlyphGeometry instance.

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<PangoGlyphGeometry>! { get }
  • Required Initialiser for types conforming to GlyphGeometryProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

GlyphGeometry Record: GlyphGeometryProtocol extension (methods and fields)

  • width Extension method

    the logical width to use for the the character.

    Declaration

    Swift

    @inlinable
    var width: PangoGlyphUnit { get set }
  • xOffset Extension method

    horizontal offset from nominal character position.

    Declaration

    Swift

    @inlinable
    var xOffset: PangoGlyphUnit { get set }
  • yOffset Extension method

    vertical offset from nominal character position.

    Declaration

    Swift

    @inlinable
    var yOffset: PangoGlyphUnit { get set }