Commit graph

4059 commits

Author SHA1 Message Date
Adrian Johnson
be327a7b49 PDF: Compress the content stream
The content stream compression that was previously implemented was
inadvertently bypassed when the new stream handling for meta surface
patterns was implemented.
2007-09-25 23:04:03 +09:30
Adrian Johnson
99fd9449c2 PDF: Remove duplication from the resource dictionary
The same font identifer was being added the resources every time it
was referenced.
2007-09-25 21:57:46 +09:30
Chris Wilson
dc23ecb619 [cairo-boilerplate] Do not throw an error if an exclude target is not found.
If we fail to exclude a target because it was not in the list of
targets - job done and no need to throw a tantrum.
2007-09-23 21:35:59 +01:00
Chris Wilson
4f7c5a5033 [cairo-region] Call _cairo_error() at original error site.
Before returning a fresh CAIRO_STATUS_NO_MEMORY, remember to call
cairo_error().
2007-09-23 21:35:49 +01:00
Chris Wilson
45feb13c26 [cairo-clip] Avoid a malloc(0).
Avoid a potential allocation of 0 bytes, and a potential NULL leading to an
incorrect CAIRO_STATUS_NO_MEMORY, when copying an empty clip region.
2007-09-23 21:35:25 +01:00
Adrian Johnson
77f1aa7887 Add Encapsulated PostScript support
The analysis surface will calculated the tight bounding box for each
page. A new paginated-surface backend function set_bounding_box() has
been added for passing the page bounding box to the target surface at
the end of the analysis phase.

The changes to the PS file when EPS is enabled are:
    - Add EPS header
    - Use tight bounding box instead of page size
    - Use save/restore to ensure PS interpreter is left in the same state
2007-09-23 17:43:44 +09:30
Adrian Johnson
beefbdd638 Add Encapsulated PostScript API 2007-09-23 14:23:33 +09:30
Adrian Johnson
b20e08999e Truetype Subsetting: Avoid failing when fonts are missing optional tables
Previously, the TrueType subsetting would fail if any of the "cvt",
"fpgm", or "prep" tables were missing from the source font. However
these tables are optional and not required in the subsetted font if
they do not appear in the source font.

The "name" table has been removed from the subsetted font as the
Type42 specification does not require this table.
2007-09-23 11:37:02 +09:30
Brian Ewins
8132b8b417 [type1-subset] only subset ft fonts
If atsui and ft were both enabled, the code crashed trying to subset
type-1 fonts; fixed by checking if fonts really are ft before using
them as ft fonts. This is a temporary fix until we support subsetting
across all font backends.
2007-09-23 02:52:01 +01:00
Vladimir Vukicevic
6020f67f1a Avoid divide-by-zero when trying to allocate a 0-sized array
Fix up the _cairo_malloc_* wrappers to avoid blindly dividing by zero;
any attempt to allocate a zero-sized chunk of memory will result in
NULL.
2007-09-21 11:02:42 -07:00
Carl Worth
c79fc9af33 Add rgb24-specific reference imag for mask-alpha test 2007-09-20 16:01:43 -07:00
Adrian Johnson
59dd59ce8d Add mask-alpha test 2007-09-20 16:00:34 -07:00
Adrian Johnson
12b2ab630c PDF: Add support for CAIRO_FORMAT_A8 images 2007-09-20 22:51:39 +09:30
Adrian Johnson
8a4adcf5f3 ROADMAP: Add metadata API 2007-09-20 08:57:19 +09:30
Behdad Esfahbod
6e78c6589d [ROADMAP] Mark xlib IncludeInferior support done 2007-09-18 19:50:50 -04:00
Vladimir Vukicevic
d8b0de01d6 fix trailing whitespace 2007-09-18 09:28:30 -07:00
Vladimir Vukicevic
4fd9acc1b3 [win32] add new win32 printing surface 2007-09-18 09:28:30 -07:00
Vladimir Vukicevic
e3c16e15e3 Make NO_MUTEX really mean no mutexes 2007-09-18 09:28:30 -07:00
Vladimir Vukicevic
ffc16c4be2 [win32] Add win32 printing surface
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.)
2007-09-18 09:28:29 -07:00
Vladimir Vukicevic
284ed91ee4 Let surfaces specify their native resolution, for fallback purposes 2007-09-18 09:28:29 -07:00
Behdad Esfahbod
79d975f84b [cairo-ft-font] Ignore FT_Load_Glyph errors other than out-of-memory
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.
2007-09-17 20:55:42 -04:00
Behdad Esfahbod
21ab44f11d [ChangeLog.mk] Make make rule depend on .git/HEAD, not .git
That is exactly what we want.  Kristian Høgsberg suggested it.
2007-09-17 16:41:52 -04:00
Adrian Johnson
3f4875dbe2 Analysis-surface: Use pattern extents to limit show_glyphs extents 2007-09-16 20:26:33 +09:30
Adrian Johnson
14786385b4 Change paginated surface size when PS/PDF _set_size() called
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().
2007-09-16 19:43:28 +09:30
Adrian Johnson
46cb7e6952 PS: Remove initclip operator
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.
2007-09-16 16:32:54 +09:30
Adrian Johnson
e9d85235f9 PDF: Fix copy_page() bug 2007-09-16 16:21:10 +09:30
Adrian Johnson
a5cb48fcf2 PS: Remove copy_page()
The DSC specification recommends not using the copypage operator as it
breaks page independence.
2007-09-16 16:15:10 +09:30
Ken Herron
03f7a51f47 PS output optimizations (#11442)
This patches cairo-ps-surface.c to use the aliases for moveto, lineto, curveto,
and closepath. It also uses selectfont to select fonts.
2007-09-16 15:56:16 +09:30
Behdad Esfahbod
1274147ce3 [cairo-gstate] Fix comment about font_matrix having zero translation 2007-09-15 04:03:08 -04:00
Behdad Esfahbod
6fbe2432c6 [PDF] Fix typo in comments 2007-09-15 04:02:39 -04:00
Jeff Muizelaar
dca93eb76d Fix theoretical NULL return from cairo_pop_group()
This also makes the code more consistent as group_pattern always holds a valid
pattern.
2007-09-12 23:12:59 -04:00
Jonathan Gramain
5eae45c55b [cairo-gstate] Fix order of matrices in _cairo_gstate_backend_to_user_rectangle()
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.
2007-09-12 17:45:21 -04:00
Vladimir Vukicevic
f2910ad3e9 Update cairo-sections.txt 2007-09-11 13:32:26 -07:00
Vladimir Vukicevic
9e975757a2 Export cairo_surface_{copy,show}_page
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.
2007-09-11 13:30:35 -07:00
Vladimir Vukicevic
7dd05b7f86 [mlk] Free boxes in copy_rectangle_list on success
Fix memory leak when copy_rectangle_list is used.
2007-09-11 11:27:47 -07:00
Adrian Johnson
897350c6c5 PDF: Remove BC entry from Smask dictionary
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.
2007-09-09 19:11:12 +09:30
Adrian Johnson
909e0be241 Add PDF support for cairo_mask() 2007-09-09 11:20:02 +09:30
Chris Wilson
d62f886168 [cairo-ft-font] Early detection of a zero sized bitmap.
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.
2007-09-07 12:40:28 +01:00
Vladimir Vukicevic
d635e01033 Add b8g8r8 formats to cairo-image-surface
Add recognition code for x8b8g8r8 and a8b8g8r8 to cairo-image-surface.
(Used as the default for 24bpp by some older VNC servers.)
2007-09-06 12:56:59 -07:00
Carl Worth
3c01efb0ee Merge branch adrianj/pdf-meta-surface-pattern into cairo
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.
2007-09-05 14:41:01 -07:00
Carl Worth
0682b9a9c1 Add rgb24-ignore-alpha test
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).
2007-09-05 14:38:21 -07:00
Behdad Esfahbod
84a2c8968a [test,perf] Support TARGETS_EXCLUDE make variable 2007-09-05 12:38:27 -04:00
Adrian Johnson
1e21220f0e Create meta-surface source image with same content type as the
meta-surface
2007-09-05 22:53:43 +09:30
Adrian Johnson
875e32178e Eliminate unclipped CLEAR from meta-surface playback
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.
2007-09-05 22:51:13 +09:30
Adrian Johnson
d24f019101 Add support for PDF meta-surface patterns 2007-09-05 22:26:16 +09:30
Behdad Esfahbod
b85032584b [configure.in] Fix non-pkgconfig Xrender detection path (#4724) 2007-09-05 00:26:56 -04:00
Behdad Esfahbod
1d788da517 Merge branch 'no-xrender.h' into cairo 2007-09-04 19:12:48 -04:00
Behdad Esfahbod
e1819a24fb [cairo-xlib-xrender-private] Remove some protocol-specific macros 2007-09-04 19:12:14 -04:00
Behdad Esfahbod
5e09126ce1 [cairo-xlib-xrender-private] Add copyright/license info for copied files 2007-09-04 18:40:54 -04:00
Carl Worth
49ae376840 Fix error in description of cairo version numbers
And eliminate a bit of redundant text.
2007-09-04 11:37:46 -07:00