gravity = pango.GravityForMatrix(matrix)
This function returns the gravity of matrix, which will never be #PANGO_GRAVITY_AUTO.
matrix
#PANGO_GRAVITY_AUTO
See pcontext:SetBaseGravity() for a list of gravity constants.