| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
A character array was accessed incorrectly and we now include a
complete dump of downloaded fonts with the font debugging option '='.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At various places in the code, we test for parameters from a
param_list by using:
if (!strncmp(param, "ParamValue", strlen("ParamValue"))
This is bad, because as well as matching "ParamValue" and
"ParamValue=", it will also match "ParamValueSomething".
Also, at various places in the code, we don't call strlen
(understandably, cos that's a runtime function call to retrieve
a constant value), and just wire in the constant value. But
in at least 1 location, we've got the constant value wrong.
Accordingly, move to using an 'argis' macro that tests correctly
and calculates the length at compile time.
|
|
|
|
|
|
|
| |
Only stop passing params to languages on an error, not on
a non-zero return code.
This was causing arguments not to make it to SO for processing.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main code issue with this bug was that the banner printed on startup is
printed from Postscript, and Postscript's cvs operator doesn't allow for
dictating the number of digits it outputs so the number 00 will always end up as
the string "0", or 01 as "1". So our 10.01.0 version would be printed as
"10.1.0".
To address this, as a ".revisionstring" entry to systemdict, created during
startup, the string is created in C, so we control the format.
The remaining issues need to be address as part of the release process.
|
|
|
|
| |
This is seen when we exit an instance with an error.
|
|
|
|
|
| |
I missed a rename of gp_wutf8.c to gp_utf8.c in one of the many
makefiles.
|
|
|
|
|
|
| |
Promote previously windows specific functions to be
generically available (and give them names that
reflect that).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This started as a customer request, where the customer wanted to
store a file in the ROM file system with a bunch of command line
parameters in it, and then use the @file syntax to run that file
and setup the interpreter. In essence a 'canned' setup stored in
the ROM file system.
That didn't work, at all, because of a dichotomy in the logic of
argument processing. The code used 'lib_file_open' in order to find
the file using the search path which, on Ghostscript, includes all
the iodevices, Rom file system, RAM file system etc.
That function returns a stream which the calling function 'lib_fopen'
would then reach inside and pull out the pointer to the underlying
gp__file *, and return, because the argument processing was written
to use a gp_file *, not a stream *.
But.... For the ROM file system, what we store in the 'file' member
of the stream is not a gp_file *, its a 'node' *. Trying to use that
as a gp_file * rapidly leads to a seg fault.
So this commit reworks the argument processing to use a stream *
instead of a gp_file *. In reality there is no real difference to the
logic we simply use a different call. There are a lot of fiddly
references to change unfortunately.
There are some consequences; we need to pass stream * around instead of
gp_file *, and in particular the 'encoding' functions, which are
OS-specific need to use a stream *. This isn't a problem for the
interpreters and graphics library, but mkromfs *also* uses those
OS-specific files, and it does not have the stream library available.
Rather than trying to include it, we note that we don't actually need
to use these functions for mkromfs and we do the same hackery as for
other missing functionality; we define a stub function that does nothing
but will permit the compile to complete.
|
|
|
|
|
|
|
| |
Spots ascii/utf8/utf16 and feeds to PCL interpreter.
May need further tweaking with both text file spotting and
font selection, but it's a decent start.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally, the FAPI code held a buffer of the full font data, for the duration
of the life of the font object.
Given that the entire font set is memory resident, three times over, for the
life of the interpreter(s), that ends up holding quite a lot of memory.
This changes it so it uses the font data read directly from the romfs (rather
than read into a persistent memory buffer). To maintain performance, we now
store the PCL fonts uncompressed in the romfs. This grows the binary from
25Mb to 29Mb.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The text extraction (and pdfwrite family) expect that decode_glyph
should always return pairs of bytes (an assumption that Unicode code
points are 2 bytes), and the return value from the routine should be
the number of bytes required to hold the value.
The PCL decode_glyph routine however was simply returning 1, which
caused the text extraction code some difficulty since it wasn't
expecting that.
This commit firstly alters the text extraction code to cope 'better'
with a decode_glyph routine which returns an odd value (basically
ignore it and fall back to using the character code).
We also alter the pl_decode_glyph routine to return 2 instead of 1,
so that it correctly tells the caller that it is returning 2 bytes.
Finally we make sure that the returned value is big-endian, because the
text extraction code assumes it will be.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit 90fa745b7 (Add gpdl support for SmartOffice integration),
I tweaked the way we found the PCL interpreter, so that instead of
relying on it being at a fixed point in the list of interpreters,
we hunted for it by name.
And then I used the wrong name.
Use the right name instead.
I am at a loss to understand why the normal cluster tests didn't
pick this up.
|
|
|
|
|
| |
No actual SmartOffice code here, just the framework for adding
the (private) "SO" interpreter.
|
|
|
|
|
| |
Postscript jobs require NOPAUSE in the dict, not just in the
main instance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In PDF, only symbolic Truetype fonts draw marks from the glyph at GID zero
(the TTF notdef). But the default TTF notdef is an empty rectangle, rather than
the Postscript style non-marking glyph.
The FAPI/Freetype incremental interface integration includes code to spot that
case, and return an empty glyph.
Since PDFs don't do incremental font definitions, the pdfi code simply passed
the TTF into FAPI, and onto Freetype as a complete font, so all the glyph
lookups were handled inside Freetype, not using the incremental interface.
Thus we lost the ability to do that "filtering".
Equally, we don't want to take the time to break down the font and "reassemble"
it as the Postscript interpreter is forced to do.
This implements a hybrid approach where we still pass the font data unchanged
into Freetype, but we still use the incremental interface, allowing that
notdef filtering to happen.
This commit affects a heuristic in freetype which autmatically enables
autohinting, meaning we'll no longer get autohinting in cases where we
previously did. That gives a perceived drop in quality at low resolutions.
Since autohinting can be enabled at the command line, it's not a serious
concern.
|
|
|
|
|
|
|
|
|
|
| |
Ghostscript has "-dNODISPLAY" which is a shortcut option for:
"-sDEVICE=nullpage -dBATCH -dNOPAUSE"
add support for that to the "pl" layer, so other languages handle it, too.
Prompted by the fix for bug 705075.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the stack based halftone, we want to set the reference counting data to
zeros/NULLs - in this case, it is later copied into an actually reference
counted, heap allocated object.
Equivalent to 6849cc4774817a2afa2e6f4d77c1aa63e432352f in pdf/
Coverity 375605: Init ref counting entry for gs_halftone
For the stack based halftone, we want to set the reference counting data to
zeros/NULLs - in this case, it is later copied into an actually reference
counted, heap allocated object.
|
| |
|
|
|
|
|
| |
In the case where it matters, we wouldn't hit it without being initialised,
but Coverity can't know that, and the cost to initialise it is tiny.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running a windows memento, 32bit build of:
gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300
-o gpcl6.out ../tests_private/pcl/pcl5cats/*.BIN
we'd see leaks from pl_bitmap_build_char. I could not reproduce
these when running individual files.
A desk-check of the code spotted that penum would not be freed if
a particular error path was taken. Fixing that (as here), removes
the leaks.
|
|
|
|
|
| |
Move a global to the pjl state. The global is initialised when
the pjl state is allocated, so the lifespans match.
|
|
|
|
|
| |
Means extending the pdf_detect_language() to check the first five (rather than
two) bytes in the input.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
plmain.c should not be setting the PageSpotColors
value. This should be set by the individual
interpreters on a per page basis. This change
fixes a crash (Bug 704660) reduces the number of
closing and opening times of the device with pdfi
and pdfi renders more than 4 spots to the separation
devices just fine. Also for gpdl with HEAD, the subsequent
execution of a PS file following a PCL file
did not properly reset the PageSpotColors to -1
as is required for PS files, resulting in improper
output when going to a separation device. This commit
includes a fix for that. Tested with command line
gpdl -sDEVICE=psdcmyk -r72 -o ./myoutputs/pdl_input_%d.psd
./myinputs/owl.pcl ./myinputs/Ad_InDesign.ps
./myinputs/spots_multi_page.pdf ./myinputs/input.xps
./myinputs/deviceNImage.eps ./myinputs/DeviceN_20Colors.pdf
./myinputs/page_spots/Ad_InDesign.ps
to verify that the number of spots was getting properly
set with each interpreter and page (when applicable) change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some devices within Ghostscript (currently the x11 devices,
uniprint and opvp/oprp) use non const static variables, so cannot
be run in multiple instances at a time.
We now maintain a core "count" of how many non-threadsafe devices are
being used at any time. This value can be atomically adjusted by calls
to gs_lib_ctx_nts_adjust.
Non threadsafe devices now call gx_init_non_threadsafe_device either
as or as part of their initialise_device proc. This function attempts
to increment the non-threadsafe count and fails to init if there is
already a non-threadsafe device running.
On success, the device finalize method is modified so that it will
decrement the count at the end.
The known non-threadsafe devices are updated to call this.
In order to have somewhere safe to store this count, we introduce
a gs_globals structure, shared between instances. Setting this up
without race conditions requires some new gp_ functions that can
make use of platform specific threading primitives. We have these
implemented for both windows and pthread based platforms. On other
platforms, we drop back to the old unsafe mechanism for counting
instances.
While we do this work, we take the opportunity to push the
gs_memory_t pointer used for non-threadsafe debug printing into thread
local storage.
This enables us to remove the remaining GS_THREADSAFE guarded
compilation from the source code. What is left is broadly down to
allowing debugging collection for statistics, and these are now
controlled by specific COLLECT_STATS_XXX defines. It is assumed
that anyone wanting to collect such stats is smart enough to not
try to do so while using Ghostscript in a multi-instance environment.
|
|
|
|
|
|
|
|
|
|
|
| |
When UFST is in use, the build creates a string containing a list of the
accessible FCOs (separated by "gp_file_name_list_separator" characters) which
we loop over, enumerating the fonts available in each.
The bounds checking of that string was just incorrect.
Thanks to Norbert for pointing out the problem, and suggesting part of the
fix.
|
|
|
|
|
|
|
|
|
| |
The manufacturer, version and build date entries in the
pl_interp_characteristics_t were never really used except for version, which
was just set to the GS_VERSION.
Remove the pointless entries, and use a more direct approach to version
reporting.
|
|
|
|
|
|
|
|
|
|
|
| |
Linux sends a UEL at the end of a job, windows does not. This
causes files that end in (for example):
<UEL>@PJL LPORTROTATE
(with no trailing return) to give an error.
Windows and linux now behave the same.
|
|
|
|
|
| |
Norbert Janssen spotted this regression with fixing 703885, see
comment #14 in the bug.
|
|
|
|
|
|
|
| |
Explicitly ignore return value from gs_purge_font()
As things stand, it shouldn't ever return an error, and there is nothing
we can do differently in the event of an error.
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this instance 'RESOURCES' means fonts, macros, symbol sets etc.
This applies to PCL (and maybe others), but not Postscript
resources.
Default (and setting this to 0) gives the behaviour where resources
are never reset based upon job language changes.
Setting this to 1 causes resources to be reset between jobs (whenever
we return to PJL).
Setting this to 2 causes resources to be reset whenever we "change
language". For this setting, we do not count returning to PJL and
reentering the same language as being a language change.
(Includes fixes and code from Henry Stiles).
|
|
|
|
|
|
| |
The param points to a buffer of data for a language to
attempt to auto detect data, not the name of a language.
Correct the naming to be less confusing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit we remove several parameters to the text_begin
device procedure, because they are implied.
Firstly, we remove pdcolor, and just use the device color from
the current color in the graphics state (pgs->color[0]). This is
actually what the code did anyway (in that it was assumed that
pdcolor, if it was non-NULL was a pointer to this).
Similarly, we remove the path param, as (if used) this is always
the same as pgs->path.
Finally, we remove the memory param as this is (almost always)
the same as pgs->memory (and in cases where it isn't, tests indicate
that it could be).
This has knock on effects for the text enumerator structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PostScript 'sethalftone' has an optional parameter "ObjectType" that allows
one of the three object specific types to be set: Vector, Image or Text.
Also add a new PostScript operator to set the current halftone (dev_ht,
set by sethalftone) as the device halftone to be used for an object type:
path, image and text.
For non-PostScript clients, the gs_halftone structure adds a 'objtype'
element (enum) that can be set prior to calling gs_sethalftone.
The gs_gstate_s dev_ht is now an array of HT_OBJTYPE_COUNT elements,
indexed by the gs_HT_objtype_t enum, with HT_OBJTYPE_DEFAULT (value 0)
used for prior sethalftone/setscreen/setcolorscreen operations.
NOTE: adding object types beyond the default+3 entries will require modification
of gx_select_dev_ht since it only uses 3 bits of the 'tag' to get the index
for the dev_ht[] array.
For code style, change to use != NULL instead of != 0 in most places that
this commit touched (but we may want a general cleanup of this everywhere).
TBD: Command line options for all PDL's will need a method to take a
halftone specification -- most likely a file that may be "PS-lite" syntax
and may be limited to a threshold array. Discussions are in progress.
|
|
|
|
|
| |
The build date is printed in the (expected) error output that we
test for in runtests builds, resulting in diffs.
|
| |
|
|
|
|
| |
This was preventing api_test working on windows.
|
|
|
|
|
|
|
| |
Header files shifted around so that the redefinition of printf happens
after cdefs.
Also removes redundant CONTDEVH definition from contrib/contrib.mak
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no immediate prospect of resolving the underlying issue: that the
stream code requires the data pointer in the "cursor" to be initialised to the
address one byte *before* the beginning of the actual buffer.
We also do not want to disable the array bounds warning completely, as that
risks missing real mistakes.
So, define a static inline function which does the offending pointer assignment,
and disable the warning locally, for only that function. Then have everywhere
that uses such a buffer setup call that function, rather than do the assignment
itself.
At the moment, it is only disabled for gcc (and compatible) compilers, we can
add others if/as required.
|
| |
|
|
|
|
|
|
|
| |
The memory allocated by param_write_string_array() was never being
released.
(Note: the cluster doesn't test this code path currently)
|
|
|
|
| |
Omission from commit: a10a03a4c9713b38c4cfcd07f0ba3c722778aae0
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Also remove pl_begin_image2/pl_image_data2/pl_end_image2 etc
functions - might as well just call direct. This leaves pldraw.c and
pldraw.h empty, so remove them.
Also, take the opportunity to fix some potential cleanup problems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To do this, we introduce gp_unlink and gp_rename, and call those
as appropriate.
Also, make gp_open_scratch_file add the file to the permit list.
When such a file is closed, it will be deleted from the permit list.
It will also be removed from the permit list if the file is deleted
using the PS deletefile operator.
On closedown, if scratch files haven't been deleted, then we'll
delete them as part of the closedown of gs_lib_ctx.
This means that 'purging' the control lists must not remove scratch
file paths from the list.
Also, ensure that gsapi callers can't maliciously (or accidentally)
remove scratch path paths from the list so as to leave them around
after closedown.
|
| |
|
|
|
|
| |
This should play nicer with python.
|