Commit graph

1084 commits

Author SHA1 Message Date
Zhe Su
fe8bf47afc Support fontconfig embeddedbitmap option/handle transformation issue as well. 2006-04-25 10:20:42 -07:00
Carl Worth
22ab0e5f16 Fix default font options for PS and PDF backends.
The paginated surface layer was missing its get_font_options function.
It now defers to the target surface. The PDF backend already had a
get_font_options function, but the PS backend was also missing it.

This should fix the problem with 72DPI hinting seen in glyph paths in
PostScript output.

Thanks to Owen Taylor for identifying this problem and the correct
fix.
2006-04-25 05:44:08 -07:00
Keith Packard
8d635a3aa9 PDF: Execute entire path in user coordinates when stroking so that line params are interpreted correctly 2006-04-25 04:04:10 -07:00
Carl Worth
134c508bf0 PDF: Add SMask output and simplify analysis to support all OVER operations.
With this SMask support, the PDF backend is now able to handle a very
large subset of the things that are likely to be thrown at it in
common operation, (for example, when handling images and text from web
pages).
2006-04-25 03:45:37 -07:00
Carl Worth
c072119043 PDF: Remove unused backend functions.
Since the switch to using paginated, we have a guarantee that the following functions
will never be called. So we drop them now:

	_cairo_pdf_surface_composite
	_cairo_pdf_surface_fill_rectangles
	_cairo_pdf_surface_composite_trapezoids
	_cairo_pdf_surface_old_show_glyphs
2006-04-25 03:26:25 -07:00
Carl Worth
32a7edc42d PDF: Fix surface pattern transformation and support for EXTEND_NONE.
There's a bunch of careful matrix transformation here needed to
resolve the differences between cairo and PDF pattern matrices,
(primarily due to the different location for the origin).

This fixes the several PDF test suite failures that recently appeared
when we switched from ARGB32 to RGB24 source surface patterns.
2006-04-24 16:11:21 -07:00
Carl Worth
28e25e1cce Fix broken error-checking in cairo_{ps,pdf}_surface_set_dpi 2006-04-24 12:40:30 -07:00
Carl Worth
12c4c375af Fix invalid restore that was causing subsequent pages after first to be inverted 2006-04-24 11:15:09 -07:00
Carl Worth
7fa8bfd738 PDF: Cleanup error handling of emit_image_rgb_data 2006-04-20 10:01:45 -07:00
Carl Worth
c5d5687ac0 PDF: Add simple implementation of _cairo_pdf_surface_show_glyphs (text as paths).
This isn't very exciting text output---it simply turns every call to
cairo_show_glyphs into a single filled path. But at the very least,
text will no longer trigger image fallbacks for the PDF backend.

With this commit, the following tests change from all-fallback to
all-native for the PDF backend:

	show-text-current-point
	text-antialias-gray
	text-antialias-none
	text-antialias-subpixel
	text-cache-crash
	text-rotate

There are rasterization differences in the output (cairo vs. freetype)
so this commit also adds new PDF-specific reference images for some of
those tests so that the suite continues to report PASS.
2006-04-19 11:07:19 -07:00
Carl Worth
ab2546009f Use fallbacks in PDF backend for CAIRO_ANTIALIAS_NONE.
Perhaps there's a way to preserve that hint in PDF output, but until
we have code that actually does that, the correct thing to do is to
call it unsupported and let the fallbacks do their thing.

With this commit, the two regressions that were recently introduced
now pass again. Specifically:

	rectangle-rounding-error
	unantialiased-shapes
2006-04-18 23:31:53 -07:00
Carl Worth
241c6480cd Add implementation of _cairo_pdf_surface_paint (and fix emit_surface_pattern).
Fix general broken-ness in emit_surface_pattern, enough so that a new
implementation of _cairo_pdf_surface_paint does something useful. With
this commit, the following tests switch from all-fallback to
all-native and still pass the test suite with flying colors:

	caps-joins
	caps-sub-paths
	clip-fill-rule
	clip-fill-rule-pixel-aligned
	clip-nesting
	clip-twice
	dash-caps-joins
	dash-offset-negative
	leaky-polygon
	line-width
	paint
	path-data
	transforms

Meanwhile, the following two tests also switch from fallback to
native, but cause the test suite to complain about failures. These
both look like a mostly harmless failure to respect the ANTIALIAS_NONE
hint in the PDF output:

	rectangle-rounding-error-pdf-argb32-out.pdf
	unantialiased-shapes-pdf-argb32-out.pdf
2006-04-18 23:31:52 -07:00
Carl Worth
8be1697f2b Fix stale code in comment. 2006-04-18 23:31:52 -07:00
Christian Biesinger
a98b44a1de Fixing bad merge
The merge in 66ed9811cc
re-added this line, which makes cairo link to C++
libraries even on non-BeOS systems.

This was originally fixed in 69acfa6576
2006-04-19 02:34:55 +02:00
Carl Worth
b1b699593b Add support for _cairo_pdf_surface_stroke.
Generalize all functions that emit a source pattern to emit both
for the stroking and non-stroking PDF properties. Also add an
implementation of _cairo_pdf_surface_stroke.

With this commit in place, the following tests change from
all-fallback to all-native output while no tests report any new
failures:

	dash-zero-legnth
	fill-and-stroke
	multi-page
	new-sub-path
	rel-path
	self-intersecting
2006-04-18 16:53:23 -07:00
Christian Biesinger
efbe40bb8f Use calloc rather than malloc+memset 2006-04-19 00:31:47 +02:00
Carl Worth
448e904b2a Merge branch 'cairo' into new-sub-path
Conflicts:

	src/cairo-path-stroke.c
	src/cairo-pdf-surface.c
	src/cairo-ps-surface.c
2006-04-18 15:18:31 -07:00
Carl Worth
3f84df97dd Enable real analysis for _cairo_pdf_surface_paint.
After this patch we have three PDF tests passing with native output:

	clip-all
	fill-rule
	nil-surface
2006-04-18 11:33:49 -07:00
Emmanuel Pacaud
170a028bfa SVG: Fix mask and try to support CAIRO_CONTENT_ALPHA.
Cairo and SVG differ in their implementation of mask. Cairo only uses alpha channel where SVG uses all channels. So, before using a surface for masking, we use a filter that sets RGB channels to 1.0.

Support for CAIRO_CONTENT_ALPHA is similar and use the same filter when a SVG alpha surface is composited.
2006-04-17 23:26:30 +02:00
Emmanuel Pacaud
9e2a2ea0da SVG: Don't insert /n/r in base64 encoded image data
That doesn't work since libxml replace them by 

They were intended to ease readability of generated files.
2006-04-17 11:07:15 +02:00
Emmanuel Pacaud
c01805bafd SVG: Don't check for content type in create_similar, and mark surface as modified when clearing it. 2006-04-17 10:21:50 +02:00
Emmanuel Pacaud
714bb88832 SVG: Add support for CAIRO_CONTENT_COLOR in create_similar.
Also add support for testing this feature in test/cairo-test.c
And a bunch of unwanted commit of sgml files.
2006-04-16 15:42:49 +02:00
Behdad Esfahbod
d0356a87f7 Implement cairo_set_scaled_font(). 2006-04-15 03:58:42 -04:00
Carl Worth
db111197ac Fix _cairo_surface_is_opaque to return FALSE not TRUE for non-image surfaces. 2006-04-14 17:29:19 -07:00
Carl Worth
b7309d065e Farm out the surface and pattern analysis functions away from cairo-ps-surface.c.
We're setting things up here for better sharing as PDF surface (and
others) now want to do some of the same analysis.
2006-04-14 17:25:54 -07:00
Carl Worth
a7f4f1b350 Move analysis of operators from cairo-ps-surface.c to cairo-operator.c 2006-04-14 17:03:39 -07:00
Carl Worth
c7fd35fac2 Add tests for PAGINATED_MODE_ANALYZE to PDF (no real analysis yet) 2006-04-14 16:50:16 -07:00
Dom Lachowicz
0e44e798b5 Change cairo_image_surface_create to zero out surface contents.
This closes bug #5816:

	Image surfaces do not start out blank by default
	https://bugs.freedesktop.org/show_bug.cgi?id=5816

This also fixes all of the test suite failures introduced by moving
the CLEAR on blank page optimization up to the paginated surface from
the PS surface.
2006-04-14 16:21:16 -07:00
Carl Worth
e8a0da637f Move optimization of CLEAR on blank page up from PS to paginated surface. 2006-04-14 16:18:36 -07:00
Carl Worth
b8fb8dc375 Add stub implementations of drawing operations for the PDF backend.
These new stubs explicitly return UNSUPPORTED unconditionally. This is
no different than the implicit UNSUPPORTED which the analysis surface
was inferring from NULL for 4 of the functions before.

However, _cairo_pdf_surface_fill was actually trying to draw things,
but without correctly characterizing it during the analysis stage.
This was just an oversight, as the PDF surface was always triggereing
full page fall backs anway due to the initial unsupported paint with
CLEAR.

Now, we explicitly return UNSUPPORTED for all drawing operations so we
get image fallbacks by design and not by accident.
2006-04-14 15:23:30 -07:00
Carl Worth
2726f68454 Update documentation of cairo_paginated_surface 2006-04-14 14:53:13 -07:00
Carl Worth
8d3a800b82 Add a start_page function to the paginated_surface_backend.
This allows for any surface using the paginated_surface backend to
easily do stuff at the beginning of each page, (such as writing out
any per-page header necessary).

This replaces some of the per-page state tracking that the PS surface
was doing, (though it still has some left for its optimization of
CLEAR on a blank page).
2006-04-14 14:46:59 -07:00
Emmanuel Pacaud
b9eb4f018e PDF: Fix typo in documentation. 2006-04-14 22:55:48 +02:00
Emmanuel Pacaud
e952e0aff8 SVG: Add documentation for public API. Fix test filenames and add testing of CAIRO_CONTENT_COLOR 2006-04-14 22:53:58 +02:00
Emmanuel Pacaud
f919ba858f SVG: Emulate CLEAR and SOURCE operators on paint call when no clipping region is defined. 2006-04-14 22:06:28 +02:00
Carl Worth
8f3c60096d Add a new cairo_paginated_surface_backend_t rather than just a single function pointer. 2006-04-14 11:33:48 -07:00
Carl Worth
5461f25df9 Fix _composite_trap_region to restore the original clip when done. 2006-04-14 11:05:37 -07:00
Carl Worth
c81569d2f1 Flesh test-paginated-surface out into a complete surface.
This adds an aactual test_paginated_surface_backend rather than just
having this test surface create a paginated surface around an image
surface. This is a more realistic test of what a paginated surface is
and should be more useful as an example of how to use the paginated
surface, (and in particular the analysis portions).
2006-04-14 11:05:35 -07:00
Carl Worth
11b4d24671 Move cairo_pdf_surface_backend to file end so it's easier to find. 2006-04-14 09:36:41 -07:00
Jeff Muizelaar
2078557c5c Fix skipping zero length dash segments in dash_start.
The extra check makes sure zero length segments are not skipped when computing
the dash start state. This is needed so that we get proper line capping if, for
example, the first dash segment has zero length and we have a dash offset of
zero.
2006-04-14 01:51:26 -04:00
Jeff Muizelaar
5eaf71e77b Move the test for zero length sub edges below the computation of faces.
Face computation still works if a line has zero length, all that is needed is a
slope and a point. This patch fixes bug #5561 because the faces are initialized
even if the segment has zero length as expected by
_cairo_stroker_line_to_dashed.
2006-04-13 23:41:45 -04:00
Jeff Muizelaar
20fca01a2c Move calculation of slope outside of _cairo_stroker_add_sub_edge.
This makes the slope calculation more accurate for dashed lines by computing it
once for the entire line instead for each individual dash segment. It also
adjusts stroker_line_to() to match the new convention for
stroker_add_sub_edge().
2006-04-13 23:41:26 -04:00
Jeff Muizelaar
8a2ea660fb Check for zero length dashed lines.
This makes line_to_dashed more like line_to by returning immediately on
degenerate paths. This is needed so that we can do the slope calculation for
the entire line.
2006-04-13 23:40:21 -04:00
Carl Worth
f17b347ab4 Fix page numbers in PostScript output to start at 1 2006-04-13 07:59:52 -07:00
Carl Worth
6beababd47 Optimize PostScript file size with procedures instead of builtin operators.
This is based on a suggestion by Michael Sweet.
2006-04-12 16:19:08 -07:00
Carl Worth
d60eaab222 Add simple word wrapping to keep PostScript output within 80 columns or less. 2006-04-12 15:48:59 -07:00
Carl Worth
6a5d8fc7ff Merge branch 'ps-type3' into cairo (no bitmap support for type 3 yet).
Conflicts:

	src/cairo-hash.c
	src/cairo-ps-surface.c
2006-04-12 14:15:08 -07:00
Carl Worth
b30e281627 Add documentation for _cairo_output_stream_create_for_file. 2006-04-12 14:06:32 -07:00
Carl Worth
193b43001d Propagate stream status values through _cairo_ps_surface_finish 2006-04-12 14:06:26 -07:00
Carl Worth
d9137e56b6 Use ferror to get error checking for stdio-based output streams. 2006-04-12 13:44:14 -07:00