| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Originally, the code assumed that any extra font files were on disk files, and
did not account for the possibility that they might be in the romfs (or
potentially access via the Postscript %os% or similer i/o device).
This revises it to cope with such cases.
Stems from Bug 706267.
|
|
|
|
|
| |
We should only explicitly free the file enumerator if the enumeration loop
exits early.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug #706315 "`ps2pdf -sFONTPATH=. ...` crashes with SIGSEGV"
When enumerating files in a directory in order to build a font map, we
were not checking the result of sfopen but assuming it would succeed and
then trying to read from it.
On Windows at least, the file may already be open exclusively which
results in sfopen returning a NULL, which causes a seg fault when we
try to use it in sgets().
I'm unable to reproduce this problem on Linux so I can't be certain it
is the same problem as in the report, but it seems likely.
Fixed by simply checking the return value for NULL and ignoring the
file if it is. We obviously can't use it as a font anyway so there's
no harm in ignoring it.
|
|
|
|
|
|
|
|
|
|
|
| |
Example file Bug689644.pdf
Streams of 0 length, compressed with Flate (and possibly other schemes)
were throwing an error, because we couldn't read even enough bytes to
satisfy the signature.
If we get a stream o f 0 length, don't bother processing it at all, just
return immediately. This prevents us flagging a spurious error.
|
|
|
|
|
|
|
|
|
| |
The pdfi code for reading and using mappings for CIDFonts in cidfmap validated
all the CIDSystemInfo (registry, ordering and supplement) and if any didn't
match, it would reject the mapping.
It turns out that the old code ignored the Supplement value, so the pdfi code
will now, too.
|
|
|
|
|
|
|
|
|
|
|
| |
Yet more fallout from the change to objects not always being pointers
to structures. using object->type doesn't work if object isn't a
pointer to a struct, we need to use pdfi_type_of instead.
Since this keeps happening, audit all occurrences of ->type and .type in
the pdfi code and make sure we use the pdfi_type_of() function where
needed. A couple of these are in code not compiled in due to #if 0
pre-processor directives, but fix them anyway.
|
|
|
|
|
|
| |
If we didn't find a map for a font name in the native font map (i.e. that
generated by scanning FONTPATH) then were returning the error, instead of
carrying on to check the regular font map (from Fontmap.GS).
|
|
|
|
|
|
|
|
|
|
| |
The pdfi fontmap code prioritized explicit mappings from the Fontmap file, over
mappings generated automatically from the FONTPATH option. Turns out, it
should be the other way around.
Secondly, the pdfi code would "sanitize" the font name to look for before
consulting either font map, where we should check the name as read from the
PDF before trying the sanitized version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CID 378377
pdf_fontps.c - Assign the return value from pdfI-array_put() to 'code'
so that we deal with possible errors.
CID 378378
pdf_xref.c - check the return from pdfi_loop_detector_mark() for errors
CID 378379
pdf_obj.c - comment out a couple of cases. Coverity is (correctly)
complaining these are dead.
CID 378384
pdf_fmap.c - cater for the (expected) return value of 0 from dict_get()
so that we don't end up using an uninitialised variable.
|
|
|
|
|
|
|
|
|
| |
This includes functions to pop values off the stack, convert to
the appropriate types etc, that encapsulate error handling etc.
Use these throughout the code. This drastically simplifies lots
of code, and avoids needless error-prone repetition. It also means
we can add debug testing/warnings in many fewer places.
|
|
|
|
|
| |
All code now reads pdf obj types using pdfi_type_of rather than directly
accessing obj->type. This will help us in the next optimisation step.
|
| |
|
|
|
|
| |
Prevents scanning FONTDIR for potential substitute fonts.
|
|
|
|
|
|
|
|
|
| |
Ghostscript's first attempt to find a suitable fallback CIDFont is to assemble
a "fake" font name from the CIDSystemInfo /Registry and /Ordering strings.
Allowing a mapping to catch any, for example, Adobe GB1 CIDFonts by defining
a substitute CIDFont called /Adobe-GB1.
Extremely rarely used, it seems, but should be supported nonetheless.
|
| |
|
| |
|
|
|
|
| |
Fixes a memory leak
|
|
|
|
|
|
| |
In these cases, we mostly ignore errors, because it probably means the file in
question wasn't a valid font file. But hopefully we can placate Coverity by
checking for and acting on an out-of-memory condition.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Handle -sFONTMAP param in gpdl, and copy the relevant strings from the
Postscript world when pdfi is called from Ghostscript.
To make things a little simpler, there is also a tweak to the Postscript code,
so the FONTMAP parameter gets split into an array of strings during
initialisation, rather than at use time, which saves doing that process once
for Postscript and once for pdfi.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First pass at FONTDIR scanning...
Handles Type 1 and TTF/TTC/OTTO files.
CFF still to do. And probably some tidying up.
Slightly rejig font file scanning.
Previously, the code used the magic number to decide which file scanning
function to call, which would attempt to find the font name in the file, and
return it, so the caller could add the name/path to the native font map.
But that approach was messy when the ability to deal with TrueType collections
was implemented.
So, this tweaks it so the scanning function also does the adding of the font
mapping to the dictionary.
|
|
|
|
|
| |
Slightly limited due to not supporting full Postscript (so no use of cvn,
.getenv, concatstrings etc).
|
|
|
|
|
|
|
|
| |
Also use the genericrsourcedir to find fonts.
gpdf: allow setting of FONTPATH param
gpdf/gs: Populate the pdfi search paths from the PS environment
|
|
This is a commit of the pdfi branch to master, eliminating
the traditional merge step.
The full history of the pdfi branch can be seen in the repo,
and that branch is effectively frozen from this point onwards.
This commit actually differs from pdfi in a small number of
whitespace changes (trailing spaces etc).
|