I'm using dompdf 0.5.2 and having the problem that when there is an accent on a line, the first character from the next line is moved into it, like:
This is a first line with áccent. T
his is a second line.
Notice the T at the end of the first line, it belongs to the second. It happens both with a default and a custom loaded font. Also tried with UTF-8 and ISO-8859-1 encodings.
The solution that worked, taken from here, is adding the following line of code to the dompdf file include/text_frame_reflower.cls.php
after line 246:
$split = mb_strlen(mb_substr($this->_frame->get_text(), 0, $split), 'UTF-8');
Another solution that worked for me is using the wordwrap PHP function on your text/string .
If someone have the same issue with the 0.7.0-beta version, the solution is adding the following line to the file src/Dompdf/FrameReflower/Text.php on line 272 (just before if ($split == 0) {
):
$split = mb_strlen(mb_substr($this->_frame->get_text(), 0, $split), 'UTF-8');