I'm cautiously optimistic that this patch will fix the problem.  Can you try it?

To be applied to HEAD of master.

J'

On Fri, Jan 11, 2013 at 10:44:30AM +0100, John Darrington wrote:
     In view of the results you've showed me so far, I'm thinking that it's not 
a 
     font issue, but a problem with the way we're initialising the rendering 
     surface.
     
     
     But I'll try a few experiments at the week-end and see what comes out.
     
     J'
     
     On Fri, Jan 11, 2013 at 09:11:56AM +0100, Harry Thijssen wrote:
          
          I myself think more in the direction of default values. In the print 
file
          no size or font is declared. So maybe there is a problem with the 
defaults
          in MSWindows.
          
          I have to leave but will check later if I can find a difference in the
          print output from PSPPire  or a "normal" job. Maybe I can even find 
another
          mingw compiled program and test there output. (Any ideas for such a
          program?)
          
     
     -- 
     PGP Public key ID: 1024D/2DE827B3 
     fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
     See http://keys.gnupg.net or any PGP keyserver for public key.
     



-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

commit c9ff75f6e13368a1e6294d61e5147df759718d25
Author: John Darrington <j...@darrington.wattle.id.au>
Date:   Fri Jan 11 15:26:58 2013 +0100

    Simplify creation of pango layout in xr driver.
    
    This way seems to be simpler and avoids a kludge.  Hopefully it might also
    fix reported issues about small tables when printing on windows.

diff --git a/src/output/cairo.c b/src/output/cairo.c
index cd8f0b0..89013c2 100644
--- a/src/output/cairo.c
+++ b/src/output/cairo.c
@@ -300,39 +300,14 @@ xr_allocate (const char *name, int device_type, struct string_map *o)
 }
 
 static bool
-xr_is_72dpi (cairo_t *cr)
-{
-  cairo_surface_type_t type;
-  cairo_surface_t *surface;
-
-  surface = cairo_get_target (cr);
-  type = cairo_surface_get_type (surface);
-  return type == CAIRO_SURFACE_TYPE_PDF || type == CAIRO_SURFACE_TYPE_PS;
-}
-
-static bool
 xr_set_cairo (struct xr_driver *xr, cairo_t *cairo)
 {
-  PangoContext *context;
-  PangoFontMap *map;
   int i;
 
   xr->cairo = cairo;
 
   cairo_set_line_width (xr->cairo, xr_to_pt (xr->line_width));
 
-  map = pango_cairo_font_map_get_default ();
-  context = pango_font_map_create_context (map);
-  if (xr_is_72dpi (cairo))
-    {
-      /* Pango seems to always scale fonts according to the DPI specified
-         in the font map, even if the surface has a real DPI.  The default
-         DPI is 96, so on a 72 DPI device fonts end up being 96/72 = 133%
-         of their desired size.  We deal with this by fixing the resolution
-         here.  Presumably there is a better solution, but what? */
-      pango_cairo_context_set_resolution (context, 72.0);
-    }
-
   xr->char_width = 0;
   xr->char_height = 0;
   for (i = 0; i < XR_N_FONTS; i++)
@@ -340,7 +315,7 @@ xr_set_cairo (struct xr_driver *xr, cairo_t *cairo)
       struct xr_font *font = &xr->fonts[i];
       int char_width, char_height;
 
-      font->layout = pango_layout_new (context);
+      font->layout = pango_cairo_create_layout (cairo);
       pango_layout_set_font_description (font->layout, font->desc);
 
       pango_layout_set_text (font->layout, "0", 1);
@@ -349,8 +324,6 @@ xr_set_cairo (struct xr_driver *xr, cairo_t *cairo)
       xr->char_height = MAX (xr->char_height, char_height);
     }
 
-  g_object_unref (G_OBJECT (context));
-
   if (xr->params == NULL)
     {
       int single_width, double_width;

Attachment: signature.asc
Description: Digital signature

_______________________________________________
pspp-dev mailing list
pspp-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to