class

Cairo::TextExtents

Inherits Reference / Object

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.

Constructors

new(x_bearing : Float64, y_bearing : Float64, width : Float64, height : Float64, x_advance : Float64, y_advance : Float64)
Source
new(text_extents : LibCairo::TextExtentsT)
Source

Instance methods

height

Height of the glyphs as drawn.

Source
height=(height : Float64)
Source
to_cairo_text_extents
Source
to_unsafe
Source
width

Width of the glyphs as drawn.

Source
width=(width : Float64)
Source
x_advance

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

Source
x_advance=(x_advance : Float64)
Source
x_bearing

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.

Source
x_bearing=(x_bearing : Float64)
Source
y_advance

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.

Source
y_advance=(y_advance : Float64)
Source
y_bearing

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.

Source
y_bearing=(y_bearing : Float64)
Source