The bug did not occur on x86 due to 'id' being the first member of the
struct. However on some architectures this would result in an invalid
pattern id.
In ecb895803b Carl made fallback show_glyphs
always use a A8 mask in case of mixed-format glyphs. That's suboptimal if
there are ARGB32 glyphs. Using masks smartly we can implement the desired
behavior. Done now.
Cherry picked from commit 22d7f311f7
This fixes the remaining image-backend problems with bug 13479:
Ugly Courier New font with cairo 1.4.12
https://bugs.freedesktop.org/show_bug.cgi?id=13479
although the xlib-backend had been fixed previously.
Specifically, if an A1 glyph is first encountered, then subsequent
glyphs will still be rendered with antialiasing, (previously they
would be rendered very poorly without antialiasing).
Similarly, if the first glyph encountered has component-alpha
sub-pixel antialiasing and then an A1 or A8 glyph is encountered
then all glyphs will rendered in A8 (grayscale antialiasing).
Previously, the non-subpixel-antialiased glyphs would not appear
at all.
Cherry picked from commit ecb895803b
We maintain three Xrender glyphsets per scaled font, one for each of A1, A8,
and ARGB32. This is required to correctly support fonts with bitmaps for
some glyphs but not all.
(cherry picked from commit 805b668260)
The reasoning for that commit was that fonts with bitmap strikes should be
rendered with antialiasing off for those (hopefully) few glyphs that don't
have a bitmap.
However, it turns out, there are fonts that have some, but very few, bitmaps,
and this changed forces non-AA rendering on them. We now support multiple
glyph formats per font in the Xlib backend, so backing this out to let every
glyph render as is. Fontconfig rules can be used to force AA off on a per-font
basis.
This reverts commit 06af5c2891.
(cherry picked from commit 83963d2a9e)
The original test for wild miters would only work with a square transform
(and, in fact, the original code required an identity transform). Instead of
fixing that, I replaced it with a more obvious test which makes sure the
miter corner lies between the two faces and not out in space somewhere.
(cherry picked from commit 7cf9a6e4e3)
This demonstrates an error in cairo where miter joins are replaced with
bevels at high scale factors due to a test added to eliminate wild miters
drawn when the line faces are nearly parallel.
Cherry picked from commit 81e029edda
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.
(cherry picked from commit 1441e165f2)
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)