[cairo-commit] cairo/src cairo-pdf-surface.c,1.57,1.58
Owen Taylor
commit at pdx.freedesktop.org
Sat Aug 20 07:05:17 EST 2005
Committed by: otaylor
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv29961/src
Modified Files:
cairo-pdf-surface.c
Log Message:
2005-08-19 Owen Taylor <otaylor at redhat.com>
* src/cairo-pdf-surface.c (_cairo_pdf_surface_show_glyphs):
Ignore really small fonts, since size zero fonts give xpdf
fits. (#2938)
Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- cairo-pdf-surface.c 19 Aug 2005 17:36:44 -0000 1.57
+++ cairo-pdf-surface.c 19 Aug 2005 21:05:14 -0000 1.58
@@ -1306,6 +1306,7 @@
cairo_output_stream_t *output = document->output_stream;
cairo_font_subset_t *pdf_font;
int i, index;
+ double det;
/* XXX: Need to fix this to work with a general cairo_scaled_font_t. */
if (! _cairo_scaled_font_is_ft (scaled_font))
@@ -1315,6 +1316,13 @@
if (pdf_font == NULL)
return CAIRO_STATUS_NO_MEMORY;
+ /* Some PDF viewers (at least older versions of xpdf) have trouble with
+ * size 0 fonts. If the font size is less than 1/1000pt, ignore the
+ * font */
+ _cairo_matrix_compute_determinant (&scaled_font->scale, &det);
+ if (fabs (det) < 0.000001)
+ return CAIRO_STATUS_SUCCESS;
+
emit_pattern (surface, pattern);
_cairo_output_stream_printf (output,
More information about the cairo-commit
mailing list