summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2008-01-18PDF: Add missing struct member when writing the pattern idAdrian Johnson1-2/+2
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.
2008-01-14[scaled-font] Upgrade glyph mask as needed in case of mixed-format glyphsBehdad Esfahbod3-24/+52
In ecb895803b9d2a3fd142f4a2c694ca08c5581f0e 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 22d7f311f7733a57ece5d91708b2b5da9b71de86
2008-01-11Migrate glyph mask to A8 in case of mixed-format glyphs.Carl Worth1-3/+48
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 ecb895803b9d2a3fd142f4a2c694ca08c5581f0e
2008-01-09[cairo-xlib] Support scale fonts with glyphs of multiple formats (#13479)Behdad Esfahbod1-43/+136
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 805b668260c47e6d3d854361fcc53f12bd2a57e1)
2008-01-09[cairo-ft] Revert "Force non-AA text when using a bitmap strike with only ↵Behdad Esfahbod1-24/+0
scaling transform." (#13479) 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 06af5c2891b89da28581c30afcde06c5442884db. (cherry picked from commit 83963d2a9ec445e23cfbe692b877177a9d9d135e)
2008-01-04Directly check the miter corner to detect wild miters.Keith Packard1-82/+57
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 7cf9a6e4e39b18f4967afdb7c3c71eca5f4ba8c7)
2007-12-12PS: fix compiler warning introduced by previous commitAdrian Johnson1-1/+2
2007-12-12PS: Use the correct bounding box in Type 3 fontsAdrian Johnson1-7/+36
Previously this was a fixed size.
2007-12-12Fix regression in Type1 FallbackAdrian Johnson1-2/+4
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 1441e165f2338bc6a8e2945baca77611ff417b2f)
2007-12-12PS: Use correct glyphs widths for Type 3 fontsAdrian Johnson1-1/+7
Previously the widths were set to 0. (cherry picked from commit f4b93cceb7fb83de558ed058915f92d4f75c1a6a)
2007-12-12PS: Fix the bounding boxes of Type 3 glyphsAdrian Johnson1-2/+2
When viewing with ghostscript the glyphs were clipped (cherry picked from commit 78e8d3d9bd2d4652f636a668a3fa53ef9edfd9ae)
2007-12-12PS: Fix typecheck error with Type 3 and recent versions of gsAdrian Johnson1-16/+24
Ghostscipt requires the encoding vector to be filled in.
2007-12-12PS: Ensure that xyshow operator has a pair of offsets for each glyphAdrian Johnson1-1/+1
The last entry should have been "0 0" instead of "0". (cherry picked from commit 5e8f60531a09f357db38c4b646b1bbd29b97a891)
2007-12-05Fix version check for buggy_repeat on modular Xserver 1.xBernardo Innocenti1-1/+1
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 d4138d1161c6b683fd0ef62a8d49ccf4ec4674bc
2007-11-26[atsui] Use ascent+descent+leading to get the distance between baselinesRichard Hult1-1/+1
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 4270cd3358fabf0d3e6ac4e866099b172082b592)
2007-11-26Force non-AA text when using a bitmap strike with only scaling transform.Keith Packard1-0/+24
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 06af5c2891b89da28581c30afcde06c5442884db)
2007-11-26Fix degenerate-pen test case by removing the triggering assertionCarl Worth1-1/+15
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 448c9314252bba779194d2b01950b8738b26fd13)
2007-11-26Limit miters for small anglesCarl Worth1-1/+75
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 00d701ff7de68609aa8cec7871d93b27a108fd14)
2007-11-26[cairo-surface] Fix typo in doc.Chris Wilson1-1/+1
s/INVALUE_FORMAT/INVALID_FORMAT/ (cherry picked from commit 0d42af2427d1de27845cb8a6b3d290a562c28fc6)
2007-11-26Fix typo in _cairo_gstate_finiCarl Worth1-1/+1
Obrigado a Luiz Americo Pereira Camara <luizmed@oi.com.br> (cherry picked from commit a69d4731300b430b802222d317698c313c75a31a)
2007-11-26[quartz] return status instead of CGPatternRefBrian Ewins1-9/+11
Returning status improves error handling, since returning NULL doesn't let us distinguish different types of error. (cherry picked from commit 8f6abdbc26ee15451b5a386610f7d5a7a9114d63)
2007-11-26[quartz] return status instead of cairo_quartz_surface_tBrian Ewins1-12/+14
Returning status improves error handling, since returning NULL doesn't let us distinguish different types of error. (cherry picked from commit cfb26fdf0f490b4902106b50d02628cffd53a0eb)
2007-11-26[quartz] return status instead of CGShadingRefBrian Ewins1-14/+16
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 dec3099585eeb184ed51b5c720eb891314d7ea51)
2007-11-26fix dash-zero-length testBrian Ewins1-5/+11
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 b9c065df74027b06e15e105fee5e4a4d350e0abf)
2007-11-26Implement EXTEND_NONE for gradients.Brian Ewins1-2/+4
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 f334ee0397963e12c9efcb2690792aac83734661)
2007-11-26call _cairo_error on failureBrian Ewins1-0/+1
Call _cairo_error to enable setting a breakpoint on quartz errors. (cherry picked from commit 0eeec372c0e7849d81bde8c8c5bf491919f51a6e)
2007-11-26do not return a cairo_status_t of UNSUPPORTEDBrian Ewins1-3/+12
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 8c8ec63903f8ad67a88394eff1359607bb93cf88)
2007-11-26do not ignore errors, return NULL instead (moz#874315)Brian Ewins1-9/+28
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 6fec51990e90901ebafbb872a9e618cb70d17911)
2007-11-26do not ignore errors in setup_sourceBrian Ewins1-1/+5
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 07fd091e3e6b925c588b9a16f6f10efcd46615c2)
2007-11-26do not ignore errors when creating styles.Brian Ewins1-11/+26
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 b6b9cef7136453f97543173bcb2ade46b1c46b77)
2007-11-26do not ignore ATSUI errors.Brian Ewins1-7/+76
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 4885a12c6863321a566e7103bf6dccdd5d13a986)
2007-11-26do not ignore errors in glyph pathsBrian Ewins1-6/+24
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 b498c928be73635614596243d17a922e9d5ff008)
2007-11-26[cairo-xlib] Check source for XRender support.Chris Wilson1-8/+9
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 3211d810d31a6607c8d78a50f577a8ca8eb705e6)
2007-11-26[cairo-xlib] Release glyph surfaces if we made them to be generatedBehdad Esfahbod1-20/+63
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 76e3b3cdc3dda986d420637cfc2445aca481a863)
2007-11-26[cairo-xlib-surface] Match content to xrender_format using the channel masks.Chris Wilson1-4/+4
_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 8ae778273799ee9f6d3c13e9c41730daeda2c743)
2007-11-26[win32] return a nil surface, not NULLVladimir Vukicevic1-1/+1
Missed an error return (cherry picked from commit c99d33b10e84883ade1402c3c1d1efdb4b46f66e)
2007-11-26[win32] report error correctly if CreateCompatibleBitmap failsVladimir Vukicevic1-1/+19
These errors were being dropped on the floor, leading to rendering errors in out of video memory conditions. (cherry picked from commit 4dbf495515d6de933de7f567b935c5fdceed5f6f)
2007-11-26[cairo-scaled-font] Acquire mutex around _cairo_scaled_font_glyph_path().Chris Wilson1-0/+2
All calls that manipulate the scaled_font->cache must hold its mutex. (cherry picked from commit 6e93941a7605a3958269de195dc16f255dda7bfd)
2007-11-26[cairo-path] Check for an empty path in cairo_append_path().Chris Wilson1-0/+3
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 ef5f460eb1f86a73e016c1150723ae1e70b3b037)
2007-11-26[malloc] Take advantage of calloc() argument checking.Chris Wilson3-4/+4
calloc() will check its arguments for integer overflows so it is safer not to pre-multiply them. (cherry picked from commit 66664596559c55913fb0b9c8784fe8ab862c217b)
2007-11-26[malloc] Check for integer overflow when realloc'ing.Chris Wilson9-13/+46
Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the arguments to realloc instead. (cherry picked from commit e49bcde27f88e21d5b8037a0089a226096f6514b)
2007-11-26[cairo-path] Don't raise an error when attempting to create an empty path.Chris Wilson1-12/+24
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 b4f86638cc4b87bfaf10568ae9beb89626e26613)
2007-11-26CFF Subetting: Fix for #10849Adrian Johnson1-1/+1
This fixes the problem Apple Preview has with viewing PDFs with CFF font subsets. (cherry picked from commit 042c382c094d1ea6f9a5a162d4d1d9ac83413233)
2007-11-26Truetype Subsetting: Avoid failing when fonts are missing optional tablesAdrian Johnson1-43/+110
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 b20e08999e2f6e7a72ee75a7c3fd865bf0368794)
2007-11-26[type1-subset] only subset ft fontsBrian Ewins1-0/+2
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 8132b8b417c75388ce4c4671fffddaa44a5d1be0)
2007-11-26Avoid divide-by-zero when trying to allocate a 0-sized arrayVladimir Vukicevic1-10/+25
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 6020f67f1a49cfe3844c4938d4af24c63c8424cc)
2007-11-26Make NO_MUTEX really mean no mutexesVladimir Vukicevic1-3/+3
(cherry picked from commit e3c16e15e39d98f96e2ce20e397d88214f5a821e)
2007-11-26[cairo-ft-font] Ignore FT_Load_Glyph errors other than out-of-memoryBehdad Esfahbod1-5/+9
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 79d975f84bcc32e91db517d71a7312e2e1d653d4)
2007-11-26[cairo-ft-font] Early detection of a zero sized bitmap.Chris Wilson1-0/+6
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 d62f8861689d8b9a9a837043fb78813f0407abd4)
2007-11-26Create meta-surface source image with same content type as theAdrian Johnson1-3/+3
meta-surface (cherry picked from commit 1e21220f0e2540e3befa66e4764f75589d0eef82)