Gravity.getForScriptAndWidth

pango.types.Gravity getForScriptAndWidth(pango.types.Script script, bool wide, pango.types.Gravity baseGravity, pango.types.GravityHint hint)

Returns the gravity to use in laying out a single character or pango.item.Item.

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

This function is similar to funcPango.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.types.Gravity.Auto, it is first replaced with the preferred gravity of script.

Parameters

scriptpango.types.Script to query
widetrue for wide characters as returned by glib.global.unicharIswide
baseGravitybase gravity of the paragraph
hintorientation hint

Returns

resolved gravity suitable to use for a run of text

with script and wide.