[Geany-Devel] Printing

Roger Booth rbooth at kabooth.com
Sat Nov 3 17:32:45 UTC 2012


On 11/02/2012 02:03 PM, Colomban Wendling wrote:
> 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
Well, I've totally blown my printer ink budget for the month :-) . But 
these patches look great. And I like that the new code prints longer 
lines without wrapping. I'd definitely give up a few lines per page in 
trade for longer lines w/o wrapping.

As for the vertical line thing, sorry I kept harping on that. Until last 
turn-around, I was only testing page one, and failed to realize it 
wasn't that the line height calc was wrong, instead you just always draw 
to just above the page number. So I have an easy (personal) fix. I'll 
just comment the line-drawing code in my version. I tried it, and I'm 
happy without the line. So thats the last problem I know of in Geany's code.

I'm willing to work on the Scintilla code base to develop a permanent 
vertical-line-drawing solution. But I've been a Windows programmer all 
my career until a year ago, and since then its like drinking from a 
firehose. I've destroyed my Linux installation twice, having to 
reinstall from scratch (fortunately I put home on a separate partition). 
And I've since somehow sort of broken the latest install; it won't 
automount. That's actually forced me to learn about dmesg and pmount. 
Anyway, beyond that, there's learning GTK+ and the deprecation caused by 
3.0, which I note Geany is dealing with. My wife and I just bought 
Android tablets, so now I have to learn Java. There's more, but maybe 
you get the idea. Anyway, I'll try to help Scintilla with printing, and 
I'll try not to be an annoying nooby.



I just registered an account on Gnome Bugzilla. I found an existing bug 
complaining that the print dialog showed no notice about the correct 
syntax for printing ranges of pages. I added a request for an error 
message when the user screws up.

I'll go back through my posts and see if I should submit other bugs to 
Scintilla or Gnome.

What about patch 4

Scintilla: properly update the Pango contexts for the
  target surface

I assume you will submit it?

Regards
  Roger



More information about the Devel mailing list