Commit graph

1363 commits

Author SHA1 Message Date
Kristian Høgsberg
e846dca44e Hook _cairo_truetype_subset_init() up to existing truetype subset code.
This is a minimal first change to get things working.  The truetype
subset code still needs to be renamed and moved around a bit.
2006-05-16 21:41:07 -04:00
Kristian Høgsberg
f4f11eba5b Output pdf dicts for truetype subset fonts. 2006-05-16 19:01:15 -04:00
Kristian Høgsberg
13a05830f5 Update pdf font emit code to try to emit a truetype subset before type3. 2006-05-16 16:42:44 -04:00
Carl Worth
05b1d2f9c5 PDF: Fix broken per-page sizes in PDF output.
This was first broken in:

	PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t
	f500cef19f

Thanks, git bisect!
2006-05-16 01:04:59 -07:00
Kristian Høgsberg
d70ade00fb Merge branch 'master' of git://git.freedesktop.org/git/cairo 2006-05-15 17:53:56 -04:00
Kristian Høgsberg
41d435418c Documentation fixes (cairo_font_create -> cairo_scaled_font_create). 2006-05-15 17:36:12 -04:00
Carl Worth
bf2ab0de92 PDF: Add Type3 font support to PDF output.
This uses the recently added cairo-scaled-font-subsets interface in a
style very similar to what the PS surface does.
2006-05-15 10:04:53 -07:00
Carl Worth
6f417fed51 PDF: Move Resources dictionary up from Page objects to Pages object.
This allows for more sharing of resource objects. It also avoids some
confusion in trying to set independent resources at a global and a
per-page level, (which doesn't work since the inheritance only works
for an entire resources object---it can only be overriden in its
entirety, not for subsets of the resources).
2006-05-15 10:00:18 -07:00
Carl Worth
049100fb87 PDF: Use consistent style for typedef struct and macro naming. 2006-05-15 09:52:57 -07:00
Carl Worth
45d0540c33 PS: Remove the fallback case from _cairo_ps_surface_show_glyphs
The only expected errors that would lead to this fallback are serious
problems such as out of memory. There's no reason to go to heroic
efforts to draw as much as possible in face of an error like that.

Prefer simpler code instead.
2006-05-15 09:41:36 -07:00
Carl Worth
cb32b41a4e PS: Fix arguments to setcachedevice
Since we are only ever displaying a single glyph at a time we don't
care about the width values passed to setcachedevice at all---we only
care about the bounding box.

That's what the code was trying to do before, but the arguments were
misaligned and we were instead passing bounding-box values for the
widths and hard-coding half of the bounding-box values as 0.
2006-05-15 09:39:16 -07:00
Carl Worth
e2c03d51da Change scaled_font_subsets_callback to have return type of void.
The return of status from this callback was misleading. The function
actually calling the callback was also a hash table callback function,
which itself is void---so any status value returned was being lost.

Instead, we now stash any errors that occur during the fallback into
surface->status.
2006-05-15 09:34:27 -07:00
Carl Worth
f500cef19f PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t 2006-05-12 14:56:11 -07:00
Carl Worth
d84a1cac1c PDF: Use cairo_pdf_resource_t more consistently.
Eliminate the named structure cairo_pdf_stream_t. This structure was
being dynamically allocated, passed around, and leaked when only an ID
was actually needed to be passed around.

Similarly, many other uses of PDF resources were passing bare unsigned
int types rather than the safer and more legible cairo_pdf_resource_t.
2006-05-12 13:31:12 -07:00
Carl Worth
1ba537be18 Fix memory leak in _cairo_scaled_font_subsets_foreach 2006-05-10 19:01:40 -07:00
Carl Worth
7bd3a037da Add documentation for the _cairo_scaled_font_subsets interface. 2006-05-10 18:52:36 -07:00
Carl Worth
7c137b7e2c SVG: Discard custom font subsetting in favor of sharing cairo-scaled-font-subsets 2006-05-10 15:14:10 -07:00
Carl Worth
f459c1f0de Tweak names to match those of cairo-scaled-font-subsets
Also, remove a now obsolete field from cairo_ps_surface_t
2006-05-10 15:12:53 -07:00
Carl Worth
8a209e6ad9 Fix cairo_output_stream_destroy to do nothing on nil stream objects. 2006-05-10 14:50:31 -07:00
Carl Worth
0544515279 Generalize font subsetting code in cairo-scaled-font-subsets for use by more than just PS backend 2006-05-10 14:47:28 -07:00
Carl Worth
906a17a6b1 Rename cairo-ps-font to cairo-scaled-font-subsets (file names only) 2006-05-10 14:40:32 -07:00
Carl Worth
f7f9bdc05b PS: Put functions in more logical order. 2006-05-09 14:40:37 -07:00
Carl Worth
f3703b1806 PS: Move type 3 support out into cairo-ps-font.c
This is in preparation for generalizing this code for sharing among
several backends.
2006-05-09 14:40:36 -07:00
Carl Worth
7ebdf4825d PS: Remove stale comment (the stuff TODO is done already) 2006-05-09 14:40:36 -07:00
Emmanuel Pacaud
7d0bcc3f1c SVG: Emit glyphs at the beginning of defs section. 2006-05-06 15:31:53 +02:00
Emmanuel Pacaud
1da2ca0f35 SVG: Implementation of glyph cache
This is an adaptation of Keith ps-type3 branch for SVG backend.
Main differences with ps stuff are font cache is a property of
document, and there's no need of subfonts.
2006-05-06 14:56:20 +02:00
Emmanuel Pacaud
d76701f465 Use CLEAR operator for initialisation of similar surface with a transparent color. 2006-05-05 16:47:06 +02:00
Emmanuel Pacaud
36fcaa76d6 SVG: Fix cairo_svg_surface_restrict_to_version.
surface parameter is actually a paginated surface.
Use the same logic as pdf backend.
2006-05-05 16:02:04 +02:00
Emmanuel Pacaud
6b40ba283b SVG: Remove special case for unclipped CLEAR and SOURCE in paint when
we're in analysis mode.

intersect_clip_path is not analyzed, so we can't know if we're clipped
when we're in analysis mode.
2006-05-05 12:59:29 +02:00
Emmanuel Pacaud
fb269aac08 SVG: Sets something sane in width and height if acquire source image fails.
In composite_image_pattern.
2006-05-05 11:10:02 +02:00
Carl Worth
b948683917 Flesh out the documentation for cairo_push_group, cairo_pop_group and friends 2006-05-04 22:43:22 -07:00
Ian Osgood
8c9da52dc2 Fix the XCB backend build for the XCB 0.9 release.
* use split out xcb-render package
* fix deprecated calls
* use XCB-specific symbols
2006-05-04 14:29:03 -07:00
Carl Worth
ec94f0a7e2 Remove trailing comma in enum to pander to non-C99-conformant compilers 2006-05-04 12:52:17 -07:00
Emmanuel Pacaud
135449ae03 SVG: Fix the previous fix for xlink namespace.
It seems libxml2 2.6.24 now requires a node using xlink
namespace to be linked to a node where it can find this
namespace.
2006-05-04 18:06:06 +02:00
Carl Worth
1431a9d4d3 Clean up error management of xlib surface getter functions. 2006-05-04 04:03:19 -07:00
Robert O'Callahan
4a4603d551 Add Xlib surface getter functions.
Add the following five functions:

cairo_public Display *
cairo_xlib_surface_get_display (cairo_surface_t *surface);

cairo_public Drawable
cairo_xlib_surface_get_drawable (cairo_surface_t *surface);

cairo_public Screen *
cairo_xlib_surface_get_screen (cairo_surface_t *surface);

cairo_public Visual *
cairo_xlib_surface_get_visual (cairo_surface_t *surface);

cairo_public int
cairo_xlib_surface_get_depth (cairo_surface_t *surface);
2006-05-04 04:03:19 -07:00
Emmanuel Pacaud
68915fdfcb SVG: Fix xml namespace declaration.
It looks like since libxml2 2.6.24, we can't just use xmlSetProp
for namespace declaration anymore.
2006-05-04 12:56:06 +02:00
Carl Worth
7aa2b05e48 Add missing prototype for _cairo_clip_translate 2006-05-04 03:44:45 -07:00
Robert O'Callahan
7bcf957b4e Rename cairo_rectangle_t to cairo_rectangle_fixed_t.
This is in preparation for a later function addition for extracting
clip rectangles from a cairo_t, (which will add a public
cairo_rectangle_t).
2006-05-04 03:43:34 -07:00
Vladimir Vukicevic
fb7f7c2f27 Fix up clip at pop_group time, to keep it in surface backend coordinates
We keep the clip in surface-backend coordinates always, so it needs
fixing whenever we change the target surface out in the gstate.  The
only place this happens is in push_group, so fix it as part of
gstate_redirect().
2006-05-04 03:02:27 -07:00
Vladimir Vukicevic
ee02c1b914 Implement push_group/pop_group
This patch adds the following API calls:

 cairo_push_group
 cairo_push_group_with_content
 cairo_pop_group
 cairo_pop_group_to_source
 cairo_get_group_target

These methods support implementing layers on top of a cairo context,
allowing for drawing with transparency and temporary buffering.
cairo_get_group_target allows an app to get access to the actual surface
created by the last push_group call, in case itneeds to perform native
drawing to it.
2006-05-04 02:52:38 -07:00
Carl Worth
a6b1b014bb Implement the device_offset functionality at surface, not gstate layer
This is a mega-patch that has the advantage that the entire test suite
passes both immediately before and immediately after this commit.

The disadvantage of the mega-patch is that it does not reflect the
development history of the device-offset branch, (with its various
fumblings and flailings). To capture that history, we will next merge
in that branch.
2006-05-04 01:45:41 -07:00
Carl Worth
7beb3e27a5 Quiet some 'may be used uninitialized' warnings. 2006-05-03 16:45:33 -07:00
Carl Worth
eb1b102e9a PDF: Add new cairo_pdf_surface_set_size for doing per-page size changes 2006-05-03 12:39:23 -07:00
Carl Worth
a4fc0c2e2c PS: Use ceil, not rounding when computing integers for BoundingBox 2006-05-03 11:11:25 -07:00
Emmanuel Pacaud
e91b2c87cc SVG: Emit "svg" version in document_finish.
At least when there's something valid in document->svg_version.
2006-05-03 14:53:25 +02:00
Emmanuel Pacaud
5336cf5a98 SVG: Only "comp-op" property when svg_version >= 1.2 2006-05-03 14:47:01 +02:00
Emmanuel Pacaud
57ddc7a869 SVG: Emit correct version property of "svg" element. 2006-05-03 14:29:54 +02:00
Carl Worth
09dfd6c3c1 PS: Add three new public functions for emitting DSC comments.
This commit adds the following new functions to the cairo-ps API:

	cairo_ps_surface_dsc_comment
	cairo_ps_surface_dsc_begin_setup
	cairo_ps_surface_dsc_begin_page_setup

Many thanks are due to Michael Sweet who provided invaluble guidance
during the design of this API.

It is hoped that with this API in place, basically all printer control
that is likely to be desired to be performed with cairo PostScript
output is now possible.

This commit augments the ps-features test to exercise the new API.
2006-05-03 00:26:22 -07:00
Emmanuel Pacaud
1264ae9af4 SVG: Really use width and height in point unit.
I guess it makes more sense to use a unit for
specifying image size that doesn't depend on context.
2006-05-02 23:35:06 +02:00