[cairo-commit] src/cairo-paginated-surface.c src/cairo-pdf-surface.c src/cairo-ps-surface.c

Carl Worth cworth at kemper.freedesktop.org
Tue Apr 25 06:37:02 PDT 2006


 src/cairo-paginated-surface.c |   11 ++++++++++-
 src/cairo-pdf-surface.c       |    6 +++---
 src/cairo-ps-surface.c        |   12 +++++++++++-
 3 files changed, 24 insertions(+), 5 deletions(-)

New commits:
diff-tree 22ab0e5f1615e28f77d8dc0c8a26929e0f0279b6 (from 6723547f0035e6c41abee165ebefb7406e40b7d8)
Author: Carl Worth <cworth at cworth.org>
Date:   Tue Apr 25 05:44:08 2006 -0700

    Fix default font options for PS and PDF backends.
    
    The paginated surface layer was missing its get_font_options function.
    It now defers to the target surface. The PDF backend already had a
    get_font_options function, but the PS backend was also missing it.
    
    This should fix the problem with 72DPI hinting seen in glyph paths in
    PostScript output.
    
    Thanks to Owen Taylor for identifying this problem and the correct
    fix.

diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 34b42e7..b839556 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -328,6 +328,15 @@ _cairo_paginated_surface_get_extents (vo
     return _cairo_surface_get_extents (surface->target, rectangle);
 }
 
+static void
+_cairo_paginated_surface_get_font_options (void                  *abstract_surface,
+					   cairo_font_options_t  *options)
+{
+    cairo_paginated_surface_t *surface = abstract_surface;
+
+    return cairo_surface_get_font_options (surface->target, options);
+}
+
 static cairo_int_status_t
 _cairo_paginated_surface_paint (void			*abstract_surface,
 				cairo_operator_t	 op,
@@ -476,7 +485,7 @@ const cairo_surface_backend_t cairo_pagi
     _cairo_paginated_surface_intersect_clip_path,
     _cairo_paginated_surface_get_extents,
     NULL, /* old_show_glyphs */
-    NULL, /* get_font_options */
+    _cairo_paginated_surface_get_font_options,
     NULL, /* flush */
     NULL, /* mark_dirty_rectangle */
     NULL, /* scaled_font_fini */
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index fb3c7e1..93a8217 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -1479,10 +1479,10 @@ static void
 _cairo_pdf_surface_get_font_options (void                  *abstract_surface,
 				     cairo_font_options_t  *options)
 {
-  _cairo_font_options_init_default (options);
+    _cairo_font_options_init_default (options);
 
-  cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
-  cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
+    cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
+    cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
 }
 
 static cairo_pdf_document_t *
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 33aa663..cf77db2 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1352,6 +1352,16 @@ _cairo_ps_surface_get_extents (void		  *
     return CAIRO_STATUS_SUCCESS;
 }
 
+static void
+_cairo_ps_surface_get_font_options (void                  *abstract_surface,
+				    cairo_font_options_t  *options)
+{
+    _cairo_font_options_init_default (options);
+
+    cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
+    cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
+}
+
 static cairo_int_status_t
 _cairo_ps_surface_paint (void			*abstract_surface,
 			 cairo_operator_t	 op,
@@ -1640,7 +1650,7 @@ static const cairo_surface_backend_t cai
     _cairo_ps_surface_intersect_clip_path,
     _cairo_ps_surface_get_extents,
     NULL, /* old_show_glyphs */
-    NULL, /* get_font_options */
+    _cairo_ps_surface_get_font_options,
     NULL, /* flush */
     NULL, /* mark_dirty_rectangle */
     NULL, /* scaled_font_fini */


More information about the cairo-commit mailing list