class Cairo::TextExtents
- Cairo::TextExtents
- Reference
- Object
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.crConstructors
- .new(x_bearing : Float64, y_bearing : Float64, width : Float64, height : Float64, x_advance : Float64, y_advance : Float64)
- .new(text_extents : LibCairo::TextExtentsT)
- .new
Instance Method Summary
-
#height : Float64
Height of the glyphs as drawn.
- #height=(height : Float64)
- #to_cairo_text_extents : LibCairo::TextExtentsT
- #to_unsafe : LibCairo::PTextExtentsT
-
#width : Float64
Width of the glyphs as drawn.
- #width=(width : Float64)
-
#x_advance : Float64
Distance to advance in the X direction after drawing these glyphs.
- #x_advance=(x_advance : Float64)
-
#x_bearing : Float64
The horizontal distance from the origin to the leftmost part of the glyphs as drawn.
- #x_bearing=(x_bearing : Float64)
-
#y_advance : Float64
Distance to advance in the Y direction after drawing these glyphs.
- #y_advance=(y_advance : Float64)
-
#y_bearing : Float64
The vertical distance from the origin to the topmost part of the glyphs as drawn.
- #y_bearing=(y_bearing : Float64)
Constructor Detail
Instance Method Detail
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.
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.
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.