Menu

#1105 Max char width may be wrong in Tcpdf->write

v1.0_(example)
open
None
1
2015-12-31
2015-12-31
No

In the Write function, the max char width is computed.
It may be wrong if adjustment is made on the letter spacing or stretching, as the last char will ignore those parameters.
As a local fix I have added a ignorelast param to GetArrStringWidth

// calculate maximum width for a single character on string
$chrw = $this->GetArrStringWidth($chars, '', '', 0, true);

As a side-note, the array_walk($chrw, array($this, 'getRawCharWidth')); function just after that place is useless, as GetArrStringWidth returns char length while getRawCharWidth expects char codes.
I suppose it's something left from old code.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB