Copied from https://bitbucket.org/rptlab/reportlab