Added text px length calc func. Fixed types.