struct Cairo::Glyph

Overview

The Glyph structure holds information about a single glyph when drawing or measuring text. A font is (in simple terms) a collection of shapes used to draw text. A glyph is one of these shapes. There can be multiple glyphs for a single character (alternates to be used in different contexts, for example), or a glyph can be a ligature of multiple characters. Cairo doesn't expose any way of converting input text into glyphs, so in order to use the Cairo interfaces that take arrays of glyphs, you must directly access the appropriate underlying font system.

NOTE that the offsets given by x and y are not cumulative. When drawing or measuring text, each glyph is individually positioned with respect to the overall origin.

Defined in:

cairo/glyph.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(index : UInt64, x : Float64, y : Float64) #

[View source]
def self.new(glyph : LibCairo::GlyphT) #

[View source]
def self.new(glyph : LibCairo::PGlyphT) #

[View source]
def self.new #

[View source]

Instance Method Detail

def index : UInt64 #

Glyph index in the font. The exact interpretation of the glyph index depends on the font technology being used.


[View source]
def index=(index : UInt64) #

[View source]
def to_cairo_glyph : LibCairo::GlyphT #

[View source]
def to_unsafe : LibCairo::PGlyphT #

[View source]
def x : Float64 #

The offset in the X direction between the origin used for drawing or measuring the string and the origin of this glyph.


[View source]
def x=(x : Float64) #

[View source]
def y : Float64 #

The offset in the Y direction between the origin used for drawing or measuring the string and the origin of this glyph.


[View source]
def y=(y : Float64) #

[View source]