class Cairo::TextExtents

Overview

The TextExtents structure stores the extents of a single glyph or a string of glyphs in user-space coordinates. Because text extents are in user-space coordinates, they are mostly, but not entirely, independent of the current transformation matrix. If you call context.scale(2.0, 2.0), text will be drawn twice as big, but the reported text extents will not be doubled. They will change slightly due to hinting (so you can't assume that metrics are independent of the transformation matrix), but otherwise will remain unchanged.

Defined in:

cairo/text_extents.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(x_bearing : Float64, y_bearing : Float64, width : Float64, height : Float64, x_advance : Float64, y_advance : Float64) #

[View source]
def self.new(text_extents : LibCairo::TextExtentsT) #

[View source]
def self.new #

[View source]

Instance Method Detail

def height : Float64 #

Height of the glyphs as drawn.


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

[View source]
def to_cairo_text_extents : LibCairo::TextExtentsT #

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

[View source]
def width : Float64 #

Width of the glyphs as drawn.


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

[View source]
def x_advance : Float64 #

Distance to advance in the X direction after drawing these glyphs.


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

[View source]
def x_bearing : Float64 #

The horizontal distance from the origin to the leftmost part of the glyphs as drawn. Positive if the glyphs lie entirely to the right of the origin.


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

[View source]
def y_advance : Float64 #

Distance to advance in the Y direction after drawing these glyphs.

Will typically be zero except for vertical text layout as found in East-Asian languages.


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

[View source]
def y_bearing : Float64 #

The vertical distance from the origin to the topmost part of the glyphs as drawn. Positive only if the glyphs lie completely below the origin; will usually be negative.


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

[View source]