Re: [Evolution-hackers] GnuCash print problem patch



On Friday 13 April 2007 16:54, Paul Andreassen wrote:
> On Friday 13 April 2007 03:13, Srinivasa Ragavan wrote:
> > Paul,
> >
> > Yes. Before getting into the patch, can you let us know the issue the
> > patch is addressing? It would be helpful while reviewing the patch.
> >
> > -Srini
> >
> > On Thu, 2007-04-12 at 21:41 +1000, Paul Andreassen wrote:
> > > Hello,
> > >
> > > Is this where gtkhtml is maintained?  If so could someone look at this
> > > patch and tell me if it acceptable for inclusion.  I'm not sure I
> > > understand how all the library code goes together.
>
> Thanks for the reply.
>
> When printing or print previewing of a GnuCash report the font changes from
> the screen font to an unset and unchangeable one.  In my case it changes
> from the screen font of "San Regular 10" to "Serf Regular 12".  This
> results in very large printed reports.
>
> This patch sets the font for text areas during printing but I don't
> understand why it already does the right thing for the screen.  My patch
> still has a placement problem for some characters.  The C and T in the
> follow pngs show the problem.
>
> Thanks again,
> Paul

The GnuCash report print bug is listed at 
http://bugzilla.gnome.org/show_bug.cgi?id=350408

After looking further into the problem, it appears that GnomePrint doesn't 
have a setable default font.  And because the pango attrs don't set a font 
face or size if the required font is the default, the result is the items are 
printed in GnomePrint default of "Serf Regular 12".  My patch changes this to 
explicitly set the pango attrs resulting with the items printed in that font.

As for the character placement problem, it appears to be a problem only with 
the [Dejavu] Sans and [Dejavu] Serf fonts at point sizes 9 and 10 when 
printing.  This maybe a Ubuntu 6.06 problem.

Looking at gtkhtml-3.14.0/src/htmlprinter.c from the most recent source, it 
appears that the new gtk_print allows the setting of a default font.  Please 
make this user accessable even if its in a gconf file.
HTMLPainter *
html_printer_new (GtkWidget *widget, GtkPrintContext *context)
{
        const PangoFontDescription *desc;
        HTMLPrinter *printer;
        HTMLPainter *painter;

        printer = g_object_new (HTML_TYPE_PRINTER, NULL);
        printer->context = g_object_ref (context);

        painter = HTML_PAINTER (printer);
        html_painter_set_widget (painter, widget);
        desc = pango_font_description_from_string ("sans 8");/* FIXME font 
hardcoded*/
        painter->pango_context = gtk_print_context_create_pango_context 
(context);
        pango_context_set_font_description (painter->pango_context, desc);
        return painter;

}

My web page on this problem with fixes is at 
http://members.iinet.com.au/~paulone/gnucash/

Thanks,
Paul
-- 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]