ken <
k...@spamcop.net> wrote:
> In article <
159389516...@zzo38computer.org>,
> ne...@zzo38computer.org.invalid says...
>
> > I first produced PDF output, and then used a program called "pdf2svg",
> > although better might be making a SVG output driver for Ghostscript. (I
> > think there might be one but doesn't fully work, or something like that.
>
> There *was* an SVG output device and at one time an SVG interpreter,
> both were declared defunct and removed from the source tree on the 9th
> March 2014.
OK, the SVG output device is discussed below, but the SVG interpreter, I
did also think of the possibility to write a SVG reader in PostScript, if
there is a XML parser in PostScript.
(I also don't like how the "run" operator reads PDF and EPS files as well
as PostScript programs; I would think that it would be better to have a
separate operator, perhaps called "rundoc", to do such thing (it would
still interpret it as a normal PostScript file if it is not recognized as
PDF or EPS, though). I think a EPS file is a PostScript program, anyways.
An alternative would be for the PostScript only run operator to be called
".run" and to leave "run" like it is; if you use -dWRITESYSTEMDICT then
you can write "/run /.run load def" if you want to disable PDF.)
> Essentially the problem was that fonts are not well supported in SVG and
> many SVG consumers (at least back then) didn't really support fonts in
> SVG at all.
You could have the option to output text as paths, perhaps (either for
some fonts or for all fonts, I suppose).
> I expect the device still works so you could probably get the source for
> Ghostscript 9.10, take the gdevsvg.c file from ghostpdl/devices/vector,
> and then modify the makefile of the current code to build and include
> the device.
There is the possibility of dynamically loading drivers, at least on
Linux. Unfortunately this seems to be undocumented except for the option
for the configure script. On my computer, it expects the dynamic driver
files in the directory called "/usr/local/lib/ghostscript/9.52"; if a
dynamic driver is compiled and put in that directory, it will be loaded.
(I have used this feature and intend to use some more, such as to
implement a driver for my "separations output format", although users who
don't have this feature can just recompile Ghostscript if they want to
add drivers, I suppose.)
I have not looked at the SVG output driver, although I will do so, to see
if it is suitable for my uses, at least. Then, someone else can see
whether or not it is suitable for their uses (and, I suppose, correct any
problems in that driver if they can do so).
> The pdfmark PostScript operator is only supported by the pdfwrite
> device.
While that may be the only included device which does, it would seem that
it is implemented as a device parameter, so it is possible to implement
other drivers that do that by checking for the /pdfmark device parameter.
(A test I have made seems to confirm that.)
Also, I think I read the DjVu output driver supports some pdfmarks too.
(Although I suppose that there may be possibility that some output formats
may support some pdfmarks that PDF doesn't, although probably not.)