Re: Question for C++ guru's..

From: Tomas Frydrych <tf_at_o-hand.com>
Date: Wed Dec 27 2006 - 12:07:36 CET

Hi Martin,

msevior@physics.unimelb.edu.au wrote:
> It's not a problem with quickPrint. quickPrint works perfectly. The
> problem is when rebuilding a full layout the old non-quickPrint way. It
> appears to be related to the fact that the X11 screen returns a resolution
> of 96 dpi whereas the gnomeprint context has 72 dpi hardcoded. I put in
> some code to work around this for non-quickPrints, which is if the view is
> in Normal Mode.
>
> Like this:
>
>
> UT_uint32 GR_UnixPangoPrintGraphics::getFontHeight(GR_Font * fnt)
> {
> return
> static_cast<UT_uint32>(static_cast<double>(GR_UnixPangoGraphics::getFontHeight(fnt))*m_dResRatio);
> }
>
> I would welcome a better solution.

That is the correct fix -- we obtain the font metrics for the screen and
impose it on the printer, so when operating on the printer we have to
scale to the gnome print dpi. The reason this bug was not showing up in
the quickPrint is simply because there the layout is already done, so
that these methods are not called. (Strictly speaking, it would be
enough to override only the three methods that take the font as
parameter, as the three without parameter are just wrappers around them.)

There is still problem with lists (in quickPrint) -- it seems that the
label heights are calculated for the screen resolution; I think the
height of the field is cached somewhere and not recalculated when the
printing graphics is slipped in (bullets are not printed at all here, I
will see why not).

Tomas
Received on Wed Dec 27 12:08:16 2006

This archive was generated by hypermail 2.1.8 : Wed Dec 27 2006 - 12:08:17 CET