summaryrefslogtreecommitdiff
path: root/bk_pdf.c (follow)
Commit message (Collapse)AuthorAge
* Fix an uninitialised variable in PDF font code.Simon Tatham2015-05-08
| | | | | | Thanks to Paul Curtis for reporting that 'if (i != prev+1)' would be undefined on the first pass through this loop, because prev was never initialised beforehand. Initialise it to a safe value.
* Revamp of the Halibut error handling mechanism.Simon Tatham2012-08-29
| | | | | | | | | | | | | | | | 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]
* OS X Lion's compiler spotted two missing casts, where we use %hu andSimon Tatham2012-05-06
| | | | | | pass something that isn't necessarily an unsigned short. [originally from svn r9493]
* Remove a bunch of unused variables spotted by Ubuntu 12.04's gcc.Simon Tatham2012-05-03
| | | | [originally from svn r9478]
* Allow a hastily selected subset of the output formats to also acceptSimon Tatham2009-10-24
| | | | | | | | | | | | | | | | | | | | "-" 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]
* Clean up some compiler warnings.Simon Tatham2008-11-21
| | | | [originally from svn r8310]
* Improve (and greatly complicate) CMap generation for TrueType fonts.Ben Harris2007-02-10
| | | | | | | | We now detect ranges of glyphs mapped contiguously and use {begin,end}cidrange for them, and also bunch together multiple characters and ranges in each {begin,end}cid{char,range} pair. [originally from svn r7263]
* Now that glyph indices are exposed to bk_pdf.c, move CMap generation there,Ben Harris2007-02-10
| | | | | | since that seems closer to being where it belongs. [originally from svn r7262]
* Generate a "W" array for CIDFonts, since acroread seems to do very sillyBen Harris2007-02-10
| | | | | | things without one. [originally from svn r7261]
* Support for embedding TrueType fonts in PDF output. The code isn't the mostBen Harris2007-02-08
| | | | | | | | beautiful I've ever written, and xpdf turns out not to support the encoding mechanism I've chosen, but it works in GhostScript so I'm not too unhappy for now. [originally from svn r7259]
* Add support for using TrueType fonts, including embedding in PostScript butBen Harris2007-02-03
| | | | | | | 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]
* Add support for PFB files. This seems to have caused me to completelyBen Harris2007-01-27
| | | | | | | | 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]
* Overhaul of glyph-name handling in the paper backends. Before, we hadBen Harris2007-01-06
| | | | | | | | | | 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]
* Remove accidentally-committed deflate-debugging code.Ben Harris2006-12-10
| | | | [originally from svn r6985]
* Correct embedding of Type 1 fonts in PDF. Error cases (e.g. invalid Type 1Ben Harris2006-12-09
| | | | | | fonts) may not be well handled, and may emit invalid PDF. [originally from svn r6974]
* Support for emitting outlines using pdfmark.Ben Harris2006-12-02
| | | | [originally from svn r6952]
* Factor out printing a destination (in either an annotation or an outline)Ben Harris2006-12-01
| | | | | | into its own function. [originally from svn r6937]
* Increase page-tree branching factor from two to eight, since two was obviouslyBen Harris2006-12-01
| | | | | | silly, and eight isn't. [originally from svn r6936]
* Add support for compressed PDF streams, using Simon's new deflate library.Ben Harris2006-11-30
| | | | [originally from svn r6931]
* Small tweak: add a /ProcSet array to the top-level /Resources dictionary,Ben Harris2006-11-26
| | | | | | as recommended by the PDF spec. [originally from svn r6923]
* Emit a PageLabels dictionary to make it clear what page numbering schemeBen Harris2006-11-18
| | | | | | Halibut uses. [originally from svn r6912]
* Tighten formatting of PDF annotations, making them direct rather than indirectBen Harris2006-05-14
| | | | | | | objects and removing some surplus whitespace. This saves 40K in the Halibut manual. [originally from svn r6688]
* Generate rather more compact /Differences tables for font encodings, mostlyBen Harris2006-05-14
| | | | | | | so I don't have to press SPACE so much to get to the interesting part of the file. [originally from svn r6687]
* Fairly ropey font-embedding support. In particular, the PDF output isBen Harris2006-05-14
| | | | | | | | 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]
* Generate a more-or-less valid /FontDescriptor dictionary for non-standardBen Harris2006-05-13
| | | | | | fonts in PDF output. [originally from svn r6684]
* Now that we've got definitive metrics for the standard fonts, there's no needBen Harris2006-05-13
| | | | | | to embed /FirstChar, /LastChar, /Widths or (soon) /FontDescriptor for them. [originally from svn r6683]
* Initial support for adding fonts at run-time. Currently we only supportBen Harris2006-05-13
| | | | | | | | 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]
* Make /Widths arrays for fonts more compact by using FirstChar and LastCharBen Harris2006-05-10
| | | | | | to skip unused code points. [originally from svn r6673]
* Add a /Info dictionary to PDF output, containing the title and producerBen Harris2006-05-10
| | | | | | of the document. This means that (e.g.) gv displays the title correctly. [originally from svn r6672]
* A page's MediaBox, like its Resources, is inheritable, so rather thanBen Harris2006-05-10
| | | | | | | putting one in each page, put a single one in the top-level page tree node. This saves us all a few kilobytes in the Halibut manual. [originally from svn r6671]
* Replace the hardcoded instances of "4096" and "4096.0" in the paper backendsBen Harris2004-09-21
| | | | | | | with a macro. halibut.ps and halibut.pdf are identical (modulo dates) over this change. [originally from svn r4564]
* Cut-and-paste error was preventing PS and PDF filename configSimon Tatham2004-07-17
| | | | | | options from being processed in some circumstances. [originally from svn r4329]
* Switch the memory allocation macros from the Halibut onesSimon Tatham2004-06-12
| | | | | | | | | | | | | (mknew/mknewa/resize) to the PuTTY ones (snew/snewn/sresize). snewn and mknewa have their arguments opposite ways round; this may make the change initially painful but in the long term will free me of a nasty context switch every time I move between codebases. Also sresize takes an explicit type operand which is used to cast the return value from realloc, thus enforcing that it must be correct, and arranging that if anyone tries to compile Halibut with a C++ compiler there should be a lot less pain. [originally from svn r4276]
* Stop the PDF backend from crashing if no outline elements appear. ItSimon Tatham2004-05-23
| | | | | | | still doesn't _work_ properly if there aren't any contents entries, but it's a start. [originally from svn r4250]
* PDF outline headings, it turns out, should be encoded using eitherSimon Tatham2004-04-20
| | | | | | | | | | | | PDFDocEncoding or UTF-16BE. (The PDF specification's index is terribly bad; I looked under various obvious things such as `character set' and `string literal' with no success, and I didn't manage to find out what character set metadata string literals were intended to be interpreted in until I discovered from another source that the encoding was called PDFDocEncoding, and _then_ I was able to look that up in the index. They should have been using Halibut! :-) [originally from svn r4101]
* Infrastructure changes for character set support. ustrtoa,Simon Tatham2004-04-20
| | | | | | | | | | | 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]
* Compacted PS and PDF output files by removing redundant reiterationsSimon Tatham2004-04-16
| | | | | | | | 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]
* Put the document's version IDs into comments in the PS and PDFSimon Tatham2004-04-15
| | | | | | output files. [originally from svn r4079]
* Restructuring to remove the requirement for a printed paragraph toSimon Tatham2004-04-14
| | | | | | | | | | correspond exactly to a source paragraph. Should allow me to create multiple printed paragraphs from the same source paragraph (i.e. a contents entry for each heading in addition to the heading itself), and invent entirely new printed paragraphs of my own (e.g. for index entries). [originally from svn r4068]
* Implemented PDF outlines.Simon Tatham2004-04-14
| | | | [originally from svn r4067]
* Implemented lines under chapter titles.Simon Tatham2004-04-13
| | | | [originally from svn r4065]
* Implement PDF link annotations: both internal hyperlinks within theSimon Tatham2004-04-13
| | | | | | | document, and references to external URLs for which acroread will start a web browser. [originally from svn r4060]
* Initial work on PS and PDF output. Because these two backends shareSimon Tatham2004-04-13
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]