summaryrefslogtreecommitdiff
path: root/bk_paper.c (follow)
Commit message (Collapse)AuthorAge
* Correct typo in initialisation in bk_paper.c.Simon Tatham2017-05-14
| | | | | | If you initialise a structure field for the first time with += rather than =, that won't stop valgrind from saying it's uninitialised, and a good job too!
* Add missing initialisations in the 'word' structure.Simon Tatham2017-05-14
| | | | | | | | | | | The 'breaks' and 'aux' fields were filled in rather inconsistently at various places where a word is created - especially the outlying ones that manufacture pieces of document during internal processing of contents, index, bibliography, cross-references etc rather than directly from the input file. This has never led to any user-visible behaviour change that I've noticed, but it made a lot of annoying noise in the valgrind output, which got in my way last week when I was trying to debug the CHM generation.
* Add \s for 'strong' text, i.e. bold rather than italics. I've missedSimon Tatham2013-03-10
| | | | | | | | | | | | | | this a couple of times in Halibut markup recently (in particular, it's handy to have a typographical distinction between 'this term is emphasised because it's new' and 'this term is emphasised because I want you to pay attention to it'), so here's an implementation, basically parallel to \e. One slight oddity is that strong text in headings will not be distinguished in some output formats, since they already use bolded text for their headings. [originally from svn r9772]
* 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]
* Remove a bunch of unused variables spotted by Ubuntu 12.04's gcc.Simon Tatham2012-05-03
| | | | [originally from svn r9478]
* Add a --list-fonts option, since getting PostScript names out of TrueTypeBen Harris2007-02-13
| | | | | | fonts is difficult. [originally from svn r7281]
* Update the TODO list to match the current state of the world.Ben Harris2007-01-07
| | | | [originally from svn r7070]
* Add a mechanism for disabling ligature substitution for an entire paragraphBen Harris2007-01-07
| | | | | | and apply it to code paragraphs. [originally from svn r7069]
* Our standard mapping for the first font should start at 0x20, not 0x21.Ben Harris2007-01-07
| | | | [originally from svn r7067]
* 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]
* Initial ligature support. This adds support for emitting ligatures, and addsBen Harris2006-12-31
| | | | | | | | the "fi" and "fl" ligatures to the built-in fonts, but doesn't add support for reading ligature information from AFM files because that requires coping with forward references to glyph names, which is tricky. [originally from svn r7045]
* PDF outlines already do use PDFDocEncoding or Unicode, so remove that fromBen Harris2006-12-02
| | | | | | the TODO list. [originally from svn r6951]
* Introduce global (cross-backend) \cfg{contents} and \cfg{index}Simon Tatham2006-06-02
| | | | | | | commands, allowing the fixed words "Contents" and "Index" generated in various output formats to be reconfigured into other languages. [originally from svn r6724]
* 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]
* 297mm is closer to 842pt than to 841pt, and the former seems to be theBen Harris2006-05-09
| | | | | | | accepted length of A4 paper in the PostScript/PDF world, so use it as our default. [originally from svn r6669]
* When setting up a font, if we've done that font already, return theBen Harris2006-05-09
| | | | | | existing instance. This saves outputting each font several times. [originally from svn r6668]
* Add font-selection mechanism to the paper backend. Since we have no way toBen Harris2006-05-08
| | | | | | | | | | | | load font metrics dynamically, we're restricted to the fonts whose metrics are compiled into Halibut. Font structures aren't reused when the same font is specified twice, nor are unused fonts removed from the output. Finally, the default configuration overflows lines in the manual, but this would need a change to Halibut's grammar to fix. Still, what's there works. [originally from svn r6667]
* Add kerning support to paper backends, embedding the kerning tables fromBen Harris2004-09-28
| | | | | | the AFM files in psdata.c. Also fix a couple of bugs that this revealed. [originally from svn r4588]
* Page-break penalties were calculated by taking the amount of spare spaceBen Harris2004-09-24
| | | | | | | | | on the page (in internal units) and squaring it. This was fine except that fixed penalties weren't scaled by the size of an internal unit, so the page- breaking changed when the units were changed. Rather than scaling all the fixed penalties, scale the space into 1/4096 point units before squaring it. [originally from svn r4575]
* 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]
* Explicit bounds checking on the bmp[] array.Simon Tatham2004-08-04
| | | | [originally from svn r4400]
* Division by zero (which criminally failed to give rise to any kindSimon Tatham2004-07-17
| | | | | | | of signal!) was causing massive misplacement of the single line of text on a one-line page in PS and PDF. [originally from svn r4330]
* 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]
* All measurements in the paper backend are now configurable, as areSimon Tatham2004-05-23
| | | | | | bullet and quote characters. [originally from svn r4249]
* Acroread's PDF cut and paste appears to depend on the order in whichSimon Tatham2004-04-20
| | | | | | | | text fragments appear in the page graphics stream. Therefore, I should take care to display the leaders _before_ the page number in each contents entry. [originally from svn r4105]
* 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]
* Add a TODO entry.Simon Tatham2004-04-16
| | | | [originally from svn r4084]
* 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]
* Prevent a tight loop. Oops.Simon Tatham2004-04-15
| | | | [originally from svn r4080]
* Put the document's version IDs into comments in the PS and PDFSimon Tatham2004-04-15
| | | | | | output files. [originally from svn r4079]
* Ahem. If an indexable term appears in a section heading, the indexSimon Tatham2004-04-15
| | | | | | should not also point to a page in the contents! :-) [originally from svn r4078]
* Administrivia: update a TODO and a .cvsignore.Simon Tatham2004-04-14
| | | | [originally from svn r4077]
* Display the page numbers on every page. Right. I think this is nowSimon Tatham2004-04-14
| | | | | | | | basically usable, and certainly it entirely includes the level of functionality which was provided by our ancestor Perl script. So I think I'll stop coding frantically and have a rest! [originally from svn r4074]
* And now the page numbers in the index are PDF cross-references too.Simon Tatham2004-04-14
| | | | | | | Funny, I thought that would be as hard again as the main index processing, and it turned out to be nearly trivial. [originally from svn r4073]
* Implemented an index. Good _grief_, that was hard work to get allSimon Tatham2004-04-14
| | | | | | the fine details right. [originally from svn r4072]
* Typo during restructuring caused all code paragraphs to beSimon Tatham2004-04-14
| | | | | | permanently bold. Fixed. [originally from svn r4071]
* The contents section now contains PDF cross-references.Simon Tatham2004-04-14
| | | | [originally from svn r4070]
* Support for a contents section.Simon Tatham2004-04-14
| | | | [originally from svn r4069]
* 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 horizontal rules.Simon Tatham2004-04-14
| | | | [originally from svn r4066]
* Implemented lines under chapter titles.Simon Tatham2004-04-13
| | | | [originally from svn r4065]
* Fine-tuned the page breaking algorithm by adding penalties andSimon Tatham2004-04-13
| | | | | | | | bonuses for breaking in particular places. (For example, it's especially bad to break just after a heading, and especially good to break just before one.) [originally from svn r4064]
* Fix the TODO comments up a bit.Simon Tatham2004-04-13
| | | | [originally from svn r4062]
* Implemented all the missing rendering features (such as differentSimon Tatham2004-04-13
| | | | | | | | font selection in headings, mentioning section numbers, bullets, list item numbers, code paragraphs etc). The PS/PDF output now actually looks like the document it's supposed to be :-) [originally from svn r4061]
* 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]
* Aha, _that's_ why paragraphs weren't properly justified. ConfusionSimon Tatham2004-04-13
| | | | | | | of semantics as to whether a `last' pointer pointed to the last relevant thing in a list, or the one beyond that. Oops. [originally from svn r4059]
* 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]