A structure specifying a transformation between user-space coordinates and device coordinates. The transformation is given by
x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
procedure Concat (Self : 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. Since: gtk+ 1.6
a Pango.Matrix.Pango_Matrix
function Copy (Self : Pango_Matrix) return Pango_Matrix
Copies a Pango.Matrix.Pango_Matrix. Since: gtk+ 1.6
the newly allocated Pango.Matrix.Pango_Matrix, which should be freed with Pango.Matrix.Free, or null if Matrix was null.
procedure Free (Self : Pango_Matrix)
Free a Pango.Matrix.Pango_Matrix created with Pango.Matrix.Copy. Since: gtk+ 1.6
function From_Object_Free (B : access Pango_Matrix) return Pango_Matrix
A structure specifying a transformation between user-space coordinates and device coordinates. The transformation is given by
x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0;
y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0;
function Get_Font_Scale_Factor (Self : Pango_Matrix) return Gdouble
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. If the scale in the X coordinate is needed as well, use Pango.Matrix.Get_Font_Scale_Factors. Since: gtk+ 1.12
the scale factor of Matrix on the height of the font, or 1.0 if Matrix is null.
procedure Get_Font_Scale_Factors
(Self : Pango_Matrix;
Xscale : out Gdouble;
Yscale : out Gdouble)
Calculates the scale factor of a matrix on the width and height of the font. That is, Xscale is the scale factor in the direction of the X coordinate, and Yscale is the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to. Note that output numbers will always be non-negative. Since: gtk+ 1.38
output scale factor in the x direction, or null
output scale factor perpendicular to the x direction, or null
function Get_Type return Glib.GType
type Pango_Matrix is record
Xx : Gdouble;
Xy : Gdouble;
Yx : Gdouble;
Yy : Gdouble;
X0 : Gdouble;
Y0 : Gdouble;
end record;
procedure Rotate (Self : in out Pango_Matrix; Degrees : Gdouble)
Changes the transformation represented by Matrix to be the transformation given by first rotating by Degrees degrees counter-clockwise then applying the original transformation. Since: gtk+ 1.6
degrees to rotate counter-clockwise
procedure Scale
(Self : in out Pango_Matrix;
Scale_X : Gdouble;
Scale_Y : Gdouble)
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. Since: gtk+ 1.6
amount to scale by in X direction
amount to scale by in Y direction
procedure Transform_Distance
(Self : Pango_Matrix;
Dx : in out Gdouble;
Dy : in out Gdouble)
Transforms the distance vector (Dx,Dy) by Matrix. This is similar to Pango.Matrix.Transform_Point except that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:
dx2 = dx1 * xx + dy1 * xy;
dy2 = dx1 * yx + dy1 * yy;
Affine transformations are position invariant, so the same vector always transforms to the same vector. If (X1,Y1) transforms to (X2,Y2) then (X1+Dx1,Y1+Dy1) will transform to (X1+Dx2,Y1+Dy2) for all values of X1 and X2. Since: gtk+ 1.16
in/out X component of a distance vector
in/out Y component of a distance vector
procedure Transform_Pixel_Rectangle
(Self : Pango_Matrix;
Rect : in out Pango_Rectangle)
First transforms the Rect using Matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in device units (pixels). This function is useful for example when you want to draw a rotated Pangolayout to an image buffer, and want to know how large the image should be and how much you should shift the layout when rendering. For better accuracy, you should use Pango.Matrix.Transform_Rectangle on original rectangle in Pango units and convert to pixels afterward using pango_extents_to_pixels's first argument. Since: gtk+ 1.16
in/out bounding box in device units, or null
procedure Transform_Point
(Self : Pango_Matrix;
X : in out Gdouble;
Y : in out Gdouble)
Transforms the point (X, Y) by Matrix. Since: gtk+ 1.16
in/out X position
in/out Y position
procedure Transform_Rectangle
(Self : Pango_Matrix;
Rect : in out Pango_Rectangle)
First transforms Rect using Matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in Pango units. This function is useful for example when you want to draw a rotated Pangolayout to an image buffer, and want to know how large the image should be and how much you should shift the layout when rendering. If you have a rectangle in device units (pixels), use Pango.Matrix.Transform_Pixel_Rectangle. If you have the rectangle in Pango units and want to convert to transformed pixel bounding box, it is more accurate to transform it first (using this function) and pass the result to pango_extents_to_pixels, first argument, for an inclusive rounded rectangle. However, there are valid reasons that you may want to convert to pixels first and then transform, for example when the transformed coordinates may overflow in Pango units (large matrix translation for example). Since: gtk+ 1.16
in/out bounding box in Pango units, or null
procedure Translate
(Self : in out Pango_Matrix;
Tx : Gdouble;
Ty : Gdouble)
Changes the transformation represented by Matrix to be the transformation given by first translating by (Tx, Ty) then applying the original transformation. Since: gtk+ 1.6
amount to translate in the X direction
amount to translate in the Y direction