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.
This commit is contained in:
Carl Worth 2006-04-25 05:44:08 -07:00
parent 6723547f00
commit 22ab0e5f16
3 changed files with 24 additions and 5 deletions

View file

@ -328,6 +328,15 @@ _cairo_paginated_surface_get_extents (void *abstract_surface,
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_paginated_surface_backend = {
_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 */

View file

@ -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 *

View file

@ -1352,6 +1352,16 @@ _cairo_ps_surface_get_extents (void *abstract_surface,
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 cairo_ps_surface_backend = {
_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 */