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
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.
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).
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)
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)
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)
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)
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
(cherry picked from commit 8f6abdbc26)
Returning status improves error handling, since
returning NULL doesn't let us distinguish different
types of error.
(cherry picked from commit cfb26fdf0f)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
_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)
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)
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)
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)
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)
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)
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)
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)
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)
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)