diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2008-09-11 08:38:39 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2008-09-11 08:38:39 +0930 |
commit | c3663324fd417a281e9cd872aa1d60101ff4602b (patch) | |
tree | 910793a710d7135b2ce3ec41142fd9d0ef4ec6b0 /src/cairo-type3-glyph-surface.c | |
parent | b74533b5a56c1d063f288343f2e8e484f3c6571f (diff) | |
download | cairo-c3663324fd417a281e9cd872aa1d60101ff4602b.tar.gz |
Add _cairo_type3_glyph_surface_analyze_glyph()
This function emits the glyph to a null stream with the side effect
that other glyphs referenced by this user-font glyph will be added to
the font subsets.
Diffstat (limited to 'src/cairo-type3-glyph-surface.c')
-rw-r--r-- | src/cairo-type3-glyph-surface.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index 4c3afb40a..aa2fda823 100644 --- a/src/cairo-type3-glyph-surface.c +++ b/src/cairo-type3-glyph-surface.c @@ -41,6 +41,7 @@ #include "cairo-type3-glyph-surface-private.h" #include "cairo-output-stream-private.h" #include "cairo-meta-surface-private.h" +#include "cairo-analysis-surface-private.h" static const cairo_surface_backend_t cairo_type3_glyph_surface_backend; @@ -349,6 +350,44 @@ _cairo_type3_glyph_surface_emit_fallback_image (cairo_type3_glyph_surface_t *sur } cairo_status_t +_cairo_type3_glyph_surface_analyze_glyph (void *abstract_surface, + unsigned long glyph_index) +{ + cairo_type3_glyph_surface_t *surface = abstract_surface; + cairo_scaled_glyph_t *scaled_glyph; + cairo_status_t status, status2; + cairo_output_stream_t *null_stream; + + null_stream = _cairo_null_stream_create (); + _cairo_type3_glyph_surface_set_stream (surface, null_stream); + status = _cairo_scaled_glyph_lookup (surface->scaled_font, + glyph_index, + CAIRO_SCALED_GLYPH_INFO_METRICS | + CAIRO_SCALED_GLYPH_INFO_META_SURFACE, + &scaled_glyph); + if (status && status != CAIRO_INT_STATUS_UNSUPPORTED) + goto cleanup; + + if (status == CAIRO_INT_STATUS_UNSUPPORTED) { + status = CAIRO_STATUS_SUCCESS; + goto cleanup; + } + + status = _cairo_meta_surface_replay (scaled_glyph->meta_surface, + &surface->base); + + if (status == CAIRO_INT_STATUS_IMAGE_FALLBACK) + status = CAIRO_STATUS_SUCCESS; + +cleanup: + status2 = _cairo_output_stream_destroy (null_stream); + if (status) + return status; + + return status2; +} + +cairo_status_t _cairo_type3_glyph_surface_emit_notdef_glyph (void *abstract_surface, cairo_output_stream_t *stream, cairo_box_t *bbox, |