Hi,
in SVN r2050 I added native GTK 2.10 printing support. It is available once you build Geany against GTK 2.10 or above and run it with GTK 2.10 or above.
Attached is a print preview to show how it looks like for the people who can't or don't want to test it.
Current limitations: - It doesn't work at all with non-monospace fonts. The current code relies on a constant character width. Maybe this will change in the future but it would be a lot of work. There are two ways to workaround this: a) detect the widest character in the used font and use it as the general character width. This would probably result in a less pretty page layout. b) get the character width for each single printed character and use it once a character is added to the page
- It doesn't work well on Windows: * The page header is a filled black rectangle instead of just a frame. * The characters don't start at the same line height. * Between characters there are small grey vertical lines. I don't know exactly what is causing the problems on Windows, it is exactly the same code as on non-Windows systems. But maybe some of the problems are related to my testing. I didn't test the printing on Windows with a real printer, only with a PDF printer[1] to convert the printed page into a PDF file. If anyone wants to test it on Windows, any feedback is very welcome. On Linux and other non-Windows systems it should work fine.
Additional note for Windows users: To compile the current SVN code with GTK 2.10 or above(to be exactly even with GTK 2.8 but there it doesn't matter) on Windows, you have to specify "GTK210=1" on the command line to the make command, e.g. C:\geany>make GTK210=1 This is necessary because we need to link the binary against libpangocairo and libcairo but these librariers only exist with GTK
=2.8.
[1] http://sourceforge.net/projects/pdfcreator/
Regards, Enrico