More the majority of the typedefs from cairoint.h to
cairo-types-private.h and fixup cairo-pdf-operators-private.h to
avoid including cairoint.h.
A better approach would seem to be to rationalise cairoint.h so that it
only provides the symbol aliasing, moving the types and functions to
more appropriate private headers. However, this fixes the immediate
problem of running make check!
A problem with the previous commit for checking the PS level is that
with the default PS level of 3 it prevents PS files from printing on
Level 2 printers even if no Level 3 operators are used.
As the PS header is created after the page content has been generated,
it is easy to check the PS Level actually required and set this in the
header and PS level check code.
http://bugzilla.mozilla.org/show_bug.cgi?id=406376
reported problems with cairo PostScipt output printing black boxes
instead of images. This was found to caused by printing Level 3
PostScript to a Level 2 printer.
Add some PostScript code to to the cairo PS prolog to check the
language level of the printer. If the printer can not print the job, a
message stating the required language level is printed and the job is
aborted.
This should fix the problems reported in
http://lists.cairographics.org/archives/cairo/2007-November/012172.html
The problem is that GetCharacterPlacement() used in
_win32_scaled_font_text_to_glyphs returns utf16 instead of glyph
indices when Type 1 fonts are used.
This has been fixed by using GetGlyphIndices instead of
GetCharacterPlacement if the font is a Type 1.
_win32_scaled_font_map_glyphs_to_unicode has been fixed work with Type 1
glyph indices. It now uses GetFontUnicodeRanges and GetGlyphIndices
to do the reverse lookup.
Now that the content stream is no longer split into multiple streams
it is not possible to implement a copy_page function that shares the
common content between pages.
Remove this function so the paginated surface will rewrite the
content from the meta surface.
Each fallback image needs to be in a separate group in the knockout
group. Otherwise transparent edges of adjacent fallback images will
composite with each other creating visible seams between the images.
The PDF surface needs to know when the fallback images start so it can
close off the content stream and create a knockout transparency group
for the fallback images. Currently it does this by looking for
operations with CAIRO_OPERATOR_SOURCE. PDF returns unsupported for
_SOURCE during the analysis phase so _SOURCE will never appear during
native operations. However this prevents the PDF surface from
supporting _SOURCE operations that can be natively supported. For
example a _SOURCE operation with nothing painting under it can be
converted to _OVER and natively supported.
A third mode, CAIRO_PAGINATED_MODE_FALLBACK, has been added. The
paginated surface will set this mode before it paints finer-grained
fallback images.
Previously this was done in a separate group. Now that the PDF backend
has been re-organized to not interrupt the content stream the clipping
can be done in the same stream.
To fix this performance issue
http://lists.cairographics.org/archives/cairo/2007-December/012197.html
the PDF surface needs to avoid starting and stopping the content
stream every time it emits a pattern. This patch makes the PDF surface
store a list of all patterns used while the content stream is written
out then write out all the patterns after the content stream is
closed.
Use _cairo_pattern_create_copy()/cairo_pattern_destroy() instead of
_cairo_pattern_init_copy()/_cairo_pattern_fini() so the PDF backend
can reference the patterns and destroy them later.
This code is never used because outline glyphs that go through the
fallback path are always embedded with Type 1 fallback. The only fonts
that are embedded as Type 3 are bitmap fonts.
After using fopen() and friends check the global errno to determine the
most appropriate error return - especially important when running
memfault, where correct reporting of NO_MEMORY errors is required.
Previously, _cairo_traps_extents () returned the extents
p1={INT_MAX, INT_MAX} p2={INT_MIN, INT_MIN} for an empty traps leading
to integer overflow when computing the width using p2-p1 and causing
further overflows within libpixman. [For example this caused the
allocation of massive regions with test/mask and the PS backend.]
&image_extra was being passed instead of image_extra to release; the
bug only manifested itself when the particular backend did something
with image_extra.
This demonstrates an error in cairo where miter joins are replaced with
bevels at high scale factors due to a test added to eliminate wild miters
drawn when the line faces are nearly parallel.
Do not return after encountering the first error whilst closing streams,
but continue to close any auxiliary streams before finally reporting the
error. Also during finalize check that we have closed any streams that
may have been left open after encountering an error.
Test for an invalid matrix before use. Whilst this has no effect on the
result, an INVALID_MATRIX error will be raised on the context, placing
the guards first makes the code obviously safe and avoids manipulation
of invalid matrices.
This was failing with more than one level of push/pop group. The
problem was that the meta surface replay in PS/PDF emit_meta_surface
was replaying all the meta surface commands insteads of only the
natively supported commands. The analysis surface has also been
changed to replay meta surface patterns back to the one analysis
surface instead of creating a separate analysis surface for each
pattern. The analysis surface now transforms bounding boxes with the
meta surface pattern matrix so that fallback regions are correctly
tracked.
Bug report and proposed patch at:
http://lists.cairographics.org/archives/cairo/2007-December/012529.html
On Windows the tmpfile() function creates the file in the root
directory. This will fail if the user does not have write access to the
root directory.
Implement _cairo_win32_tmpfile() that is #defined as tmpfile() on
Windows. This function uses GetTempPath() and GetTempFileName() to
create the temporary file. CreateFile() is used to open the file so
the DELETE_ON_CLOSE flag can be set.