diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2017-05-28 09:07:54 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2017-05-28 09:12:56 +0930 |
commit | 0fd0fd0ae9ad8cfb177bb844091de98c0235917e (patch) | |
tree | 1570ecf38862c45b9fedb2c8b796102a2c3d5383 /src/cairo-type1-subset.c | |
parent | 9d44136ef8e2a1ad2c6631beb4bbdaeed7a2dad8 (diff) | |
download | cairo-0fd0fd0ae9ad8cfb177bb844091de98c0235917e.tar.gz |
subsetting: support variable fonts
If the font is a non default variant, fallback to creating a font from
the outlines.
Diffstat (limited to 'src/cairo-type1-subset.c')
-rw-r--r-- | src/cairo-type1-subset.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/cairo-type1-subset.c b/src/cairo-type1-subset.c index b15663509..16f821d9c 100644 --- a/src/cairo-type1-subset.c +++ b/src/cairo-type1-subset.c @@ -1715,14 +1715,20 @@ _cairo_type1_subset_init (cairo_type1_subset_t *type1_subset, { cairo_type1_font_subset_t font; cairo_status_t status; + cairo_bool_t is_synthetic; unsigned long length; unsigned int i; char buf[30]; - /* We need to use a fallback font generated from the synthesized outlines. */ - if (scaled_font_subset->scaled_font->backend->is_synthetic && - scaled_font_subset->scaled_font->backend->is_synthetic (scaled_font_subset->scaled_font)) - return CAIRO_INT_STATUS_UNSUPPORTED; + /* We need to use a fallback font if this font differs from the type1 outlines. */ + if (scaled_font_subset->scaled_font->backend->is_synthetic) { + status = scaled_font_subset->scaled_font->backend->is_synthetic (scaled_font_subset->scaled_font, &is_synthetic); + if (unlikely (status)) + return status; + + if (is_synthetic) + return CAIRO_INT_STATUS_UNSUPPORTED; + } status = _cairo_type1_font_subset_init (&font, scaled_font_subset, hex_encode); if (unlikely (status)) |