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
PangoGlyphGeometry
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped 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)
-
width
Extension methodthe logical width to use for the the character.
Declaration
Swift
@inlinable var width: PangoGlyphUnit { get set }
-
xOffset
Extension methodhorizontal offset from nominal character position.
Declaration
Swift
@inlinable var xOffset: PangoGlyphUnit { get set }
-
yOffset
Extension methodvertical offset from nominal character position.
Declaration
Swift
@inlinable var yOffset: PangoGlyphUnit { get set }