Structures for storing information about glyphs
pango-shape
produces a string of glyphs which can be measured or drawn to
the screen. The following structures are used to store information about glyphs.
<pango-matrix>
) ⇒ (ret <pango-matrix>
)Copies a
<pango-matrix>
.
- matrix
- a
<pango-matrix>
, can be ‘#f
’- ret
- the newly allocated
<pango-matrix>
, which should be freed withpango-matrix-free
, or ‘#f
’ if matrix was ‘#f
’.Since 1.6
<pango-matrix>
) (tx double
) (ty double
)Changes the transformation represented by matrix to be the transformation given by first translating by (tx, ty) then applying the original transformation.
- matrix
- a
<pango-matrix>
- tx
- amount to translate in the X direction
- ty
- amount to translate in the Y direction
Since 1.6
<pango-matrix>
) (scale_x double
) (scale_y double
)Changes the transformation represented by matrix to be the transformation given by first scaling by sx in the X direction and sy in the Y direction then applying the original transformation.
- matrix
- a
<pango-matrix>
- scale-x
- amount to scale by in X direction
- scale-y
- amount to scale by in Y direction
Since 1.6
<pango-matrix>
) (degrees double
)Changes the transformation represented by matrix to be the transformation given by first rotating by degrees degrees counter-clockwise then applying the original transformation.
- matrix
- a
<pango-matrix>
- degrees
- degrees to rotate counter-clockwise
Since 1.6
<pango-matrix>
) (new_matrix <pango-matrix>
)Changes the transformation represented by matrix to be the transformation given by first applying transformation given by new-matrix then applying the original transformation.
- matrix
- a
<pango-matrix>
- new-matrix
- a
<pango-matrix>
Since 1.6
<pango-matrix>
) ⇒ (ret double
)Returns the scale factor of a matrix on the height of the font. That is, the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to.
- matrix
- a
<pango-matrix>
, may be ‘#f
’- ret
- the scale factor of matrix on the height of the font, or 1.0 if matrix is ‘
#f
’.Since 1.12
<pango-glyph-string>
)Create a new
<pango-glyph-string>
.
- ret
- the newly allocated
<pango-glyph-string>
, which should be freed withpango-glyph-string-free
.
<pango-glyph-string>
) ⇒ (ret <pango-glyph-string>
)Copy a glyph string and associated storage.
- string
- a
<pango-glyph-string>
.- ret
- the newly allocated
<pango-glyph-string>
, which should be freed withpango-glyph-string-free
.
<pango-glyph-string>
) (new_len int
)Resize a glyph string to the given length.
- string
- a
<pango-glyph-string>
.- new-len
- the new length of the string.
<pango-glyph-string>
) (font <pango-font>
) ⇒ (ink_rect <pango-rectangle>
) (logical_rect <pango-rectangle>
)Compute the logical and ink extents of a glyph string. See the documentation for
pango-font-get-glyph-extents
for details about the interpretation of the rectangles.
- glyphs
- a
<pango-glyph-string>
- font
- a
<pango-font>
- ink-rect
- rectangle used to store the extents of the glyph string as drawn or ‘
#f
’ to indicate that the result is not needed.- logical-rect
- rectangle used to store the logical extents of the glyph string or ‘
#f
’ to indicate that the result is not needed.
<pango-glyph-string>
) (start int
) (end int
) (font <pango-font>
) ⇒ (ink_rect <pango-rectangle>
) (logical_rect <pango-rectangle>
)Computes the extents of a sub-portion of a glyph string. The extents are relative to the start of the glyph string range (the origin of their coordinate system is at the start of the range, not at the start of the entire glyph string).
- glyphs
- a
<pango-glyph-string>
- start
- start index
- end
- end index (the range is the set of bytes with indices such that start <= index < end)
- font
- a
<pango-font>
- ink-rect
- rectangle used to store the extents of the glyph string range as drawn or ‘
#f
’ to indicate that the result is not needed.- logical-rect
- rectangle used to store the logical extents of the glyph string range or ‘
#f
’ to indicate that the result is not needed.
<pango-glyph-string>
) ⇒ (ret int
)Computes the logical width of the glyph string as can also be computed using
pango-glyph-string-extents
. However, since this only computes the width, it's much faster. This is in fact only a convenience function that computes the sum of geometry.width for each glyph in the glyphs.
- glyphs
- a
<pango-glyph-string>
- ret
- the logical width of the glyph string.
Since 1.14