Name
pango.GravityForScriptAndWidth -- get gravity for script and width
Synopsis
g = pango.GravityForScriptAndWidth(script, wide, base_gravity, hint)
Function
Returns the gravity to use in laying out a single character or Pango item.

The gravity is determined based on the script, East Asian width, base gravity, and hint,

This function is similar to pango.GravityForScript() 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.

This function returns resolved gravity suitable to use for a run of text with script and wide.

See pcontext:SetBaseGravity() for a list of gravity constants. See pcontext:SetGravityHint() for a list of gravity hints. See planguage:GetScripts() for a list of scripts.

Inputs
script
the Pango script to query
wide
True for wide characters
base_gravity
base gravity of the paragraph
hint
orientation hint
Results
g
resolved gravity suitable to use for a run of text

Show TOC