Commit graph

4322 commits

Author SHA1 Message Date
Adrian Johnson
1441e165f2 Fix regression in Type1 Fallback
As a result of the changes to improve the status checking,
_cairo_type2_charstrings_init() was failing due to the failure
status returned when the font->output stream is destroyed.
This is because _cairo_type2_charstrings_init() does not
create an output stream.

Fix this by initializing font->output to NULL and only
destroy it if not NULL.
2007-12-02 00:50:28 +10:30
Behdad Esfahbod
e6166f7b44 Convert bash scripts to regular sh ones for greater portability 2007-12-01 04:19:39 -05:00
Carl Worth
0d932f43fe Explicitly call bash for bash-specific scripts
Thanks to Solaris-using Brian Cameron for pointing out that our
shell scripts are bash-specific. We'd be glad if someone cared to
rewrite them to not require bash, but for now let's have truth in
advertising at least.
2007-11-30 16:19:45 -08:00
Adrian Johnson
f4b93cceb7 PS: Use correct glyphs widths for Type 3 fonts
Previously the widths were set to 0.
2007-11-29 23:18:45 +10:30
Adrian Johnson
2729af6c12 PS: Fix the Type 3 FontBBox
This was previously a fixed size. Make it [0 0 0 0] the same as the
other fonts.
2007-11-29 23:07:47 +10:30
Adrian Johnson
77aab8fdbb PS: Don't emit an image for Type 3 .notdef glyph
Make the .notdef procedure an empty procedure instead
of creating an empty image mask. This reduced the size
of the PS file.
2007-11-29 23:03:40 +10:30
Adrian Johnson
78e8d3d9bd PS: Fix the bounding boxes of Type 3 glyphs
When viewing with ghostscript the glyphs were clipped
2007-11-29 22:54:54 +10:30
Adrian Johnson
97b0d8b3c3 PS: Make Type 3 fonts text selectable
Put the glyph names in the Encoding array the same as is done for
Type 1 and Type42 fonts.

Acroread and Evince are still unable to correctly extract the text
after conversion with ps2pdf. However examining the pdf file shows
the glyph names are correct so this is probably a limitation of
Acroread and Evince.
2007-11-29 22:52:52 +10:30
Adrian Johnson
5e8f60531a PS: Ensure that xyshow operator has a pair of offsets for each glyph
The last entry should have been "0 0" instead of "0".
2007-11-29 09:20:01 +10:30
Brian Ewins
ba239a474a [quartz] zero memory on bitmap creation
7 quartz/argb32/similar tests were showing failures due to 
random bits being set. The problem turned out to be that the 
initial test surface was not cleared before the similar surface 
was created by push_group. The problem behaviour is more obvious
if you run the tests with MallocScribble=1.

Fix this by calling memset after bitmap allocation; the multiplication
here cannot overflow since we already checked that in malloc_ab.
2007-11-18 20:30:49 +00:00
Brian Ewins
58e828a9a3 [quartz] fill with alpha for EXTEND_NONE
The implementation of EXTEND_NONE was not filling areas outside
the image with rgba(0,0,0,0). This showed up on the operator-source
test, the fix makes the quartz and image renderings identical.
2007-11-15 21:29:07 +00:00
Vladimir Vukicevic
39b8ddf079 [win32] Remove double-free in win32 font code in init_glyph_path
Fixes bug #13243.
2007-11-15 11:57:40 -08:00
Vladimir Vukicevic
50d5f5a4e6 [quartz] Fix gradients; the wrong color field was being used
The wrong color field was being used, effectively making gradients always
have transparent black as their color stops.
2007-11-15 11:56:56 -08:00
Brian Ewins
bcb0f57e5e [quartz] remove double malloc in dashing code.
fdash is reallocated without being released, and is
allocated at the wrong size too.
2007-11-14 01:50:34 +00:00
Brian Ewins
e6bc049465 [quartz] typo checking for malloc failure
The check after the malloc of cg_advances looked at the wrong
variable.
2007-11-13 00:43:59 +00:00
Brian Ewins
bb2674207c [quartz] fix leak in show_glyphs
In cairo_quartz_show_glyphs we may leak the source if
there is a failure to malloc the glyph arrays. Fix this.
2007-11-12 23:56:01 +00:00
Brian Ewins
7ad34c1bdc [quartz] fix for cairo_reset_clip() 2007-11-12 23:52:52 +00:00
Brian Ewins
717ccbcf0c Revert "[quartz] handle 0x0 surfaces."
This reverts commit 2fd50a7897.
Spoke too soon, quartz doesn't like creating those 0x0
images; while the tests pass, its putting warnings in the logs.
Reverting to make a better fix.
2007-11-12 23:51:39 +00:00
Brian Ewins
2fd50a7897 [quartz] handle 0x0 surfaces.
Some tests, like invalid-matrix, generate a 0x0 bitmap; in
the quartz backend this caused a nil surface to be returned,
whereas the tests expect a quartz surface. Other surfaces
return a backend-specific surface with a zero-sized bitmap,
quartz should do the same.

Fixes the tests ft-font-create-for-ft-face, get-and-set,
get-clip, invalid-matrix, line-width-zero, 
select-font-no-show-text, solid-pattern-cache-stress,
surface-finish-twice, and text-cache-crash.
2007-11-11 01:49:36 +00:00
Emmanuel Pacaud
0359ad6c8d Compilation warning suppression (char as array subscript).
cairo_path_op_t is a char, and can't be directly used as array subscript.
2007-11-11 00:18:19 +01:00
Emmanuel Pacaud
1b71af7e61 Fix _cairo_path_fixed_init_copy.
All the copied data buffers except the first one weren't completely
initialized (num_ops and num_points). That was the cause of the failure
of some vector surface tests, like random-intersections.
2007-11-11 00:14:34 +01:00
Emmanuel Pacaud
3554c31e3d [SVG] Add missing image to REFERENCE_IMAGES list. 2007-11-10 10:43:43 +01:00
Emmanuel Pacaud
916d82586e [SVG] Indentation fixes. 2007-11-10 10:24:21 +01:00
Emmanuel Pacaud
8edc3ed485 Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2007-11-10 10:10:50 +01:00
Emmanuel Pacaud
3bc8a8d1d0 [SVG] Remove spurious semicolon when emitting mask url. 2007-11-10 10:10:03 +01:00
Emmanuel Pacaud
b68968ffd1 [SVG] Fix opacity of combined stroke and fill.
When emitting combined stroke and fill, cairo SVG backend was using the opacity
two times, instead of using fill-opacity and stroke-opacity, leading to
incorrect output.

I've updated the mask test reference images for the SVG output, since it seems
there's a bug in librsvg when fill-opacity is used in the mask image.
I've checked the SVG output with batik, and it looks fine.
2007-11-10 10:07:12 +01:00
Brian Ewins
77e9b05b2b [test] support using a previous build as a reference
Allow using a previous test output directory as a source of
reference images. To make use of this, set the environment
variable 'CAIRO_REF_DIR' to point at an old test directory,
relative to the current test directory.

This is useful for testing backends when reference images haven't
been created yet, or which the current reference image structure
can't accomodate, like multiple font backends.
2007-11-10 01:34:03 +00:00
Brian Ewins
f8ee0cdf18 [test] Link to the correct reference image.
The generated test html guesses the names of the reference
images used in the tests. This is quite often wrong, and
makes it harder to change policy in cairo-test. Teach
make-html.pl to parse the log for the path to the reference image.
2007-11-10 01:34:01 +00:00
Brian Ewins
15fc1bbefb [test] log tested paths so that they can be parsed.
The test logs currently do not record the paths of
image output, the reference images tested against, and
the diffs created. This means that make-html.pl has to
duplicate the policy in cairo-test.c. Fix this by teaching
cairo-test.c to log the paths.
2007-11-10 01:33:47 +00:00
Vladimir Vukicevic
28412f780e [win32-printing] bail out early if we don't have anything to do in paint_surf 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
d72bb8c12e [win32] Fix FIXED_to_fixed when cairo's fixed format isn't 16.16 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
0901b83ca5 [win32] Don't use GetGlyphOutline on non-TrueType fonts
win32-glyph-metrics.patch: GetGlyphOutline only works on Truetype fonts,
so for non-Truetype fonts, assume no left or right bearing and use the
font ascent and descent for the glyph extents.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
f11f7524b6 [quartz] work around Quartz bugs with images bigger than a certain size
Quartz has a bug with images greater than (signed) 16 bits in height; avoid
creating or working with those.  Also fixes some memory leaks.

Patch from John Daggett.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
95ede9ea59 Use correct surface resolution when creating paginated fallback image
If a surface resolution is set via _cairo_surface_set_resolution, it
needs to be used when the fallback image is created.  The user sets
the fallback resolution on the paginated surface, so we need
to divide that by the resolution of the actual (target) surface, not
the paginated surface.
2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
9b8d9f2859 [win32] Skip doing some work if we can't call StretchDIBits 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
fa7e36669a [quartz] Fix for 10.5 SDK; the FloatToFixed macro started doing strange things 2007-11-09 12:50:45 -08:00
Vladimir Vukicevic
236c52b095 Handle overflow/underflow gracefully when converting to 16.16 fixed 2007-11-09 12:50:45 -08:00
Carl Worth
5b0a0fe7a2 Mention cairo_new_sub_path in documentation of cairo_arc 2007-11-07 11:18:05 -08:00
Chris Wilson
62d64e12aa [cairo-pdf-surface] Create a new path for an empty clip.
If the clip path is empty, then we need to start a new path otherwise
the clip is ineffective.
2007-11-06 15:22:07 +00:00
Chris Wilson
b4057b8643 [cairo-clip] Special case using an empty clip path.
Detect when the user calls cairo_clip() with an empty clip path and
mark the clip as all_clipped.
2007-11-06 15:21:37 +00:00
Chris Wilson
2f0867b43f [cairo-surface] Handle the all clipped out case.
Explicitly handle a clip which represents that the entire surface is
clipped out.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=13084.
2007-11-06 14:26:28 +00:00
Chris Wilson
641215b2b0 [test/clip-all] Combine text and everything clipped out.
https://bugs.freedesktop.org/show_bug.cgi?id=13084 demonstrates a
regression where the clip is ignored by the xlib backend whilst
rendering text. Therefore we extend the current test cases to combine
a clip that represents everything clipped out with the rendering of
text. For completeness, we add a new test case that exactly mimics the
sequence of cairo operations that lead to the discovery of this bug -
namely the rendering of text with an empty clip path.
2007-11-06 13:28:10 +00:00
Behdad Esfahbod
55b530ffef [PS] Fix compiler warnings 2007-11-05 14:47:27 -05:00
Behdad Esfahbod
570714b2b4 [test/fallback-resolution] set tolerance to a large value to see how it performs
in different fallback resolutions.
2007-11-05 13:23:40 -05:00
Behdad Esfahbod
5acbef2021 [test] fallback-resolution: center text 2007-11-05 13:23:35 -05:00
Behdad Esfahbod
7f21bfb0a8 [meta-surface] Adjust tolerance when replaying to surfaces with device scale
such that we get a consistent look with different fallback resolutions.
2007-11-05 13:23:28 -05:00
Richard Hult
4270cd3358 [atsui] Use ascent+descent+leading to get the distance between baselines
The height is currently mapped to the atsui metrics property capHeight, which
is documented as "The height of a capital letter in the font from the baseline
to the top of the letter".

That doesn't match what height is in cairo, it should be the disctance between
baselines. This patch that fixes that (and makes webkit on GTK+ OS X
layout nicely).
2007-11-05 10:05:07 +00:00
Brian Ewins
3141b21c0c [configure.in] fix atsui experimental warning
The 'experimental' warning for atsui was appearing
for --enable-quartz not --enable-atsui as it should.
2007-11-05 10:05:04 +00:00
Chris Wilson
b3ef306f84 [cairo-atomic] Add a few more cpus that are known to have atomic access.
Add x86_64 and arm to the list of cpus which do not require memory
barriers for reading and writing integers/pointers atomically.
2007-11-05 09:09:14 +00:00
Chris Wilson
bd5ed9a398 [cairo-atomic] Declare the mutex for NEEDS_MEMORY_BARRIER.
Whilst NEED_MEMORY_BARRIER should be a subset of ! HAS_ATOMIC_OPS,
until we have accurate configure tests NEED_MEMORY_BARRIER may be
invoked independently.
2007-11-05 09:05:25 +00:00