summaryrefslogtreecommitdiff
path: root/bk_ps.c (unfollow)
Commit message (Collapse)Author
2012-08-29Revamp of the Halibut error handling mechanism.Simon Tatham
I'm not quite sure why I ever thought it was a good idea to have a central variadic error() function taking an integer error code followed by some list of arguments that depend on that code. It now seems obvious to me that it's a much more sensible idea to have a separate function per error, so that we can check at compile time that the arguments to each error call are of the right number and type! So I've done that instead. A side effect is that the errors are no longer formatted into a fixed-size buffer before going to stderr, so I can remove all the %.200s precautions in the format strings. [originally from svn r9639]
2009-10-24Allow a hastily selected subset of the output formats to also acceptSimon Tatham
"-" as a special file name meaning standard output. I've restricted it to just those output formats which can predictably output only one file, just for the sake of not having to faff too much with the others. Probably what I should have done for all of this would have been to write a set of wrappers around fopen, fclose and everything in between, and use them everywhere. Those wrappers would uniformly detect "-" and convert it into stdin or stdout as appropriate, would avoid fclosing those files for real when told to close them, and would also be able to handle reading a little bit of data from the start of a file and then pushing it all back even if the file were not seekable (which would allow input.c to lose the ugly special case whereby it can't currently read font files from standard input). [originally from svn r8729]
2007-02-06Make ps_token() more generally available and use it to improve the formattingBen Harris
of Type 42 fonts. [originally from svn r7245]
2007-02-03Add support for using TrueType fonts, including embedding in PostScript butBen Harris
not yet in PDF. There's a lot of cleaning up to be done, especially in the area of error, but I think it would be better committed gradually. [originally from svn r7198]
2007-01-27Add support for PFB files. This seems to have caused me to completelyBen Harris
rewrite the Type 1 font support, and I'm sure the result is more complex than it needs to be, but it seems to work correctly, so I shouldn't complain. [originally from svn r7175]
2007-01-06Overhaul of glyph-name handling in the paper backends. Before, we hadBen Harris
a separate dense array of glyph names for each font, and referenced glyphs by indicies into that array, which meant that the array had to be set up before we could generate any indices. Now we have an overall array of glyph names, and use the same glyph indicies for all fonts. Some arrays have had to turn into tree234s as a result. [originally from svn r7061]
2006-12-12Tweak /OUT pdfmark generation -- PLRM suggests that constructing a largeBen Harris
executable array is likely to use lots of stack space, which might be bad on Level 1 interpreters, so use the same mechanism as for other pdfmarks and have a procedure that does nothing if pdfmark isn't defined. [originally from svn r6995]
2006-12-12Rough-and-ready line wrapping for PostScript, to keep us below the DSC-mandatedBen Harris
255 characters per line (excluding newline characters). In fact, it tries to keep us below 80 characters so as to make the PostScript more readable (and demonstrate that it's working). [originally from svn r6993]
2006-12-10Explicitly set the title via pdfmark, since that allows us to putBen Harris
in Unicode, which we can't (reliably) in %%Title. [originally from svn r6987]
2006-12-07Specify the /Border of /ANN pdfmarks correctly.Ben Harris
[originally from svn r6968]
2006-12-03Tweak prologue so that it works correctly on interpreters that don't supportBen Harris
pdfmark, specifically by having the dummy versions of "p", "x", and "u" pop their arguments rather than leaving them on the stack to cause trouble. [originally from svn r6956]
2006-12-02Support for emitting outlines using pdfmark.Ben Harris
[originally from svn r6952]
2006-12-02Adjust ps_string so that it escapes characters above 126. This makesBen Harris
Halibut's output 7-bit clean, which seems the best approach in PostScript. [originally from svn r6950]
2006-12-02Rough pdfmark support. Links are implemented, but not outlines.Ben Harris
[originally from svn r6949]
2006-12-01Add a procedure to our prologue to draw filled rectangles, and use it.Ben Harris
[originally from svn r6938]
2006-05-16On Level 2 implementations, use setpagedevice to select the correct page size.Ben Harris
[originally from svn r6689]
2006-05-14There's no need to reset the font every line if it hasn't changed. This savesBen Harris
a few K and a lot of calls to scalefont and setfont, which is probably good. [originally from svn r6686]
2006-05-14Fairly ropey font-embedding support. In particular, the PDF output isBen Harris
technically incorrect, though it works perfectly well with xpdf. To do it properly requires actually parsing the unencrypted part of a Type 1 font, which will be a bit tedious in C. [originally from svn r6685]
2006-05-13Initial support for adding fonts at run-time. Currently we only supportBen Harris
loading AFM files, we recognise them by name, and we can't embed fonts in the output (which is also invalid, though accepted by xpdf, in the PDF case). Oh, and there's no documentation. Still, it's a start. [originally from svn r6681]
2004-09-25Don't bother overriding the metrics of PostScript fonts. If the metricsBen Harris
we've got are wrong, things are going to look horrible either way, so we may as well apply minimal effort. [originally from svn r4580]
2004-09-24If you're going to change the metrics of a font, it's necessary to leave spaceBen Harris
in the new font dictionary for the Metrics entry. This is mentioned in the first edition of the Red Book, but not the second. [originally from svn r4577]
2004-09-21Stupid bug: "t" was leaving the y-coordinate on the stack, which confusedBen Harris
"restore". Quite how GhostScript managed not to give an error on this I don't know. [originally from svn r4565]
2004-09-21Replace the hardcoded instances of "4096" and "4096.0" in the paper backendsBen Harris
with a macro. halibut.ps and halibut.pdf are identical (modulo dates) over this change. [originally from svn r4564]
2004-09-21Bracket each page in a save/restore pair. This is suggested by the Red Book,Ben Harris
enforces page independence, avoids leaking VM on level 1 interpreters, and speeds things up to boot. [originally from svn r4561]
2004-09-20Make the PostScript prologue look less like it was written by a C programmer.Ben Harris
In particular, use the operand stack to hold "x" and "y", and use a dictionary lookup to switch based on the type of "x". This also seems to give a slight speed increase. [originally from svn r4553]
2004-09-20Two small tweaks to the prologue:Ben Harris
* Use "/arraytype" etc rather than "[] type" etc. Should be faster and not fill local VM with empty arrays. * Use "bind" on the procedure, since it's conventional and will probably help speed too. [originally from svn r4552]
2004-09-20Add lots of DSC comments, and change the DSC version to 3.0, which has beenBen Harris
current since 1990. The only obvious change from this is that gv now displays the document title. There's a slight bug here at the moment in that the backend emits %%DocumentNeededResource and %%IncludeResource for each subfont of a PostScript font, even if that PostScript font has been requested already. This is wasteful but, as far as I can see, not actually disallowed, and is easier than de-duping the font list. [originally from svn r4551]
2004-07-17Cut-and-paste error was preventing PS and PDF filename configSimon Tatham
options from being processed in some circumstances. [originally from svn r4329]
2004-04-20Infrastructure changes for character set support. ustrtoa,Simon Tatham
ustrfroma, utoa_dup and ufroma_dup now take a charset parameter, and also have a variety of subtly distinct forms. Also, when a \cfg directive is seen in the input file, the precise octet strings for each parameter are kept in their original form as well as being translated into Unicode, so that when they represent filenames they can be used verbatim. [originally from svn r4097]
2004-04-16Compacted PS and PDF output files by removing redundant reiterationsSimon Tatham
of the same font and position designations. Reduced the size of the Halibut manual PDF to less than half what it started out as, and the PS one to more like a third of its original size. [originally from svn r4083]
2004-04-15Put the document's version IDs into comments in the PS and PDFSimon Tatham
output files. [originally from svn r4079]
2004-04-14Implemented PDF outlines.Simon Tatham
[originally from svn r4067]
2004-04-13Implemented lines under chapter titles.Simon Tatham
[originally from svn r4065]
2004-04-13Implement PDF link annotations: both internal hyperlinks within theSimon Tatham
document, and references to external URLs for which acroread will start a web browser. [originally from svn r4060]
2004-04-13Initial work on PS and PDF output. Because these two backends shareSimon Tatham
an enormous amount of preprocessing and differ only in their final output form, I've introduced a new type of layer called a `pre-backend' (bk_paper.c is one). This takes all the information passed to a normal backend and returns an arbitrary void *, which is cached by the front end and passed on to any backend(s) which state a desire for the output of that particular pre-backend. Thus, all the page layout is done only once, and the PS and PDF backends process the same data structures into two output files. Note that these backends are _very_ unfinished; all sorts of vital things such as section numbers, list markers, and title formatting are missing, the paragraph justification doesn't quite work, and advanced stuff like indexes and PDF interactive features haven't even been started. But this basic framework generates valid output files and is a good starting point, so I'm checking it in. [originally from svn r4058]