summaryrefslogtreecommitdiff
path: root/source/fitz
AgeCommit message (Collapse)Author
2016-03-22Remove dead code.Robin Watts
2016-03-22Tweak paint-glyph.hRobin Watts
Try to limit aliasing issues.
2016-03-21Bug 696668: Update the downscaling logic.Robin Watts
An l2factor of 3 is equivalent to downscaling by a factor of 8. We can get an l2factor of 3 downscale out of the jpeglib. We can reasonably downscale by a further l2factor of 3 manually. Any more than that and we start to completely drop pixels without them having any effect. Therefore it's pointless us keeping any tiles around with l2factors > 6. Fix the bug (which was that we were using < instead of <=) and update the value to a more reasonable one anyway.
2016-03-21Tweak NULL output code.Robin Watts
In the quest for better mutool draw timings, make fz_outputs going to /dev/null be represented by a NULL pointer. Spot this in the output routines and just exit.
2016-03-21Add .ps output to mutool draw.Robin Watts
Simple PS wrapped images with flate compression.
2016-03-21Allow building with old versions of freetype.Tor Andersson
Debian stable still ships with freetype 2.5.2. We normally wouldn't care, but desktop java builds need to use the system freetype library as that's what AWT links against.
2016-03-21Fix error handling in fz_save_pixmap_as_pam.Tor Andersson
2016-03-18Add 1bpp cmyk output to mutool draw.Robin Watts
A request for a .pkm file will produce the same as a pamcmyk4 does on ghostscript. Ghostscripts pkmraw device does a 1bpp cmyk and then converts to rgb as writing to ppm, but that seems silly.
2016-03-16mutool draw: Add banded mode output for pbm files.Robin Watts
2016-03-16Avoid unused var warnings in Memento ref counting code.Robin Watts
2016-03-16glyph plotter; Use repeated inclusion of headerRobin Watts
To avoid having to duplicate a fairly large block of code several times, use repeated inclusion of a header with some macros to generate optimised glyph plotters.
2016-03-16Add optimised CMYK plotters.Robin Watts
We have optimised plotters for 2 and 4 components (i.e. greyscale and rgb). Add equivalent ones for CMYK.
2016-03-16Spot when we are fz_outputting to /dev/null or nul:Robin Watts
2016-03-16Speed pam writing.Robin Watts
2016-03-16Bug 696648: Send -sm output to stderr.Robin Watts
Thanks to Marcos for spotting the missing case.
2016-03-15Tweak fz_try/catch to fix overflow case.Robin Watts
In the current code, when we hit the fz_try(), we check to see if we are about to overflow the exception stack. If we are, we throw. This does NOT throw to the fz_catch following the try, but rather to the enclosing fz_always/fz_catch blocks. This can cause leaks, as it's very hard to code correctly. It would be a far nicer behaviour to have a failure in fz_try() cause us to throw to the immediately following fz_always/fz_catch. This commit achieves that.
2016-03-15Memento: Track fz_streams.Robin Watts
2016-03-15Memento: Avoid warnings building without HAVE_LIBDLRobin Watts
2016-03-15Memento: Rename memento 'globals' to 'memento'.Robin Watts
Neatness.
2016-03-15Make all ref changes on storable items Memento trackable.Robin Watts
2016-03-15Memento: Add Memento_{takeRef,dropRef,reference} functions.Robin Watts
These work with MEMENTO_DETAILS to allow us to store the events where reference counts change.
2016-03-15Fix mode2compress for PCL.Robin Watts
Previously this would overrun buffers in the pathological case (ABBABBABB...). We now only break from literals to runs for a run of at least 3 (except at the start).
2016-03-15Fix leak/missing error cleanup in halftoning code.Robin Watts
Ensure we free buffers if we fail to malloc, and that we drop the temporary buffer at the end of halftoning a pixmap.
2016-03-15Mutool draw: Simplify output handling code.Robin Watts
At the moment we have the output file being opened in several different places, leading to several different places having to cope with the '-' handling. Simplify the code so that files are only opened in 1 place.
2016-03-14Remove begin_page and end_page device calls.Tor Andersson
To be moved into a new document writer interface later.
2016-03-14Fix 696507: Clamp correct values in fz_invert_pixmap_rect.Tor Andersson
The loop is exclusive, but the clamp check was as if it were inclusive.
2016-03-14ucdn: Add support for UAX#14 linebreaking classes.Sebastian Rasmussen
2016-03-14xml: Fix linebreak before closing tag test.Tor Andersson
2016-03-14js: Add buffer.save() to write contents of buffer to file.Tor Andersson
2016-03-11Fix various warnings.Robin Watts
"Defined but not used" and "Set but not used" as seen with ndk-build.
2016-03-11Implement fz_text_language support functions.Robin Watts
Add code to convert to and from fz_text_language codes from ISO 639 language strings. No validation is carried out.
2016-03-11Rejig Bidirectional and Text code.Robin Watts
We move to using bidirectional "levels" throughout. This should give us better behaviour vis-a-vis nested l2r/l2r text. This also allows us to carry xps levels throughout with no loss of information. This also avoids the need to special case numbers. We accordingly carry more information into fz_text. As well as wmode, also hold additional details about the text spans. We now include the directionality of the bidi level text (either as derived from bidi code, or from the original document (e.g. xps)), the directionality of text (as specified in the original document (e.g. html)), and the language of the text (if specified in the original document).
2016-03-10Memento: Pull in latest fixes from gs.Robin Watts
2016-03-07Memento: List block details at closedown.Robin Watts
2016-03-07Memento: Store/display backtraces with blocks.Robin Watts
If built with MEMENTO_DETAILS (on by default), we store the backtrace on every event that affects a block. Memento_details(address) will display the events that affected a block (typically malloc, {realloc}*, free), including the backtrace at each point. Windows and linux use different mechanisms for this. Windows loads a DLL and calls windows specific functions - no extra libraries are required. Linux also loads a shared object (libbacktrace.so). This is not present on all platforms, so on platforms where it is not available we just get addresses. These can be converted using addr2line (unless ASLR is enabled). In order for linux to be able to load libbacktrace.so we link in libdl. If this is not available, define HAVE_LIBDL=no when building the memento target.
2016-03-07Memento: Store callstacks for events.Robin Watts
Add Memento_info(address) that will show the details of a block (callstacks when it was allocatd, realloced, freed etc). This works on MSVC and GNUC using two different methods.
2016-03-03Memento: Speed improvements.Robin Watts
Avoid searching the linked list of blocks in order to remove a block by moving to a doubly linked list. This can be done without increasing the amount of memory in use by making better use of the 'parent' pointer that is only used when displaying nested blocks. Also store magic values in the 'child' and 'sibling' pointers (again only used when displaying nested blocks) so that we can quickly verify that a block is real before doing too much with it. Those changes drastically reduce the time required for MEMENTO_LEAKONLY runs (now the same order of magnitude as non memento runs). Normal memento runs are still very slow when the numbers of blocks increase due to the paranoid checking taking time. To ameliorate this a bit, we try 2 other things. Firstly, we optimise the searching of blocks by making use of int aligned tests. This still doesn't make much difference. Secondly, we introduce a new mechanism for the 'paranoia' levels. If a negative number is given for the paranoia level (say -n) then we first perform our overwrite checks after n events. We next test after 2n events, then 4n, then 8n etc. The new default paranoia level is set to be -1024. This makes a huge difference, and brings normal memento runs down to be comparable with debug runs.
2016-03-02Move UTF-8 string length function to fitz.Sebastian Rasmussen
2016-03-01Fix bug in pcl page size finding code.Robin Watts
Don't bale on the first 'large enough' match.
2016-03-01PCL output: Add code to guess paper sizes.Robin Watts
Guess paper sizes from bitmap dimensions unless the paper size has been specified. If unknown, depending on the properties of the printer, we'll either send a 'custom' paper size (followed by the page size in decipoints), or the next size up. Depending on the capabilities of the printer, we can optionally send orientation too.
2016-02-29Pass fz_font to pdf_add_xxx_font_res instead of a fz_buffer.Tor Andersson
Make sure all fz_fonts have a ft_buffer available.
2016-02-29Make fz_read_line behave like gets and return NULL at EOF.Tor Andersson
2016-02-24Strip trailing whitespace.Tor Andersson
2016-02-24Add fz_show_string function and move wmode argument to end.Tor Andersson
2016-02-24xml: Implement SGML line break rules.Tor Andersson
Always ignore a line break immediately after an opening tag and before a closing tag.
2016-02-24Add fz_new_image_from_file.Tor Andersson
2016-02-24Add optional scissor hint argument to text clipping functions.Tor Andersson
2016-02-24Clarify scissor argument to clip device functions.Tor Andersson
The scissor argument is an optional (potentially NULL) rectangle that can give hints to devices about the area that can be scissored. This is used by the draw device and display list device to minimize the size of temporary clip mask buffers. The scissor rectangle, if used, must have been transformed by the current transform matrix.
2016-02-22Rename fz_path_processor to fz_path_walker.Tor Andersson
2016-02-22Remove pointless casts from void*.Tor Andersson
Extraneous explicit type casts can mask errors, especially if a function prototype or return value changes in the future.