PgMatrix

Description 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.

Constructors

this
this(PangoMatrix* pangoMatrix)

Sets our main struct and passes it to the parent class

Members

Functions

getPgMatrixStruct
PangoMatrix* getPgMatrixStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

matrixConcat
void matrixConcat(PgMatrix newMatrix)

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 1.6

matrixCopy
PgMatrix matrixCopy()

Copies a PangoMatrix. Since 1.6

matrixFree
void matrixFree()

Free a PangoMatrix created with pango_matrix_copy(). Since 1.6

matrixGetFontScaleFactor
double matrixGetFontScaleFactor()

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. Since 1.12

matrixRotate
void matrixRotate(double degrees)

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 1.6

matrixScale
void matrixScale(double scaleX, double scaleY)

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 1.6

matrixTransformDistance
void matrixTransformDistance(double dx, double dy)

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 Since 1.16

matrixTransformPixelRectangle
void matrixTransformPixelRectangle(PangoRectangle* rect)

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 1.16

matrixTransformPoint
void matrixTransformPoint(double x, double y)

Transforms the point (x, y) by matrix. Since 1.16

matrixTransformRectangle
void matrixTransformRectangle(PangoRectangle* rect)

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 1.16

matrixTranslate
void matrixTranslate(double tx, double ty)

Changes the transformation represented by matrix to be the transformation given by first translating by (tx, ty) then applying the original transformation. Since 1.6

Static functions

extentsToPixels
void extentsToPixels(PangoRectangle* inclusive, PangoRectangle* nearest)

Converts extents from Pango units to device units, dividing by the PANGO_SCALE factor and performing rounding. The inclusive rectangle is converted by flooring the x/y coordinates and extending width/height, such that the final rectangle completely includes the original rectangle. The nearest rectangle is converted by rounding the coordinates of the rectangle to the nearest device unit (pixel). The rule to which argument to use is: if you want the resulting device-space rectangle to completely contain the original rectangle, pass it in as inclusive. If you want two touching-but-not-overlapping rectangles stay touching-but-not-overlapping after rounding to device units, pass them in as nearest. Since 1.16

unitsFromDouble
int unitsFromDouble(double d)

Converts a floating-point number to Pango units: multiplies it by PANGO_SCALE and rounds to nearest integer. Since 1.16

unitsToDouble
double unitsToDouble(int i)

Converts a number in Pango units to floating-point: divides it by PANGO_SCALE. Since 1.16

Variables

pangoMatrix
PangoMatrix* pangoMatrix;

the main Gtk struct

Meta