diff options
author | Keith Packard <keithp@neko.keithp.com> | 2006-06-29 04:10:35 +0200 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2006-06-29 04:10:35 +0200 |
commit | 20e3a99bbaa2624ecad7b505158edc8dce706ea8 (patch) | |
tree | 8e97fd76baef8a193ac1c1c8ddc9e40be1d837ee | |
parent | 2e2799d4f921b22030eb63585dcec2ed4503fd5b (diff) | |
download | cairo-20e3a99bbaa2624ecad7b505158edc8dce706ea8.tar.gz |
Skip TrueType font output for PS/PDF until it handles vertical layout.
The TrueType font subsetting code fails to emit VHEA/VMTX headers for the
font, so WMode 1 doesn't work to switch to vertical metrics. Added a bug
about this, and changed the PS/PDF output code to just use Type3 in this
case until the bug is fixed. Updated the reference images to match the
output for PDF/PS backends for the vertical font check.
-rw-r--r-- | BUGS | 7 | ||||
-rw-r--r-- | src/cairo-font-subset.c | 3 | ||||
-rw-r--r-- | src/cairo-ft-font.c | 16 | ||||
-rw-r--r-- | src/cairo-ft-private.h | 3 | ||||
-rw-r--r-- | test/ft-text-vertical-layout-pdf-argb32-ref.png | bin | 1018 -> 956 bytes | |||
-rw-r--r-- | test/ft-text-vertical-layout-pdf-rgb24-ref.png | bin | 1037 -> 0 bytes | |||
-rw-r--r-- | test/ft-text-vertical-layout-ps-argb32-ref.png | bin | 351 -> 349 bytes | |||
-rw-r--r-- | test/ft-text-vertical-layout-ps-rgb24-ref.png | bin | 1086 -> 0 bytes |
8 files changed, 28 insertions, 1 deletions
@@ -47,3 +47,10 @@ cairo_restore ... This needs a new testcase. + +-- + +Text drawn with vertical metrics cannot currently use TrueType +subsetting for PDF/PS output as the code doesn't write out the necessary +VHEA or VMTX entries to the TrueType font objects. As a result, cairo uses +Type3 fonts which generates slightly different outlines. diff --git a/src/cairo-font-subset.c b/src/cairo-font-subset.c index 9c526cae6..f7b9105b4 100644 --- a/src/cairo-font-subset.c +++ b/src/cairo-font-subset.c @@ -132,6 +132,9 @@ _cairo_pdf_ft_font_create (cairo_scaled_font_subset_t *scaled_font_subset, if (!_cairo_scaled_font_is_ft (scaled_font_subset->scaled_font)) return CAIRO_INT_STATUS_UNSUPPORTED; + if (_cairo_ft_scaled_font_is_vertical (scaled_font_subset->scaled_font)) + return CAIRO_INT_STATUS_UNSUPPORTED; + unscaled_font = _cairo_ft_scaled_font_get_unscaled_font (scaled_font_subset->scaled_font); ft_unscaled_font = (cairo_ft_unscaled_font_t *) unscaled_font; diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c index c70e8da6e..18aa68ced 100644 --- a/src/cairo-ft-font.c +++ b/src/cairo-ft-font.c @@ -750,7 +750,7 @@ _get_bitmap_surface (FT_Bitmap *bitmap, while (count--) { *d = CAIRO_BITSWAP8 (*d); - *d++; + d++; } } #endif @@ -2409,6 +2409,20 @@ _cairo_ft_scaled_font_get_unscaled_font (cairo_scaled_font_t *abstract_font) return &scaled_font->unscaled->base; } +cairo_bool_t +_cairo_ft_scaled_font_is_vertical (cairo_scaled_font_t *scaled_font) +{ + cairo_ft_scaled_font_t *ft_scaled_font; + + if (!_cairo_scaled_font_is_ft (scaled_font)) + return FALSE; + + ft_scaled_font = (cairo_ft_scaled_font_t *) scaled_font; + if (ft_scaled_font->ft_options.load_flags & FT_LOAD_VERTICAL_LAYOUT) + return TRUE; + return FALSE; +} + void _cairo_ft_font_reset_static_data (void) { diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h index b3931bec2..34c5d9c86 100644 --- a/src/cairo-ft-private.h +++ b/src/cairo-ft-private.h @@ -64,6 +64,9 @@ _cairo_ft_unscaled_font_lock_face (cairo_ft_unscaled_font_t *unscaled); cairo_private void _cairo_ft_unscaled_font_unlock_face (cairo_ft_unscaled_font_t *unscaled); +cairo_bool_t +_cairo_ft_scaled_font_is_vertical (cairo_scaled_font_t *scaled_font); + CAIRO_END_DECLS #endif /* CAIRO_HAS_FT_FONT */ diff --git a/test/ft-text-vertical-layout-pdf-argb32-ref.png b/test/ft-text-vertical-layout-pdf-argb32-ref.png Binary files differindex c16d07017..80fbcab2a 100644 --- a/test/ft-text-vertical-layout-pdf-argb32-ref.png +++ b/test/ft-text-vertical-layout-pdf-argb32-ref.png diff --git a/test/ft-text-vertical-layout-pdf-rgb24-ref.png b/test/ft-text-vertical-layout-pdf-rgb24-ref.png Binary files differdeleted file mode 100644 index f8a839307..000000000 --- a/test/ft-text-vertical-layout-pdf-rgb24-ref.png +++ /dev/null diff --git a/test/ft-text-vertical-layout-ps-argb32-ref.png b/test/ft-text-vertical-layout-ps-argb32-ref.png Binary files differindex 3a9edb0e4..ba51c30a4 100644 --- a/test/ft-text-vertical-layout-ps-argb32-ref.png +++ b/test/ft-text-vertical-layout-ps-argb32-ref.png diff --git a/test/ft-text-vertical-layout-ps-rgb24-ref.png b/test/ft-text-vertical-layout-ps-rgb24-ref.png Binary files differdeleted file mode 100644 index 23b2fc94d..000000000 --- a/test/ft-text-vertical-layout-ps-rgb24-ref.png +++ /dev/null |