[cairo-commit] BUGS src/cairo-font-subset.c src/cairo-ft-font.c
src/cairo-ft-private.h
test/ft-text-vertical-layout-pdf-argb32-ref.png
test/ft-text-vertical-layout-pdf-rgb24-ref.png
test/ft-text-vertical-layout-ps-argb32-ref.png
test/ft-text-vertical-layout-ps-rgb24-ref.png
Keith Packard
keithp at kemper.freedesktop.org
Wed Jun 28 19:12:46 PDT 2006
BUGS | 7 +++++++
dev/null |binary
src/cairo-font-subset.c | 3 +++
src/cairo-ft-font.c | 16 +++++++++++++++-
src/cairo-ft-private.h | 3 +++
test/ft-text-vertical-layout-pdf-argb32-ref.png |binary
test/ft-text-vertical-layout-pdf-rgb24-ref.png | 0
test/ft-text-vertical-layout-ps-argb32-ref.png |binary
test/ft-text-vertical-layout-ps-rgb24-ref.png | 0
9 files changed, 28 insertions(+), 1 deletion(-)
New commits:
diff-tree 20e3a99bbaa2624ecad7b505158edc8dce706ea8 (from 2e2799d4f921b22030eb63585dcec2ed4503fd5b)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Thu Jun 29 04:10:35 2006 +0200
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.
diff --git a/BUGS b/BUGS
index b5dba11..959ad3e 100644
--- a/BUGS
+++ b/BUGS
@@ -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 9c526ca..f7b9105 100644
--- a/src/cairo-font-subset.c
+++ b/src/cairo-font-subset.c
@@ -132,6 +132,9 @@ _cairo_pdf_ft_font_create (cairo_scaled_
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 c70e8da..18aa68c 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -750,7 +750,7 @@ _get_bitmap_surface (FT_Bitmap *bi
while (count--) {
*d = CAIRO_BITSWAP8 (*d);
- *d++;
+ d++;
}
}
#endif
@@ -2409,6 +2409,20 @@ _cairo_ft_scaled_font_get_unscaled_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 b3931be..34c5d9c 100644
--- a/src/cairo-ft-private.h
+++ b/src/cairo-ft-private.h
@@ -64,6 +64,9 @@ _cairo_ft_unscaled_font_lock_face (cairo
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
index c16d070..80fbcab 100644
Binary files a/test/ft-text-vertical-layout-pdf-argb32-ref.png and b/test/ft-text-vertical-layout-pdf-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-pdf-rgb24-ref.png b/test/ft-text-vertical-layout-pdf-rgb24-ref.png
deleted file mode 100644
index f8a8393..0000000
Binary files a/test/ft-text-vertical-layout-pdf-rgb24-ref.png and /dev/null differ
diff --git a/test/ft-text-vertical-layout-ps-argb32-ref.png b/test/ft-text-vertical-layout-ps-argb32-ref.png
index 3a9edb0..ba51c30 100644
Binary files a/test/ft-text-vertical-layout-ps-argb32-ref.png and b/test/ft-text-vertical-layout-ps-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-ps-rgb24-ref.png b/test/ft-text-vertical-layout-ps-rgb24-ref.png
deleted file mode 100644
index 23b2fc9..0000000
Binary files a/test/ft-text-vertical-layout-ps-rgb24-ref.png and /dev/null differ
More information about the cairo-commit
mailing list