summaryrefslogtreecommitdiff
path: root/src/cairo-ps-surface.c
Commit message (Collapse)AuthorAgeFilesLines
* doc: Escape percent signKhaled Hosny2023-02-021-1/+1
| | | | Otherwise gtk-doc will eat one of them.
* PDF Type 3 color fontsAdrian Johnson2023-01-291-10/+3
| | | | | | | | | This implements Type 3 color fonts for PDF for any font with a CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE. This includes user-fonts, SVG fonts, and COLR fonts. Glyphs with foreground colors are not yet implemented as Type 3 glyphs and will be rendered as images by cairo-surface.
* Mime type updatesAdrian Johnson2023-01-281-3/+5
|
* Fix shared use of recording surface with paginated targetsAdrian Johnson2023-01-151-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is _cairo_recording_surface_replay_and_create_regions() stores the cairo_recording_region_type_t in the same structure as the recording commands. This does not work well when the recording surface is used as source by multiple surfaces Fix this by moving the cairo_recording_region_type_t into a separate struct cairo_recording_regions_array_t. This struct is stored in a list that allows multiple create regions results to be store in the surface. The new function _cairo_recording_surface_region_array_attach() is used to create a new cairo_recording_regions_array_t, attach it to the recording surface and return a unique region id. The _cairo_recording_surface_replay_and_create_regions() and _cairo_recording_surface_replay_region() functions use this region id to identify the cairo_recording_regions_array_t. To handle nested recording surfaces, when replaying a recording, the region id is passed to the target as an extra parameter in the surface pattern. The wrapper surface makes a temporary copy of the pattern to ensure the snapshot pattern in the recording surface is not modified. cairo_recording_regions_array_t has a reference count so the target can hold on to the cairo_recording_regions_array_t after the paginated surface has called _cairo_recording_surface_region_array_remove().
* PS: Wrap embedded EPS in %%BeginDocument/%%EndDocument as required by EPS specAdrian Johnson2023-01-121-0/+4
| | | | Fixes #620
* Merge branch 'mingw-fixes' into 'master'Adrian Johnson2023-01-031-6/+8
|\ | | | | | | | | Fix mingw build failure when SVG fonts enabled See merge request cairo/cairo!389
| * Use _cairo_strndup where appropriateAdrian Johnson2023-01-031-6/+8
| |
* | Fix user-font with foreground in group failures on image, PDF, and PSAdrian Johnson2023-01-031-34/+0
|/
* ps: Fix crash in self-copy-overlapUli Schlachter2022-12-281-1/+1
| | | | | | | | | | | | According to valgrind, there is a use-after-free here. The function _cairo_ps_surface_emit_surface() temporarily replaces some member of a struct and then later re-sets it. However, there is an early return possible that would skip that part of the code. This commit moves the re-set up so that no freed pointers are left behind. This seems to fix the crash. Signed-off-by: Uli Schlachter <psychon@znc.in>
* fixed double free in _cairo_ps_surface_emit_base85_stringAyman El Didi2022-04-201-5/+7
| | | | | | | | | | When taking the CAIRO_PS_COMPRESS_DEFLATE branch of the switch statement in _cairo_ps_surface_emit_base85_string, memory is freed a second time when closing the deflate_stream fails after performing a write. The status is now simply returned instead of attempting to free it again.
* Add CAIRO_DEBUG_PS_NO_DATE env var to remove date from PS outputAdrian Johnson2022-04-051-6/+10
| | | | Fixes #537
* Fix typos in doxygen and source commentsluz paz2022-03-281-1/+1
|
* Fix PS emit image for 16-bit imagesAdrian Johnson2021-08-221-1/+1
|
* Fix some mingw warnings and correct the value of R_OKAdrian Johnson2021-08-071-1/+5
|
* PS: ensure setup DSC comments are in BeginSetup sectionAdrian Johnson2021-07-231-11/+11
| | | | Fixes #411
* Update DSC documentionAdrian Johnson2021-07-181-1/+1
| | | | Fixes #380
* Misc. typosluz.paz2019-01-311-1/+1
| | | | | | | 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>
* ps: fix invalid matrix in eps embeddingAdrian Johnson2018-12-021-0/+5
|
* Use HTTPS URLs for cairographics.org domainsPaul Menzel2018-10-161-1/+1
| | | | | | | | Run the command below suggested by geirha in ##sed@irc.freenode.net. git grep -l 'http://.*cairographics.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}cairographics\.org\)|https\1|g' Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-5/+5
| | | | | | | | | | _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>
* ps: fix compile warningAdrian Johnson2017-12-081-2/+2
| | | | https://lists.cairographics.org/archives/cairo/2017-December/028481.html
* ps: fix compile with old versions of MSVCAdrian Johnson2017-11-201-1/+1
| | | | https://lists.cairographics.org/archives/cairo/2017-November/028452.html
* ps: fix extend-*-similar failuresAdrian Johnson2017-11-101-18/+21
|
* ps: fix padded image crashAdrian Johnson2017-11-091-5/+3
|
* ps: prevent self-copy infinite loopAdrian Johnson2017-11-091-1/+23
|
* ps: add CAIRO_MIME_TYPE_EPS mime type for embedding EPS filesAdrian Johnson2017-11-091-8/+175
|
* ps: use Reusable streams for forms in Level 3Adrian Johnson2017-11-091-8/+49
| | | | to avoid emitting image data as strings
* ps: use forms for surfaces with UNIQUE_ID mime typeAdrian Johnson2017-11-091-140/+525
| | | | | | to ensure the surfaces are emitted only once. fixes mime-unique-id PS output
* ps: don't acquire image or snapshot in acquire_source_image_from_patternAdrian Johnson2017-11-091-95/+61
| | | | otherwise emit_surface may not see the mime data
* ps: use << >> for dictionaries instead of dict begin endAdrian Johnson2017-11-091-48/+46
|
* ps: remove unused prologAdrian Johnson2017-11-091-3/+0
|
* ps: emit base85 strings instead of strings of base85Adrian Johnson2017-11-091-107/+79
| | | | | | | | | | | | When image data is emitted as strings (required when an image is used in a PaintProc), the base85 encoded data was emitted inside PS strings (...) and the image filters included an ASCI85Decode filter. This has been changed to emit the strings as ASCII85 strings <~...~> and remove the ASCII85Decode filter since the base85 is decoded when the string is parsed. Also factor out the string data source procedure into the prolog.
* Allow mime image to be different size to cairo imageAdrian Johnson2017-10-221-5/+24
| | | | | | | | | | | | | | | Previously it was assumed the mime image size is the same as the cairo image surface size. When using the 1 bpp formats (CCITT, JBIG2), creating a cairo image of the same size will have very large memory requirements and in some case may exceed the pixman image size limits. In these cases it is useful to allow the mime image to have a different resolution to the cairo image and in the PDF/PS output scale the mime image to be the same physical size as the cairo image. In PDF, this is easy as all PDF images are scaled to 1x1 unit and the CTM is used to scale the image to the required size. The PS surface has been changed to also scale images to 1x1 and use the CTM to get the required size.
* Add CCITT_FAX mime type for PDF and PS surfacesAdrian Johnson2017-10-221-17/+183
| | | | | | | | | | | This completes the full set of PDF/PS image filters allowing image data to be passed though without decompressing then recompresssing in a less efficient format. The difficulty with CCITT_FAX is it needs some decoding parameters that are not stored inside the image data. This is achieved by using an additional mime type CCITT_FAX_PARAMS that contains the params in key=value format.
* replace _BSD_SOURCE with _DEFAULT_SOURCEAdrian Johnson2017-09-161-1/+1
| | | | | | fixes the warning: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
* Support tag operations in analysis and paginated surfaceAdrian Johnson2016-10-011-1/+3
|
* ps/pdf: remove debug and commented out codeAdrian Johnson2016-07-151-31/+0
|
* ps: flush ASCII85Decode file after useAdrian Johnson2016-07-151-7/+18
| | | | | | | | | | If the image operator does not read all the ASCII85 data, the PS interpreter will try to execute the next byte of unread data. Define our own image operator that calls flushfile (reads until end of file) on the filter after drawing the image. https://bugs.freedesktop.org/show_bug.cgi?id=84811
* Fix PS record-neg-extents test failureAdrian Johnson2016-06-051-230/+308
|
* ps: change from ps coordinates to cairo coordinatesAdrian Johnson2016-06-051-13/+21
|
* Don't cull very thin lines on vector surfacesAdrian Johnson2015-10-171-1/+2
| | | | | | On vector surfaces, use a minimum line width when calculating extents. Bug 77298
* ps: fix subsurface recordingsAdrian Johnson2015-10-171-18/+17
|
* ps: fix raster source patternsAdrian Johnson2015-10-171-0/+1
|
* ps: merge emit_recording surface and emit_recording_subsurface into one functionAdrian Johnson2015-10-051-99/+31
| | | | Most of each function was identical.
* pdf-operators: only wrap text strings for PS outputAdrian Johnson2014-10-311-3/+6
| | | | | | | | | | | | | 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
* ps: add font DSC commentsAdrian Johnson2014-01-111-9/+25
|
* ps: cairo_set_page_size does not need to be in eps outputAdrian Johnson2014-01-111-32/+36
|
* ps: use setpagedevice to set page sizeAdrian Johnson2014-01-111-1/+39
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=73452
* ps: fix imagemask with pattern source failure on some printersAdrian Johnson2014-01-081-2/+2
| | | | | | | When /PaintProc is invoked the pattern dict is pushed onto the stack. Ensure this dict is removed. https://bugs.freedesktop.org/show_bug.cgi?id=69485