Commit graph

1266 commits

Author SHA1 Message Date
Carl Worth
abe1bfad8d Add missing breaks in switch statement.
Yes, I am an idiot.
2006-06-15 15:43:00 -07:00
Carl Worth
9fa24975b4 Drop _cairo_surface_is_opaque now that we have cairo_surface_get_content 2006-06-15 15:33:45 -07:00
Carl Worth
0ba040d7f6 Remove _cairo_image_surface_is_alpha_only in favor of just looking at content value. 2006-06-15 14:56:59 -07:00
Carl Worth
82496a6f7c _cairo_format_from_pixman_format: Add useful error mesage and assertion when failing. 2006-06-15 14:15:42 -07:00
Kristian Høgsberg
dedc51ba51 Only call close function for output streams if it's non-NULL. 2006-06-14 19:25:37 -04:00
Kristian Høgsberg
2cea3a2710 Merge branch 'svg-rewrite' 2006-06-14 15:00:33 -04:00
Kristian Høgsberg
4932d09a06 Actually add src/cairo-output-stream-private.h. 2006-06-14 14:12:55 -04:00
Torsten Schönfeld
17ea755235 Add missing cairo_public tag for cairo_image_surface_get_stride 2006-06-14 11:09:00 -07:00
Behdad Esfahbod
7e0be461b5 Rename cairo-wideint.h to cairo-wideint-private.h. 2006-06-14 05:06:10 -07:00
Behdad Esfahbod
b9cfe941c8 Add backend-specific pkg-config files. 2006-06-14 05:06:09 -07:00
Behdad Esfahbod
2249fb89ae Move cairo.pc into src/. 2006-06-14 05:05:30 -07:00
Brian Cameron
b8e93f9c55 Bug 4882: Flag Sun's X server has having buggy_repeat.
This is the Sun labelling of Xorg 6.8 as shipped with Solaris 10.
2006-06-14 04:44:01 -07:00
Behdad Esfahbod
e9269aefcb Bug 7075: Fix make clean to remove cairo.def 2006-06-14 04:07:29 -07:00
Carl Worth
c515b15cfc ft: If glyph->format is not OUTLINE use _render_glyph_bitmap to coerce to a bitmap 2006-06-14 03:53:18 -07:00
Jinghua Luo
0d2900477c freetype: Return an error if the glyph format isn't outline or bitmap
while getting glyph surface.
2006-06-14 15:56:17 +08:00
Carl Worth
1d18af9f5a Merge branch 'type1-subsetting' into cairo
Conflicts:

	src/cairo-ps-surface.c
2006-06-13 15:51:57 -07:00
Carl Worth
c7b194c595 Merge branch 'truetype-subsetting' into cairo
Conflicts:

	src/Makefile.am
	src/cairo-font-subset.c
	src/cairo-pdf-surface.c
	src/cairo-ps-surface.c
2006-06-13 15:46:14 -07:00
Kristian Høgsberg
ed60128bd0 Rewrite SVG backend to just use cairo output stream instead of libxml2. 2006-06-13 17:25:24 -04:00
Carl Worth
4b063c6072 PS, PDF: Re-organize handling of bitmapped fonts to avoid invalid output.
Previously, using the ps or pdf backend with a bitmapped font would
result in a coorupt output file, filled with uninitialized values and
missing procedures for drawing the glyphs.

Now, the file should actually be valid, but it's simply drawing black
boxes instead of the correct glyphs.
2006-06-13 12:51:16 -07:00
Carl Worth
d2045c1f74 Change return type of _cairo_scaled_glyph_lookup to allow UNSUPPORTED.
This allows graceful recovery when first requesting a path from a font
that only supports bitmapped glyph. The changed return type is also
pushed down into the scaled_glyph_init function of the
cairo_scaled_font backend.
2006-06-13 12:51:10 -07:00
Carl Worth
0e30fc4436 Add aliases for deprecated cairo_{pdf,ps,svg}_surface_set_dpi
The aliases should allow binaries with the old symbols to continue to run.

Meanwhile, the macros in cairo.h prevent any code from being compiled without
using the new, future-proof function names.

This is a temporary, transition strategy and the aliases will be dropped
before the next major release.
2006-06-12 09:01:06 -07:00
Carl Worth
7015cc0b90 Add cairo-ps-test.h and cairo-svg-test.h to Makefile.am 2006-06-12 09:01:06 -07:00
Kristian Høgsberg
8581447e7b Add an in-memory output-stream implementation. 2006-06-12 03:15:33 -04:00
Kristian Høgsberg
d433210660 Convert the word wrap stream, the base85 stream and the ps string stream. 2006-06-12 03:10:40 -04:00
Kristian Høgsberg
45cbe055d9 Convert the stdio output stream to use the new output stream interface. 2006-06-12 03:08:51 -04:00
Kristian Høgsberg
3575c942f8 Make cairo_output_stream_t an embeddable type.
Most internal cairo types are transparent within cairo and have init and fini
functions to intialize and finialize them in place.  This way they can be
easily be embedded in other structs or derived from.  Initially, the
cairo_output_stream_t type was proposed as a publically visible type and
thus kept opaque.  However, now it's only used internally and derived from
in a number of places so let's make it an embeddable type for consistency
and ease of use.

The patch keeps _cairo_output_stream_create() and _cairo_output_stream_close()
around for (internal) backwards compatibility by deriving a
cairo_output_stream_with_closure_t stream type.

The patch also moves all cairo_output_stream_t functions out of cairoint.h
and into new file cairo-output-stream-private.h, thus chipping away at the
monolithic cairoint.h.
2006-06-12 03:07:19 -04:00
Jinghua Luo
9d3443e86a xlib: bugfix for #7172.
When the glyph format does not match the font format, the glyph will
be rendered incorrectly. Setting the {x, y}_offset correctly when
converting glyph format fix that.
2006-06-12 14:18:25 +08:00
Emmanuel Pacaud
7992810135 SVG: Sets fallback resolution when compositing a meta surface.
For doing so, I've changed document owner to be the paginated surface,
instead of the svg surface like previously. That's because fallback
resolution is stored in paginated surface.
2006-06-11 21:07:34 +02:00
Jinghua Luo
7e1a01092c freetype: build fix for _transform_glyph_bitmap.
I sorry for this noise, I didn't notice cworth's device_{x, y}_offset
changes. Now cairo builds again.
paths...
2006-06-11 18:37:59 +08:00
Jinghua Luo
4af28e639d ignore FC_MATRIX in font pattern.
With previous commit, freetype font backend is able to transform
both bitmap and outline glyphs, so ignores FC_MATRIX from now,
cairo doesn't need this for artificial oblique. And cairo doesn't
use FC_MATRIX direct anyway, it has its own font matrix that may be not
equal to FC_MATRIX in the font pattern! You should pass the matrix
(usually the matrix is multiplied by font's pixel size) to cairo when
creating scaled font.
2006-06-11 18:16:46 +08:00
Jinghua Luo
f5bc26b75d freetype: rework _transform_glyph_bitmap.
This function is used to shape bitmap glyphs(outline glyphs are
transformed by freetype). That means freetype backend is able to
tranform both bitmap & outline glyphs now. This is needed for glyph
rotating, artificial oblique etc.
2006-06-11 18:09:05 +08:00
Carl Worth
2f4210d346 Change _cairo_meta_surface_get_extents to return a bounded size.
The old behavior of returning "infinite" extents is inconsistent with
the current usage of meta-surface where it is always created for
replay against a particular (sized) target surface and that size is
passed to _cairo_meta_surface_create.

Also clarify documentation of _cairo_surface_get_extents to eliminate
the possibility of inifinite extents.
2006-06-10 11:20:21 -07:00
Carl Worth
d758d5104a Don't create a new scaled_font if there's a device_offset but no device_scale.
(This is covering up my mistake from the last batch of 12 commits which
wasn't ready to be pushed yet. This fixes some of the crashes which
were introduced, and is a good thing to do regardless.)
2006-06-10 10:42:32 -07:00
Carl Worth
0662928e4f Clarify that fallback_resolution acts on a per-page granularity.
This explains why the SVG result from the fallback-resolution test
doesn't actually show multiple resolutions in effect at the same time.
2006-06-10 09:44:30 -07:00
Carl Worth
6ca30e108f Add cairo_{ps,svg}_test_force_fallbacks so tests can force fallbacks. 2006-06-10 09:14:47 -07:00
Carl Worth
100b30d1c0 Fix font size when drawing text with a device_scale.
The trick is to create a new scaled_font with the device_transform
multiplied into the CTM within _cairo_surface_show_glyphs before
calling into the backend. The fallback-resolution test shows that
the font size is now correct.
2006-06-10 08:35:01 -07:00
Carl Worth
74857181c9 Fix line width for stroking with a device_scale.
The trick is to simply multiply the device_transform into the CTM
within _cairo_surface_stroke before passing the CTM down to the
backend. The fallback-resolution test shows that the stroke width is
now correct.
2006-06-10 08:29:14 -07:00
Carl Worth
6efeb1e19b Hook up device scaling so fallback_resolution starts working.
Add new, private _cairo_surface_set_device_scale for getting at the
scaling components of device_transform. Use this in paginated surface
when replaying to an image surface. The fallback-resolution test now
clearly shows that image fallback resolution can be controlled by the
user. Hurrah!
2006-06-10 08:19:41 -07:00
Carl Worth
b129f747c5 Change {x,y}_device_offset values to a device_transform matrix.
This is a step toward allowing device scaling in addition to device offsets.
So far, the scale values are still always 1.0 so only the translation is
actually being used. But most of the code is in place for doing scaling as
well and it just needs to be hooked up.

There are some fragile parts in this code, all of which involve using the
translation without the scale, (so grep for device_transform.x0 or
device_transform->x0). Some of these are likely bugs that will hopefully
be obvious once we start using the scale. Others are OK if only because
we 'know' that we aren't ever setting device scaling on a surface that
has a device offset (we only set device scaling on surfaces we create
internally and we don't export device scaling to the user).

All of these fragile parts in the code have been marked with comments of
the form: XXX: FRAGILE.
2006-06-10 00:12:51 -07:00
Carl Worth
999315cc0a Rename device_{x,y}_offset to {x,y}_device_offset for better consitency/grepability 2006-06-09 21:12:44 -07:00
Carl Worth
6f6bdb6663 Add REPLACED_BY macros to help porting to new set_fallback_resolution 2006-06-09 16:54:09 -07:00
Carl Worth
b2f274b3e8 New API: Replace cairo_{ps,pdf,svg}_set_dpi with new cairo_surface_set_fallback_resolution.
This just provides the mechanics for storing the value and removing the old
function calls. The new value is still not used anywhere (though nor where
the old values), so there should be no functional change (other than forcing
any programs calling the old API to be updated).
2006-06-09 16:52:17 -07:00
Jinghua Luo
ac20c80960 freetype: Ignore global advance unconditionally.
Global advance exists for historical reasons. Nowadays, most of fonts
support unicode, means it's no guaranteed to every glyphs in the font
has the same advance.Sometimes it maybe is biger/smaller then the global
advance even for monospace fonts!So forcing their advance to global
advance, it's obviously wrong.
2006-06-09 07:06:51 +08:00
Jinghua Luo
5ae2a78a29 freetype: Fix for test case ft-text-vertial-layout.
Fix scaled font metrics and glyph metrics calculation for vertical
layout. Test case ft-text-vertial-layout passes now.
2006-06-08 03:45:38 +08:00
Jinghua Luo
3594fd2d27 glitz: Don't hardcode content type when initializing cairo surface
since we can compute it from glitz format.
2006-06-08 02:35:42 +08:00
Carl Worth
3690eeb44c Change all instances of UINT16_MAX to INT16_MAX to avoid new bug.
A recent renaming from CAIRO_MAXSHORT also changed the range of some
values from INT16_MAX to UINT16_MAX. The test suite shows one case
where this introduces a bug, (push/pop_group with SVG and RGB24
surfaces).

I haven't tracked the bug down, (presumably there's overflow of the
unsigned value at some point), but I'm now reverting this to avoid
triggering the bug.
2006-06-07 02:59:51 -07:00
Carl Worth
7f2cf378d5 Fix MAX vs. MIN bug introduced with rename away from CAIRO_MINSHORT 2006-06-07 02:56:45 -07:00
Carl Worth
bf458c9c67 win32: Add conditional definitions for INT16_{MIN,MAX} and UINT16_MAX now that we use them. 2006-06-06 17:06:57 -07:00
Carl Worth
c1855f1762 Remove CAIRO_{MIN,MAX}SHORT which did not distinguish signed vs. unsigned.
Instead, use the standard INT16_{MIN,MAX} and UINT16_{MIN,MAX} as
appropriate.
2006-06-06 16:59:59 -07:00
Carl Worth
746f66c3fc Fix bogus cairo_rectangle_fixed_t to be cairo_rectangle_int16_t.
This rectangle has regular integer values, not fixed-point values.
So the old name was horribly wrong and misleading, (and yes I think
it was even I that had suggested it).
2006-06-06 16:54:03 -07:00