pspp-dev
[Top][All Lists]
Advanced

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

Re: Another possible bug in src/output/cairo.c


From: Ben Pfaff
Subject: Re: Another possible bug in src/output/cairo.c
Date: Sat, 19 Jan 2013 11:01:22 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 14, 2013 at 07:41:58PM +0100, John Darrington wrote:
> There are the lines:
> 
>   xr->left_margin = parse_dimension (opt (d, o, "left-margin", ".5in"));
>   xr->right_margin = parse_dimension (opt (d, o, "right-margin", ".5in"));
>   xr->top_margin = parse_dimension (opt (d, o, "top-margin", ".5in"));
>   xr->bottom_margin = parse_dimension (opt (d, o, "bottom-margin", ".5in"));
> 
> Now the comment to parse_dimension says the return value is in 1/72000 of an 
> inch.
> That is in 1/1000 of a point.
> 
> Later there is code like:
> 
>       cairo_translate (cairo,
>                      xr_to_pt (xr->left_margin),
>                      xr_to_pt (xr->top_margin));
> 
> and xr_to_pt is defined as:
> 
> 
> /* Conversions to and from points. */
> static double
> xr_to_pt (int x)
> {
>   return x / (double) PANGO_SCALE;

(Well it actually says XR_SCALE but that's defined as PANGO_SCALE.)

> }
> 
> This would be correct if PANGO_SCALE was 1000  but on my system it is defined 
> as
> 1024
> 
> 
> Is there an error here somewhere?

I think that we can just change the definition of XR_POINT to 1000.  Do
you see any problems with that?  It doesn't obviously change the
output.  (A difference of 2.4% is difficult to spot.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]