Commit graph

3953 commits

Author SHA1 Message Date
Bernardo Innocenti
3551152005 Fix version check for buggy_repeat on modular Xserver 1.x
The versioning of the X server has restarted from 1.0 in the
modular build.  So we adjust the text to avoid considering
the new servers buggy.

Cherry picked from commit d4138d1161
2007-12-05 09:29:22 -08:00
Carl Worth
957056368b Increment cairo version to 1.4.13 after the 1.4.12 release 2007-11-27 08:05:08 -08:00
Carl Worth
442fa9a106 Increment version to 1.4.12 and 13:6:11 2007-11-26 22:31:32 -08:00
Carl Worth
b28c7a90fc NEWS: Add notes for cairo 1.4.12 2007-11-26 22:30:47 -08:00
Carl Worth
617d3f5738 Mark bitmap-font as XFAIL
I don't know where the PDF failure is coming from, (it appears
to be using a too-small font in the rotate cairo_show_text
case), but I'm seeing the same behavior in 1.4.10 so this
is not a regression compared to that for the purpose of the
1.4.12 release.
2007-11-26 21:24:54 -08:00
Carl Worth
bc67e2a37b Update two PS reference images for mysterious single-pixel change
It seems ft-vertical-layout-type1 and ft-vertical-layout-type3
change rasterization slightly from time to time, (may be due
to changes in the system installation of ghostscript).
2007-11-26 21:24:54 -08:00
Richard Hult
476f888f4e [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).
(cherry picked from commit 4270cd3358)
2007-11-26 21:24:54 -08:00
Brian Ewins
5c2ad5f69d [configure.in] fix atsui experimental warning
The 'experimental' warning for atsui was appearing
for --enable-quartz not --enable-atsui as it should.
(cherry picked from commit 3141b21c0c)
2007-11-26 21:24:54 -08:00
Keith Packard
e9de14eb4d Force non-AA text when using a bitmap strike with only scaling transform.
When the current font size matches one of the available fixed sizes, and
the overall transform has only scaling components, FreeType will use the
fixed size bitmaps by default. For glyphs which do not have bitmaps,
force them to be rendered in monochrome instead of anti-aliased so
that they all match nicely.
(cherry picked from commit 06af5c2891)
2007-11-26 21:24:53 -08:00
Carl Worth
19e29dfb80 Fix degenerate-pen test case by removing the triggering assertion
Instead we choose either the first or last pen vertex as
appropriate.

This makes the degenerate-pen pass stop failing on an
assertion, and passes for most backends. It's still failing
for the PDF backend, but that looks like a new, PDF-specific
bug.
(cherry picked from commit 448c931425)
2007-11-26 21:24:53 -08:00
Carl Worth
efcaee8f83 Limit miters for small angles
This fixes the current failure get-path-extents, which is a
demonstration of the following bug:

	cairo_stroke_extents() gives wrong result for arcs in some cases
	https://bugs.freedesktop.org/show_bug.cgi?id=7245

Many thanks to Michael Urman whose review of early versions of
this work found a fatal mistake in my algebra.
(cherry picked from commit 00d701ff7d)
2007-11-26 21:24:53 -08:00
Chris Wilson
b7baef1433 [cairo-surface] Fix typo in doc.
s/INVALUE_FORMAT/INVALID_FORMAT/
(cherry picked from commit 0d42af2427)
2007-11-26 21:24:53 -08:00
Carl Worth
7c70113149 Fix typo in _cairo_gstate_fini
Obrigado a Luiz Americo Pereira Camara <luizmed@oi.com.br>
(cherry picked from commit a69d473130)
2007-11-26 21:24:52 -08:00
Brian Ewins
0ec9e1b4fa [quartz] return status instead of CGPatternRef
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
(cherry picked from commit 8f6abdbc26)
2007-11-26 21:24:52 -08:00
Brian Ewins
a83e546253 [quartz] return status instead of cairo_quartz_surface_t
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
(cherry picked from commit cfb26fdf0f)
2007-11-26 21:24:52 -08:00
Brian Ewins
0951d2a9ab [quartz] return status instead of CGShadingRef
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error. Suggested by Chris Wilson.
(cherry picked from commit dec3099585)
2007-11-26 21:24:52 -08:00
Brian Ewins
044de7fa7a fix dash-zero-length test
Quartz was failing the dash-zero-length test for odd numbers
of dashes; it seems cairo wants 3 dashes to be on-off-on,
off-on-off, wheras quartz uses on-off-on, on-off-on. Fixed
by doubling the number of dashes used.
(cherry picked from commit b9c065df74)
2007-11-26 21:24:51 -08:00
Brian Ewins
5a3aa313d4 Implement EXTEND_NONE for gradients.
Fixes linear and radial gradients, which were displaying with
extend_pad when extend_none was requested. Makes the
radial-gradient test pass.
(cherry picked from commit f334ee0397)
2007-11-26 21:24:51 -08:00
Brian Ewins
977ba306f9 call _cairo_error on failure
Call _cairo_error to enable setting a breakpoint on quartz errors.
(cherry picked from commit 0eeec372c0)
2007-11-26 21:24:51 -08:00
Brian Ewins
4fdc3a69fd do not return a cairo_status_t of UNSUPPORTED
We had a bug which converted cairo_int_status_t to cairo_status_t,
causing an assertion; reported at http://developer.imendio.com/node/128.
Return the generic out of memory error instead.
(cherry picked from commit 8c8ec63903)
2007-11-26 21:24:51 -08:00
Brian Ewins
6e4ff01d0b do not ignore errors, return NULL instead (moz#874315)
In the quartz backend there are occasional errors where returning NULL
can be used to signal that an error has occured.

Mozilla bug #874315.
(cherry picked from commit 6fec51990e)
2007-11-26 21:24:50 -08:00
Brian Ewins
ca132774c4 do not ignore errors in setup_source
In setup_source we were ignoring a return value, but we can't relay
it to the caller. This patch treats the error as an unsupported
operation.
(cherry picked from commit 07fd091e3e)
2007-11-26 21:24:50 -08:00
Brian Ewins
f27164c899 do not ignore errors when creating styles.
This fixes statuses being ignored when calling
CreateSizedCopyOfStyle. As a side effect, it cleans up
two other bugs - the font object was sometimes not
freed, and a the scaled font mutex was aquired recursively,
causing a hang in the invalid-matrix test.
(cherry picked from commit b6b9cef713)
2007-11-26 21:24:50 -08:00
Brian Ewins
c00bf48648 do not ignore ATSUI errors.
This fixes multiple instances where the return value of an ATSUI
call was ignored and converts them into CAIRO_STATUS_NO_MEMORY.
As a side effect it fixes a utf8 array not being freed.
(cherry picked from commit 4885a12c68)
2007-11-26 21:24:50 -08:00
Brian Ewins
23b6c2fe9d do not ignore errors in glyph paths
When interpreting glyph paths in ATSUI callbacks we were ignoring
the cairo status. We need to return this to the caller. In order
to do this we introduce a custom OSStatus code in the range that
Apple reccommend.
(cherry picked from commit b498c928be)
2007-11-26 21:24:50 -08:00
Chris Wilson
b7af909c82 [cairo-xlib] Check source for XRender support.
Do not rely on the assumption that if the destination has render support
then the source has it as well - breaks when the boilerplate disables
render support for a surface.

Similarly do not set the XRender attributes on the source surface
unless it actually has a xrender_format.
(cherry picked from commit 3211d810d3)
2007-11-26 21:24:49 -08:00
Behdad Esfahbod
a81ff21d53 [cairo-xlib] Release glyph surfaces if we made them to be generated
The reasoning is that right now, applications render glyphs to images,
upload it to the X server, and keep a local copy in the cache.  The X
server works hard to reuse glyph renderings, by hashing glyph images and
reusing them.  So we are wasting memory in cairo apps that don't use the
glyph surface after uploading to the server, which is the case if you
don't use the glyph in an image surface.  The patch does not release the
glyph surface if it already existed in the cache, so, worst case
scenario is that we render the glyph twice, if you first use it with
xlib, then with image surface.  That effect should be negligible.
(cherry picked from commit 76e3b3cdc3)
2007-11-26 21:24:49 -08:00
Chris Wilson
c1464e04c4 [cairo-xlib-surface] Match content to xrender_format using the channel masks.
_xrender_format_to_content() was using the channel offset to determine
whether the format supported a content type.
For example, the XRenderPictFormat for the A8 format looks like:
    direct.alpha = 0; direct.alphaMask = 0xff;
    direct.red   = 0; direct.redMask   = 0x00;
    direct.green = 0; direct.greenMask = 0x00;
    direct.blue  = 0; direct.blueMask  = 0x00;
which _xrender_format_to_content() matched as CAIRO_CONTENT_COLOR.

Switch to using the channel masks for deducing content type.
(cherry picked from commit 8ae7782737)
2007-11-26 21:24:49 -08:00
Chris Heath
2e76f8b617 [autogen.sh] Tolerate tput failure (#12757)
(cherry picked from commit 189feaf352)
2007-11-26 21:24:48 -08:00
Vladimir Vukicevic
198dc3573f [win32] return a nil surface, not NULL
Missed an error return
(cherry picked from commit c99d33b10e)
2007-11-26 21:24:48 -08:00
Vladimir Vukicevic
bf67f28746 [win32] report error correctly if CreateCompatibleBitmap fails
These errors were being dropped on the floor, leading to
rendering errors in out of video memory conditions.
(cherry picked from commit 4dbf495515)
2007-11-26 21:24:48 -08:00
Behdad Esfahbod
0368f0d208 [ChangeLog.mk] Fix changelog generation rules
Previously it was trying to get logs of 1.2.0..1.4 while I really meant
was 1.2.0..1.4.0.  It was a simple typo.
(cherry picked from commit b12ed375cf)
2007-11-26 21:24:48 -08:00
Chris Wilson
03906e1d81 [cairo-scaled-font] Acquire mutex around _cairo_scaled_font_glyph_path().
All calls that manipulate the scaled_font->cache must hold its mutex.
(cherry picked from commit 6e93941a76)
2007-11-26 21:24:47 -08:00
Chris Wilson
886bd8ee9b [cairo-path] Check for an empty path in cairo_append_path().
As we now generate empty paths, we must be able to handle empty paths
in the user facing API. cairo_append_path() has an explicit check, and
raises an error, for a NULL path->data, so we need to check the
path->num_data first for empty paths.
(cherry picked from commit ef5f460eb1)
2007-11-26 21:24:47 -08:00
Chris Wilson
3454ef0984 [malloc] Take advantage of calloc() argument checking.
calloc() will check its arguments for integer overflows so it is safer
not to pre-multiply them.
(cherry picked from commit 6666459655)
2007-11-26 21:24:46 -08:00
Chris Wilson
a5b74da68b [malloc] Check for integer overflow when realloc'ing.
Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the
arguments to realloc instead.
(cherry picked from commit e49bcde27f)
2007-11-26 21:24:46 -08:00
Chris Wilson
96d0c44ac8 [cairo-path] Don't raise an error when attempting to create an empty path.
Generate a real empty path structure instead of returning
_cairo_path_nil, if we have been asked to create an empty path.

(Also add a couple of missing _cairo_error()s and an appropriate test
case.)

Spotted by Fred Kiefer.
(cherry picked from commit b4f86638cc)
2007-11-26 21:24:46 -08:00
Adrian Johnson
fb62103c7b CFF Subetting: Fix for #10849
This fixes the problem Apple Preview has with viewing PDFs with CFF
font subsets.
(cherry picked from commit 042c382c09)
2007-11-26 21:24:45 -08:00
Adrian Johnson
9457131f8b 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.
(cherry picked from commit b20e08999e)
2007-11-26 21:24:45 -08:00
Brian Ewins
4e2a11e0f1 [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.
(cherry picked from commit 8132b8b417)
2007-11-26 21:24:45 -08:00
Vladimir Vukicevic
d672c26396 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.
(cherry picked from commit 6020f67f1a)
2007-11-26 21:24:44 -08:00
Vladimir Vukicevic
d5bdb91809 Make NO_MUTEX really mean no mutexes
(cherry picked from commit e3c16e15e3)
2007-11-26 21:24:44 -08:00
Behdad Esfahbod
1ea1fadf7e [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.
(cherry picked from commit 79d975f84b)
2007-11-26 21:24:41 -08:00
Behdad Esfahbod
57bc62a61e =?utf-8?q?[ChangeLog.mk]=20Make=20make=20rule=20depend=20on=20.git/HEAD,=20not=20.git
=20That=20is=20exactly=20what=20we=20want.=20=20Kristian=20H=C3=B8gsberg=20suggested=20it.
=20(cherry=20picked=20from=20commit=2021ab44f11d3d20eead5d988c7a6cf48eebff08c7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
2007-11-26 21:24:41 -08:00
Chris Wilson
7092924195 [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.
(cherry picked from commit d62f886168)
2007-11-26 21:24:41 -08:00
Adrian Johnson
9b0a093547 Create meta-surface source image with same content type as the
meta-surface
(cherry picked from commit 1e21220f0e)
2007-11-26 21:24:41 -08:00
Adrian Johnson
fce1a3fdd4 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.
(cherry picked from commit 875e32178e)
2007-11-26 21:24:41 -08:00
Behdad Esfahbod
11d83334ce [configure.in] Fix non-pkgconfig Xrender detection path (#4724)
(cherry picked from commit b85032584b)
2007-11-26 21:24:40 -08:00
Adrian Johnson
c92dae4144 Fix PDF gradients bug
The PDF surface was adding extra stops at the 0.0 and 1.0 offset when
there was not already stops at these offsets. This has been replaced
with code to move the coordinates of the linear gradient line in to
the position of the first and last offset.
(cherry picked from commit 3216275fd9)
2007-11-26 21:24:40 -08:00
Vladimir Vukicevic
66add99fb6 [win32] call scaled_font_fini in create before returning NULL
(cherry picked from commit bdc70d1fc2)
2007-11-26 21:24:40 -08:00