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:
- Assume the current point is (x, y)
- Render the current glyph at (x + x_offset, y + y_offset),
- Advance the current point to (x + width, y)
- 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.
-
Untyped pointer to the underlying
PangoGlyphGeometryinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
_ptrDefault implementationTyped pointer to the underlying
PangoGlyphGeometryinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
PangoGlyphGeometryinstance.Declaration
Swift
var _ptr: UnsafeMutablePointer<PangoGlyphGeometry>! { get } -
Required Initialiser for types conforming to
GlyphGeometryProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
widthExtension methodthe logical width to use for the the character.
Declaration
Swift
@inlinable var width: PangoGlyphUnit { get set } -
xOffsetExtension methodhorizontal offset from nominal character position.
Declaration
Swift
@inlinable var xOffset: PangoGlyphUnit { get set } -
yOffsetExtension methodvertical offset from nominal character position.
Declaration
Swift
@inlinable var yOffset: PangoGlyphUnit { get set }
View on GitHub
Install in Dash
GlyphGeometryProtocol Protocol Reference