Add win32 surface intended for use with printer DCs; GDI will be used
as much as possible, and the surface will be a paginated surface
that supports fine-grained fallback.
(Original work from Adrian Johnson; additional fixes by me.)
Same for FT_Render_Glyph.
When the user asks us to render a glyph that is not available in the font,
it's mostly an unavoidable kind of error for them, as in, they can't
avoid such a call. So it's not nice to put cairo_t in an error state and
refuse any further drawying.
Many PDF files are created using buggy software and cause such glpyh-not-found
errors for CID 0 for example.
Eventually we should propagate these kind of errors up and return it from
the function call causing it, but that needs API change to add return value
to all text functions, so for now we just ignore these errors.
The finer-grained fallbacks would not work correctly if the page
was set to a larger size.
Add _cairo_paginated_surface_set_size() function that is called
from cairo_ps_surface_set_size() and cairo_pdf_surface_set_size().
The DSC and EPS specifications do not allow the use of initclip.
Instead each page is wrapped in a gsave/restore pair and a
"grestore gsave" is emitted when the clip path is reset.
The cairo_matrix_multiply(out,a,b) docs say that it is equivalent to applying
matrix a first, followed by b. Looking at _cairo_gstate_backend_to_user() we should
apply device_transform_inverse followed by ctm_inverse. That's what we do now.
This patch adds cairo_surface_copy_page and cairo_surface_show_page
as public methods, leaving the previous cairo_show_page variants as
shorthands. copy_page/show_page are specific to the surface, not
to the context, so they need to be surface methods.
The BC (background color) in the smask of the recently added
cairo_mask() support was causing Ghostscript to crash due to the wrong
number of BC values. The BC entry has been removed as BC default color
is already what we want.
Under rare circumstances we may need to extract a surface that
represents a bitmap with width==0 and rows==0. Detect this case at the
start and simply return a zero-sized surface.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12284.
This does introduce some reported failures from the cairo-pdf backend
into the test suite. However, in all cases the output PDF files look
fine when viewed with acroread. It looks like all of the problems
could be fixed by using cairo_rectangle;cairo_fill along with
CAIRO_EXTEND_PAD when drawing images with cairo inside poppler.
However, I'm not yet filing a bug against poppler and disabling these
tests because we need to _implement_ CAIRO_EXTEND_PAD before we can
tell poppler to start using it.
This test demonstrates a bug when compositing an rgb24 image over an argb32
image, (the implementation appears to be examining the alpha channel
rather than ignoring it).
The optimization that avoids replaying commands prior to an unclipped
CLEAR operation now starts playback from the first command after the
CLEAR. This avoids the need to handle the unclipped CLEAR in the PDF
surface.
As opposed to the CAIRO_TEST_TARGET env var which lists the exact
targets to test, CAIRO_TEST_TARGET_EXCLUDE instead supplies a list of
targets to filter from the testing set. This is useful under
circumstances where the build environment prevents testing of a target,
for example no DirectFB support or the glitz library is broken, but where
you still want to perform the minimal check that the code compiles.
This reverts commit 919bea6dbb.
Sadly as Behdad points out some backends do modify the glyph array and,
for example cairo-xlib-surface, hide this from the compiler with some
evil casts.
Skip the memory duplication of the incoming glyphs if we do not need
to transform them into the backend coordinate system.
As a consequence we need to constify the glyphs passed to the backend
functions.
These are failing due to (already reported) poppler bugs.
There were also problems with the gradients in the PDF
files previously, but these have recently been fixed.