Width must be less than 65536 and must be calculated as the length of max length of all lines
Calculate max height for rows
Merge branch 'sapns__14582' into master2