summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-operators.c
Commit message (Collapse)AuthorAgeFilesLines
* Make cairo_tag_begin/end work correctly in groupsAdrian Johnson2023-04-181-4/+10
| | | | Fixes #508
* Misc. typosluz.paz2019-01-311-2/+2
| | | | | | | Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint` Follow up of 12cb59be7da Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-1/+1
| | | | | | | | | | _cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Cairo trivial typosUnknown2018-04-021-1/+1
| | | | | | | | | | | | | Found using `codespell -q 3 -I cairo-whitelist.txt` whereby whitelist contained: ``` amin iff lod writen ``` Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* pdf-operators: fix bug in line wrappingAdrian Johnson2017-03-021-1/+2
| | | | | | patch by jmmorlan@sonic.net https://bugs.freedesktop.org/show_bug.cgi?id=100029
* pdf: structured text and hyperlink supportAdrian Johnson2016-10-011-0/+37
|
* pdf: change from pdf coordinates to cairo coordinatesAdrian Johnson2016-06-051-3/+0
| | | | | | | | | | | | | | | | | When an unbounded recording surface is used multiple times with different extents for each operation we need the XObject containing the recording surface to have the same origin for each operation. This is not possible when the recording surface is converted to PDF coordinates because each operation has different extents resulting in a different origin when the Y-axis is flipped (since the flip matrix depends on the recording surface height which for unbounded surfaces depends on the extents of the operation that paints the recording surface). Switching to cairo coordinates by emitting a Y-axis flip matrix as the first object of each page allows the recording surface to be emitted in cairo coordinates. This results in the same origin for all operations using the recording surface XObject.
* pdf-operators: fix bug with RTL textAdrian Johnson2014-11-201-1/+5
| | | | bug 86461
* pdf-operators: only wrap text strings for PS outputAdrian Johnson2014-10-311-6/+10
| | | | | | | | | | | | | since the PS Document Structing Conventions impose a 255 character line limit. PDF does not require wrapping. pdf-operators is designed to emit the same output for PS and PDF. Unfortunately some PDF interpreters don't like strings split with '\\\n' and some PS interpreters don't like strings split with ')('. So we are forced to make pdf-operators handling string wrapping differently for PDF and PS. Bug 85662
* pdf: don't use '\' to split strings across multiple linesAdrian Johnson2014-10-121-1/+1
| | | | | The PDF interpreter in my printer does not handle this correctly. So instead we add the string delimiters '(' and ')' to each line.
* pdf: fix rectangle stroke with non rectilinear penAdrian Johnson2013-12-261-1/+3
|
* pdf/ps: avoid outputting excess decimal places in matricesAdrian Johnson2013-12-071-12/+5
| | | | | | | | | | Sometimes as a result of rounding errors in matrix transformations the matrices in ps/pdf output look like: 0.000000000000000061 1 1 -0.000000000000000061 0 842 cm This patch rounds to zero matrix elements that are very small compared to other elements in the same matrix.
* Introduce a new compositor architectureChris Wilson2011-09-121-1/+1
| | | | | | | | | | | | | | | | | | Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
* clip: Rudimentary support for clip-polygon extractionChris Wilson2011-07-191-6/+6
| | | | | | | Step 1, fix the failings sighted recently by tracking clip-boxes as an explicit property of the clipping and of composition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* path: Always interpret in forward directionAndrea Canciani2010-12-101-1/+0
| | | | | | Path are always interpreted in forward direction, so the ability of interpreting in the opposite direction (which is very unlikely to be useful at all) can be removed.
* pdf: Silence compiler for an impossible caseChris Wilson2010-11-221-0/+4
| | | | | | | | | | | Make the default case be an assert to catch a silly programming error and silence the compiler: cairo-pdf-operators.c: In function ‘_word_wrap_stream_write’: cairo-pdf-operators.c:300: warning: ‘count’ may be used uninitialized in this function Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* PDF: Restrict ActualText to PDF version >= 1.5Adrian Johnson2010-11-101-13/+18
| | | | | | | | | The use of ActualText in a marked content sequence is a PDF 1.5 feature. A 'use_actual_text' flag linked to the PDF version has already been implemented in pdf-operators but for some reason this flag had not been used to control the use of ActualText.
* Rewrite pdf-operators word wrappingAdrian Johnson2010-10-081-118/+113
| | | | to fix some bugs
* pdf-operators: word wrap latin text stringsAdrian Johnson2010-10-021-8/+65
|
* pdf-operators: fix bug that was causing unnecessary repositioning of textAdrian Johnson2010-10-011-1/+6
| | | | | This optimizes the output to increase the maximum amount of text that is emitted with a single Tj operator.
* pdf-operators: output (abc) style strings when font is latinAdrian Johnson2010-10-011-15/+42
|
* pdf: Assert that no other error can occur for an invertible matrix.Chris Wilson2010-05-041-2/+1
|
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* pdf: Suppress compiler warning.Chris Wilson2010-04-231-6/+6
|
* PDF-operators: ensure text operations flushed before emitting clipAdrian Johnson2010-04-101-0/+6
|
* Constify stroke style and matrices.Chris Wilson2010-01-221-19/+19
| | | | | | As a simple step to ensure that we do not inadvertently modify (or at least generate compiler warns if we try) user data, mark the incoming style and matrices as constant.
* Move _cairo_error() to a standalone headerChris Wilson2010-01-221-0/+1
| | | | | A pending commit will want to include some utility code from cairo and so we need to extricate the error handling from the PLT symbol hiding.
* Provide a builtin implementation of isspace() and isdigit()Adrian Johnson2009-10-291-4/+2
| | | | The glibc versions are slow in utf8 locales.
* Spelling corrections: s/it's/its/Daniel Holbert2009-01-291-1/+1
| | | | | | | | | As a fun itch to scratch, I've been fixing incorrect uses of the contraction "it's" in comments within the mozilla source tree (tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=458167 ), and I ran across 6 instances of this typo in mozilla's snapshot of cairo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* [path] Mark points as const during _cairo_path_fixed_interpret()Chris Wilson2008-12-121-5/+7
| | | | | Use const to document the read-only nature of the arguments passed to the callbacks.
* Mark allocation failures as unlikely.Chris Wilson2008-11-291-3/+3
| | | | | Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
* Mark if(status) as being unlikely.Chris Wilson2008-11-291-30/+30
| | | | | The error paths should be hit very rarely during normal operation, so mark them as being unlikely so gcc may emit better code.
* PDF: Disable PDF 1.5 features when version 1.4 is selectedAdrian Johnson2008-11-241-0/+8
| | | | | JPEG 2000 image embedding and ActualText marked content are PDF 1.5 features.
* Add CairoScript backend.Chris Wilson2008-11-131-0/+1
| | | | | | | | | | A new meta-surface backend for serialising drawing operations to a CairoScript file. The principal use (as currently envisaged) is to provide a round-trip testing mechanism for CairoScript - i.e. we can generate script files for every test in the suite and check that we can replay them with perfect fidelity. (Obviously this does not provide complete coverage of CairoScript's syntax, but should give reasonable coverage over the operators.)
* [pdf] Propagate statusChris Wilson2008-09-261-3/+11
| | | | Check and return a few forgotten error codes from static functions.
* [pdf] Do not modify the dashes in-place.Chris Wilson2008-09-231-2/+12
| | | | | | | As PS has different semantics regarding a zero-length dash, we need to adjust the dash array before emitting. However, we need to modify a copy of the dash array since the same array may be used by the meta-surface when replaying to an image fallback.
* [show_text_glyphs] Replace the bool backward with cairo_text_cluster_flagsBehdad Esfahbod2008-09-181-7/+7
| | | | | | | | | | Chris rightfully complained that having a boolean function argument is new in cairo_show_text_glyphs, and indeed avoiding them has been one of the API design criteria for cairo. Trying to come up with alternatives, Owen suggested using a flag type which nicely solves the problem AND future-proofs such a complex API. Please welcome _flags_t APIs to cairo.h
* Revamp the build system.Behdad Esfahbod2008-09-021-0/+5
| | | | | | | | | | | | | | | | | Quick summary of changes: - Move list of cairo source files out of src/Makefile.am and into src/Sources.mk, - Generate files src/Config.mk and src/Config.mk.win32 that choose the right set of source files and headers based on configured backends and features. This drastically simplifies building using other build systems. The src/Makefile.win32 file needs to be updated to reflect these changes. - Add README files to various directories, - Add toplevel HACKING file.
* [pdf-operators] Propagate status from end_text().Chris Wilson2008-08-171-3/+9
| | | | Check for an error status after end_text().
* [pdf-operators] Propagate error from emit_glyph_string*().Chris Wilson2008-08-171-5/+5
| | | | | Do not overwrite the error status if returned by either of the emit_glyph_string*() routines.
* [pdf-operators] Propagate error from begin_actualtext().Chris Wilson2008-08-171-0/+3
| | | | Check the status return from begin_actualtext().
* [pdf-operators] Add note about clusters with no glyphsBehdad Esfahbod2008-08-081-0/+2
|
* Make utf8 handling in font subsets more consistentBehdad Esfahbod2008-08-081-2/+2
|
* [pdf] Propagate status from emit_glyph()Chris Wilson2008-08-061-3/+6
| | | | Propagate the error status from _cairo_pdf_operators_emit_glyph().
* PDF/PS: Remember the current line styleAdrian Johnson2008-07-081-14/+34
| | | | So we don't need to emit line style parameters that are already set.
* Add PDF operators function to reset any remembered stateAdrian Johnson2008-07-081-0/+15
|
* PDF: Limit precision of Td operandsAdrian Johnson2008-07-081-0/+6
| | | | | | As the translation is in text space, the full precision of a double for numbers close to zero is not required. Limit the precision to the same as for numbers > 1.
* PDF: Fix glyph positioning bug in Tj operatorAdrian Johnson2008-07-051-1/+1
| | | | | | Previously this was not correctly checking the position of the first glyph and falling back to using TJ if the glyph was not at the the standard glyph advance.
* PDF: Fix glyph positioning bug in TJ operatorAdrian Johnson2008-07-051-2/+1
| | | | | Previously this was not correctly positioning the first glyph in a TJ string if the glyph was not at the the standard glyph advance.
* Add missing status checksAdrian Johnson2008-07-031-0/+5
|