T-gravity
Gnome::Pango::T-gravity
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
Class initialization
new
Initialization of a type class is simple and only needed when the standalone functions are used.
method new ( )
#------------------------------------------------------------------------------- #--[Enumerations]--------------------------------------------------------------- #-------------------------------------------------------------------------------
Enumerations
PangoGravity
enumeration PangoGravity defined in Gnome::Pango::T-gravity represents the orientation of glyphs in a segment
of text.
This is useful when rendering vertical text layouts. In those situations,
the layout is rotated using a non-identity Gnome::Pango::N-Matrix , and then
glyph orientation is controlled using enumeration PangoGravity defined in Gnome::Pango::T-gravity.
Not every value in this enumeration makes sense for every usage of
enumeration PangoGravity defined in Gnome::Pango::T-gravity; for example, PANGO_GRAVITY_AUTO only can be passed to
.set-base-gravity() in class Gnome::Pango::Context and can only be returned by
.get-base-gravity() in class Gnome::Pango::Context.
See also: enumeration GravityHint from Gnome::Pango::T-gravity
PANGO_GRAVITY_SOUTH; Glyphs stand upright (default) <img align="right" valign="center" src="m-south.png">PANGO_GRAVITY_EAST; Glyphs are rotated 90 degrees counter-clockwise. <img align="right" valign="center" src="m-east.png">PANGO_GRAVITY_NORTH; Glyphs are upside-down. <img align="right" valign="cener" src="m-north.png">PANGO_GRAVITY_WEST; Glyphs are rotated 90 degrees clockwise. <img align="right" valign="center" src="m-west.png">PANGO_GRAVITY_AUTO; Gravity is resolved from the context matrix
PangoGravityHint
enumeration PangoGravityHint defined in Gnome::Pango::T-gravity defines how horizontal scripts should behave in a
vertical context.
That is, English excerpts in a vertical paragraph for example.
See also enumeration Gravity from Gnome::Pango::T-gravity
PANGO_GRAVITY_HINT_NATURAL; scripts will take their natural gravity based on the base gravity and the script. This is the default.PANGO_GRAVITY_HINT_STRONG; always use the base gravity set, regardless of the script.PANGO_GRAVITY_HINT_LINE; for scripts not in their natural direction (eg. Latin in East gravity), choose per-script gravity such that every script respects the line progression. This means, Latin and Arabic will take opposite gravities and both flow top-to-bottom for example.
#------------------------------------------------------------------------------- #--[Standalone Functions]------------------------------------------------------- #-------------------------------------------------------------------------------
Standalone Functions
#-------------------------------------------------------------------------------
gravity-get-for-matrix This function is not yet available
Finds the gravity that best matches the rotation component in a Gnome::Pango::N-Matrix.
method gravity-get-for-matrix ( CArray[N-Matrix] $matrix --> PangoGravity )
$matrix; a Gnome::Pango::N-Matrix.
Return value; the gravity of $matrix, which will never be
PANGO_GRAVITY_AUTO, or PANGO_GRAVITY_SOUTH if $matrix is undefined.
#-------------------------------------------------------------------------------
gravity-get-for-script This function is not yet available
Returns the gravity to use in laying out a Gnome::Pango::N-Item.
The gravity is determined based on the script, base gravity, and hint.
If $base_gravity is PANGO_GRAVITY_AUTO, it is first replaced with the
preferred gravity of $script. To get the preferred gravity of a script,
pass PANGO_GRAVITY_AUTO and PANGO_GRAVITY_HINT_STRONG in.
method gravity-get-for-script ( PangoScript $script, PangoGravity $base-gravity, PangoGravityHint $hint --> PangoGravity )
$script;
enumeration PangoScript defined in Gnome::Pango::T-ScriptIterto query.$base-gravity; base gravity of the paragraph.
$hint; orientation hint.
Return value; resolved gravity suitable to use for a run of text
with $script.
#-------------------------------------------------------------------------------
gravity-get-for-script-and-width This function is not yet available
Returns the gravity to use in laying out a single character or Gnome::Pango::N-Item.
The gravity is determined based on the script, East Asian width, base gravity, and hint,
This function is similar to .Gravity.get-for-script() except
that this function makes a distinction between narrow/half-width and
wide/full-width characters also. Wide/full-width characters always
stand *upright*, that is, they always take the base gravity,
whereas narrow/full-width characters are always rotated in vertical
context.
If $base_gravity is PANGO_GRAVITY_AUTO, it is first replaced with the
preferred gravity of $script.
method gravity-get-for-script-and-width ( PangoScript $script, Bool() $wide, PangoGravity $base-gravity, PangoGravityHint $hint --> PangoGravity )
$script;
enumeration PangoScript defined in Gnome::Pango::T-ScriptIterto query.$wide;
Truefor wide characters as returned by g_unichar_iswide().$base-gravity; base gravity of the paragraph.
$hint; orientation hint.
Return value; resolved gravity suitable to use for a run of text
with $script and $wide..
#-------------------------------------------------------------------------------
gravity-to-rotation
Converts a enumeration PangoGravity defined in Gnome::Pango::T-gravity value to its natural rotation in radians.
Note that .rotate() in class Gnome::Pango::N-Matrix takes angle in degrees, not radians.
So, to call [method $Pango.Matrix,rotate] with the output of this function
you should multiply it by (180. / G_PI).
method gravity-to-rotation ( PangoGravity $gravity --> Num )
$gravity; gravity to query, should not be
PANGO_GRAVITY_AUTO.
Return value; the rotation value corresponding to $gravity..