<HTML><BODY>Hi everybody,<br><br>I've recently tried printing come documents with Geany, and the result disappointed me. The right edges of lines would behave their own way, independent on printer settings and my own "field margins" patch. It seemed that the problem was deeper than just printer margins adjustment.<br><br>After all, I've created a patch containing a major code rewrite for printing.c. The main idea was to make use of Pango functionality for word wrapping and page calculations. That should fix the following issues:<br> - When printing a non-ASCII UTF-8 text, long words go past right edge of the line<br> - Add word wrapping abilities (use pango's WRAP_WORD_CHAR)<br><span> - Use Pango capabilities to calculate page borders and other things more correctly<br><br>The only disadvantage of this code is that it takes more time to calculate page borders (i.e. where in text should a new page start). That's so because it would fill Pango layout with text and get its line count, repeating until lines_per_page is reached; all these actions give a more precise result, but are time consuming. I tried printing a 300-page Harry Potter book to PDF file, and the delay between sending a job and print start was several seconds. When printing typical amount of text (25-page formatted C code), the delay is neglectible.<br><br>Please consider the patch attached and some examples. These are PDF files with "lorem ipsum" printed from Geany in several variations both in English and Russian (2-byte UTF-8 chars). "Old" refer to current version of Geany, while "new" are for version with my patch.<br><br>The patch should be considered experimental, but, if you are interested in it, I can continue work and fix issues with it, if any<br><br>Regards,<br>Alexey</span></BODY></HTML>