Age | Commit message (Collapse) | Author |
|
Cope better with errors during rendering - avoid letting the
gstate stack get out of sync.
This avoids us ever getting into the situation of popping
a clip when we should be popping a mask or a group. This was
causing an unexpected case in the painting.
|
|
|
|
|
|
Add API to:
* allow enumeration of layer configs (OCCDs) within PDF files.
* allow selection of layer configs.
* allow enumeration of the "UI" (or "Human readable") form of layer
configs.
* allow selection/toggling of entries in the UI.
|
|
As fz_drop_*()/fz_free() all must handle NULL.
|
|
|
|
The implementation does not need to be in the public API.
|
|
Move the definition of fz_font to be in a private header file
rather than in the public API. Add accessors for specific
parts of the structure and use them as appropriate.
The font flags, and the harfbuzz records remain public.
This means that only 3 files now need access to the font
implementation (font.c, pdf-font.c and pdf-type3.c). This
may be able to be improved further in future.
|
|
Previously no fallbacks happened if the colorspace was not set, now gray
is assumed. The reason this is safe is that the softmasks backdrop color
entry is always filled with one component value (possibly being 0) matching
the gray component of the colorspace.
|
|
|
|
Closing a device or writer may throw exceptions, but much of the
foreign language bindings (JNI and JS) depend on drop to never throw
an exception (exceptions in finalizers are bad).
|
|
|
|
|
|
|
|
|
|
|
|
The "contents" field is the same as the "obj" field, so can also be
removed.
|
|
|
|
This silences the many warnings we get when building for x64
in windows.
This does not address any of the warnings we get in thirdparty
libraries - in particular harfbuzz. These look (at a quick
glance) harmless though.
|
|
Lab colorspaces had been broken due to incorrect clipping of
color values introduced in an effort to fix Bug 696796.
|
|
|
|
|
|
The DP and BDC operators, are used in the form:
<NAME> <PROPERTIES> <OPERATOR>
where <PROPERTIES> can either be a name (that can be looked
up to get a dictionary) or an inline dictionary.
What the spec doesn't say is that the two are not
interchangeable. If you resolve the name to an inline
dict, then insert it, Acrobat will give an error for
some (but not all) cases.
The interpreter currently resolves any references, and
passes the resolved version into the operator handling
function. This precludes us outputting the original
form.
We therefore update it to pass both the raw and the cooked
versions in. This has no effect on MuPDFs own handling of
anything, it just enables the buffer device to output
a correct stream.
|
|
And use the same enum for both the internal bidi code and the layout code.
|
|
Add code to convert to and from fz_text_language codes from
ISO 639 language strings. No validation is carried out.
|
|
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).
|
|
|
|
|
|
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.
|
|
Match naming of fz_moveto/lineto etc for paths.
|
|
We can now group all clipped text into one fz_text object and simplify
the device interface.
|
|
|
|
|
|
|
|
|
|
When making a new pdf_run_processor to handle type 3 glyph contents,
we can inherit the current gstate. Do NOT inherit the current clip
depth, as otherwise we pop too many on exit.
|
|
Firstly, we make the definition of the path structures local to
path.c. This is achieved by using an fz_path_processor function to
step through paths enumerating each section using callback functions.
Next, we extend the internal path representation to include other
section types, including quads, beziers with common control points
rectangles, horizontal, vertical and degenerate lines. We also roll
close path sections up into the previous sections commands.
The hairiest part of this is that fz_transform_path has to cope with
changing the path commands depending on the matrix. This is a
relatively rare operation though.
|
|
Update buffer and filter processors.
Filter both colors and stroke states.
Move OCG hiding logic into interpreter.
|
|
The example file for this bug has an invalid font bbox. The current
code uses this bbox (or some multiple of it) to clip the glyphs
size.
In the new code, when we convert the glyphs to display lists we
watch for the bbox given in any d1 operator used. If we find one,
we gather the rectangle specified and store it as the glyph rectangle
in the fz_font.
If we then attempt to bound a glyph that used d1, it happens instantly
without needing to run the list. This seems to match acrobats behaviour.
Tests indicate that Acrobat never clips d0 glyphs, so our behaviour
is still different here, but I am not changing this at the moment.
Also, I note that t3flags should be a un unsigned short but are currently
just a char. Fix that too.
Also fix some missing code in fz_new_font that would cause leaks if mallocs
failed.
|
|
Move the logic in pdf_show_char to use the same idiom as used
elsewhere. Specifically this ensures that empty rects are
handled correctly.
|
|
Purge several embedded contexts:
Remove embedded context in fz_output.
Remove embedded context in fz_stream.
Remove embedded context in fz_device.
Remove fz_rebind_stream (since it is no longer necessary).
Remove embedded context in svg_device.
Remove embedded context in XML parser.
Add ctx argument to fz_document functions.
Remove embedded context in fz_document.
Remove embedded context in pdf_document.
Remove embedded context in pdf_obj.
Make fz_page independent of fz_document in the interface.
We shouldn't need to pass the document to all functions handling a page.
If a page is tied to the source document, it's redundant; otherwise it's
just pointless.
Fix reference counting oddity in fz_new_image_from_pixmap.
|
|
Disallow modification of shared fz_path and fz_text objects.
They should follow a create once, consume often pattern, and as such should
be immutable once created.
|
|
If a pattern is expected to be rendered exactly once and its relevant
part covers the target area, the xstep and ystep values may be far
larger than the pattern's relevant content. Due to rounding applied in
pdf_show_pattern, such patterns have been omitted so far. This issue is
exposed e.g. by the document linked from
http://forums.fofou.org/sumatrapdf/topic?id=3184639 .
|
|
Certain glyphs such as found in nested Type 3 font can't be cached.
Currently, the text extraction device doesn't see these as they're sent
only as drawing operations. Sending them also as invisible text fixes
potentially missing letters.
|
|
Android NDK
(security issue because a variable is used as a format string with no parameters).
|
|
When throwing an error during fz_alpha_from_gray, the stack depth
can get confused. Fix this by moving some more code into the
appropriate fz_try().
In the course of fixing this bug, I added some new optional debug
code to display the stack level as it runs. This is committed here
disabled; just change the appropriate #define in draw-device.c to
enable it.
Also, add some code to run_xobject, to avoid throwing in an fz_always()
clause.
|
|
Various functions (such as fz_begin_group) handle errors internally
by use of the error_depth parameter. This means that if we call
them, we MUST ensure that we call the appropriate closing function.
Similarly, if we don't call them, we should NOT call the closing
function.
In order to ensure we do this correctly, we introduce a cleanup_state
variable that says which ones we tried to call.
This cures the original bug.
|
|
Without this, comparefiles/Bug695086 renders the barcode test upside
down.
|
|
|
|
Don't print the code point number, to let the inhibition of multiple
identical warnings kick in.
|