Le 02/11/2012 15:49, Roger Booth a écrit :
On 11/02/2012 06:59 AM, Colomban Wendling wrote:
Le 02/11/2012 01:12, Roger Booth a écrit :
I found a new problem just now. I changed the font size from 10 to 12. Text that is tab-aligned on the screen, and tab-aligned in Print Preview when the font size is 10 is no longer tab-aligned in Print Preview when the font size is 12.
I'm unable to reproduce this, could you provide a small sample showing the issue? Though this sounds like a Scintilla issue, I doubt anything we can do could change that.
Attached is an example. I see a problem in Print Preview when I change to either font size 12 or font size 8.
OK, gotcha (after a looong and boring dig into Scintilla code, beuah). Actually Scintilla doesn't setup its Pango layouts for the actual target Cairo surface but always for the widget's one, so some of the measurements were done using a layout setup for the screen, thus the sizing problem with the cairo_scale()s. Attached patch should (and does here) fix the issue (0004-Scintilla-properly-update-the-Pango-contexts-for-the.patch).
Additionally it made me see that the scaling was inaccurate because Scintilla don't use the default Pango scale but the scale for the screen (which is correct), which changes depending on the screen's DPI.
I attach all patches. They are based upon the printing-with-scintilla branch but should apply cleanly on master.
Regards, Colomban