sgt/halibut
17 years agoAdd a --list-fonts option, since getting PostScript names out of TrueType
ben [Tue, 13 Feb 2007 21:38:21 +0000 (21:38 +0000)]
Add a --list-fonts option, since getting PostScript names out of TrueType
fonts is difficult.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7281 cda61777-01e9-0310-a592-d414129be87e

17 years agoWhen building the static Huffman tables, it's vital to include the
simon [Tue, 13 Feb 2007 19:23:47 +0000 (19:23 +0000)]
When building the static Huffman tables, it's vital to include the
two unused entries at the end of the lit/len table (286 and 287),
because without them all the 9-bit codes are off by four. I can only
assume I hadn't noticed this before because no test file I've
compressed had both (a) contained byte values >= 0x90 and (b)
required a static block.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7279 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd a test for glyph-name de-duplication in TrueType fonts -- several MS
ben [Tue, 13 Feb 2007 00:14:55 +0000 (00:14 +0000)]
Add a test for glyph-name de-duplication in TrueType fonts -- several MS
fonts have separate glyphs for U+0394 GREEK CAPITAL LETTER DELTA and
U+2206 INCREMENT, but call both of them "Delta".

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7278 cda61777-01e9-0310-a592-d414129be87e

17 years agoCope with TrueType fonts that have duplicate glyph names by renaming glyphs
ben [Tue, 13 Feb 2007 00:12:16 +0000 (00:12 +0000)]
Cope with TrueType fonts that have duplicate glyph names by renaming glyphs
as necessary.  The algorithm for ensuring that the new name is unused is
partly Gareth's fault.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7277 cda61777-01e9-0310-a592-d414129be87e

17 years agoCope with TrueType fonts without a 'post' table or with a format 3 'post'
ben [Mon, 12 Feb 2007 22:21:03 +0000 (22:21 +0000)]
Cope with TrueType fonts without a 'post' table or with a format 3 'post'
table (which doesn't specify glyph names), constructing an arbitrary list
of glyph names for ourselves.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7276 cda61777-01e9-0310-a592-d414129be87e

17 years agoPresumed typo preventing compilation in r7269.
jacob [Sun, 11 Feb 2007 17:30:49 +0000 (17:30 +0000)]
Presumed typo preventing compilation in r7269.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7270 cda61777-01e9-0310-a592-d414129be87e

17 years agoImproved error handling in sfnt support. No more calls to abort()!
ben [Sun, 11 Feb 2007 15:19:10 +0000 (15:19 +0000)]
Improved error handling in sfnt support.  No more calls to abort()!

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7269 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for extracting kerning tables from 'kern' tables. Only format 0
ben [Sat, 10 Feb 2007 22:34:44 +0000 (22:34 +0000)]
Add support for extracting kerning tables from 'kern' tables.  Only format 0
(simple pair kerning) is supported, but with both Apple- and Microsoft-format
headers.

Also reference Microsoft's TrueType specification in comments, since I've used
that to write some of this code.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7268 cda61777-01e9-0310-a592-d414129be87e

17 years agoImprove (and greatly complicate) CMap generation for TrueType fonts.
ben [Sat, 10 Feb 2007 14:29:37 +0000 (14:29 +0000)]
Improve (and greatly complicate) CMap generation for TrueType fonts.
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7263 cda61777-01e9-0310-a592-d414129be87e

17 years agoNow that glyph indices are exposed to bk_pdf.c, move CMap generation there,
ben [Sat, 10 Feb 2007 13:35:52 +0000 (13:35 +0000)]
Now that glyph indices are exposed to bk_pdf.c, move CMap generation there,
since that seems closer to being where it belongs.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7262 cda61777-01e9-0310-a592-d414129be87e

17 years agoGenerate a "W" array for CIDFonts, since acroread seems to do very silly
ben [Sat, 10 Feb 2007 12:33:56 +0000 (12:33 +0000)]
Generate a "W" array for CIDFonts, since acroread seems to do very silly
things without one.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7261 cda61777-01e9-0310-a592-d414129be87e

17 years agoSupport for embedding TrueType fonts in PDF output. The code isn't the most
ben [Thu, 8 Feb 2007 21:50:00 +0000 (21:50 +0000)]
Support for embedding TrueType fonts in PDF output.  The code isn't the most
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7259 cda61777-01e9-0310-a592-d414129be87e

17 years agoRemove slightly odd formatting left in by accident.
jacob [Wed, 7 Feb 2007 19:58:05 +0000 (19:58 +0000)]
Remove slightly odd formatting left in by accident.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7248 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for extracting some global font metrics from the 'OS/2' table
ben [Wed, 7 Feb 2007 00:00:06 +0000 (00:00 +0000)]
Add support for extracting some global font metrics from the 'OS/2' table
of fonts that have one.  This should help with generating the
FontDescriptor object in PDF.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7246 cda61777-01e9-0310-a592-d414129be87e

17 years agoMake ps_token() more generally available and use it to improve the formatting
ben [Tue, 6 Feb 2007 23:01:42 +0000 (23:01 +0000)]
Make ps_token() more generally available and use it to improve the formatting
of Type 42 fonts.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7245 cda61777-01e9-0310-a592-d414129be87e

17 years agoInsert a missing (though strictly unnecessary) newline.
ben [Tue, 6 Feb 2007 22:55:31 +0000 (22:55 +0000)]
Insert a missing (though strictly unnecessary) newline.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7244 cda61777-01e9-0310-a592-d414129be87e

17 years agoTweak to Tye 42 font generation -- construct the CharStrings dictionary
ben [Tue, 6 Feb 2007 22:53:33 +0000 (22:53 +0000)]
Tweak to Tye 42 font generation -- construct the CharStrings dictionary
rather more in PostScript and less in C.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7243 cda61777-01e9-0310-a592-d414129be87e

17 years agoConstruct a table for mapping glyph names back into glyph indices, for use
ben [Tue, 6 Feb 2007 22:48:16 +0000 (22:48 +0000)]
Construct a table for mapping glyph names back into glyph indices, for use
when we come to embed TrueType fonts in PDF.  Also provide functions for
using this table and its inverse.  Unrelatedly, support extracting the
italic angle from the 'post' table.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7242 cda61777-01e9-0310-a592-d414129be87e

17 years agoNow we have the new `module' command, use it.
simon [Mon, 5 Feb 2007 12:43:17 +0000 (12:43 +0000)]
Now we have the new `module' command, use it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7225 cda61777-01e9-0310-a592-d414129be87e

17 years agoQuell warnings about declared but undefined static functions by not declaring
ben [Sun, 4 Feb 2007 23:41:42 +0000 (23:41 +0000)]
Quell warnings about declared but undefined static functions by not declaring
them either.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7219 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd a "const" to the argument of dupstr() so that GCC doesn't complain when
ben [Sun, 4 Feb 2007 23:39:47 +0000 (23:39 +0000)]
Add a "const" to the argument of dupstr() so that GCC doesn't complain when
we pass it a constant string.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7218 cda61777-01e9-0310-a592-d414129be87e

17 years agoTidy up the handling of non-standard glyphs by defining glyph_extern()
ben [Sun, 4 Feb 2007 14:16:26 +0000 (14:16 +0000)]
Tidy up the handling of non-standard glyphs by defining glyph_extern()
early and using it whenever we need the name of a non-standard glyph.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7216 cda61777-01e9-0310-a592-d414129be87e

17 years agoBuild script for building Halibut using bob.
simon [Sun, 4 Feb 2007 11:13:43 +0000 (11:13 +0000)]
Build script for building Halibut using bob.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7204 cda61777-01e9-0310-a592-d414129be87e

17 years agoCorrect a comment.
ben [Sat, 3 Feb 2007 14:40:40 +0000 (14:40 +0000)]
Correct a comment.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7202 cda61777-01e9-0310-a592-d414129be87e

17 years agoQuell some warnings from GCC.
ben [Sat, 3 Feb 2007 14:14:32 +0000 (14:14 +0000)]
Quell some warnings from GCC.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7201 cda61777-01e9-0310-a592-d414129be87e

17 years agoWhen adding a new file, it helps to "svn add" it.
ben [Sat, 3 Feb 2007 14:08:09 +0000 (14:08 +0000)]
When adding a new file, it helps to "svn add" it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7200 cda61777-01e9-0310-a592-d414129be87e

17 years agoWhen loading a Type 1 font, remember to terminate the linked list we load
ben [Sat, 3 Feb 2007 14:05:32 +0000 (14:05 +0000)]
When loading a Type 1 font, remember to terminate the linked list we load
it into.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7199 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for using TrueType fonts, including embedding in PostScript but
ben [Sat, 3 Feb 2007 14:02:21 +0000 (14:02 +0000)]
Add support for using TrueType fonts, including embedding in PostScript but
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7198 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd an `Up' link to the HTML navigation bar of sufficiently deep documents.
jacob [Wed, 31 Jan 2007 23:32:12 +0000 (23:32 +0000)]
Add an `Up' link to the HTML navigation bar of sufficiently deep documents.
(This doesn't affect any of the source texts I know about.)
Also add <link rel="up">, even in the cases where it's just the same as
<link rel="ToC">. (This does.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7193 cda61777-01e9-0310-a592-d414129be87e

17 years agoI haven't found any browsers that do anything disgusting with
jacob [Wed, 31 Jan 2007 22:23:09 +0000 (22:23 +0000)]
I haven't found any browsers that do anything disgusting with
\cfg{html-rellinks}, and it generally seems to be a Good Thing, so I've
turned it on by default. (The lurkers support me in u2u.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7188 cda61777-01e9-0310-a592-d414129be87e

17 years agoUse consistent capitalisation for HTML tags.
jacob [Sun, 28 Jan 2007 18:42:50 +0000 (18:42 +0000)]
Use consistent capitalisation for HTML tags.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7178 cda61777-01e9-0310-a592-d414129be87e

17 years agoMinimal support for <LINK REL="next"> etc machine-readable navigation links.
jacob [Sun, 28 Jan 2007 17:16:48 +0000 (17:16 +0000)]
Minimal support for <LINK REL="next"> etc machine-readable navigation links.

Off by default for now, but I don't intend that it should stay this way; they
seem useful and harmless. I just want to check a few more browsers to ensure
they don't do anything obnoxious with them.

So far I've only seen lynx and links do something with them (provide toolbars).
iCab and some Mozilla derivatives/extensions are also alleged to do this; Opera
is said to allow PgDn type browsing through the entire set of pages; and
Mozilla is rumoured to use the "next" link for prefetching.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7177 cda61777-01e9-0310-a592-d414129be87e

17 years agoTweak the HTML Help output to enable Previous/Next navigation in the generated
jacob [Sun, 28 Jan 2007 16:22:43 +0000 (16:22 +0000)]
Tweak the HTML Help output to enable Previous/Next navigation in the generated
CHM, and added the toolbar buttons for this.

Also rationalised the other options a bit:
 - added Forward button (since we have Back);
 - removed Locate/Sync (since we have auto-sync enabled for the ToC);
 - removed Stop and Refresh (mostly a waste of space for help, but still
   available from the Options menu if users really want them);
 - enabled advanced facilities on the Search tab (search within results, etc).

All this seems to have had no obvious ill effects (tested on Win98), although
the resulting CHM file is slightly bigger (~3kbyte, <1%).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7176 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for PFB files. This seems to have caused me to completely
ben [Sat, 27 Jan 2007 20:47:41 +0000 (20:47 +0000)]
Add support for PFB files.  This seems to have caused me to completely
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7175 cda61777-01e9-0310-a592-d414129be87e

17 years agoDuplicate fix of Kevin Lyles's bug from r7092.
simon [Thu, 11 Jan 2007 09:39:35 +0000 (09:39 +0000)]
Duplicate fix of Kevin Lyles's bug from r7092.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7093 cda61777-01e9-0310-a592-d414129be87e

17 years agoUpdate the TODO list to match the current state of the world.
ben [Sun, 7 Jan 2007 11:51:18 +0000 (11:51 +0000)]
Update the TODO list to match the current state of the world.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7070 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd a mechanism for disabling ligature substitution for an entire paragraph
ben [Sun, 7 Jan 2007 11:48:58 +0000 (11:48 +0000)]
Add a mechanism for disabling ligature substitution for an entire paragraph
and apply it to code paragraphs.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7069 cda61777-01e9-0310-a592-d414129be87e

17 years agoOur standard mapping for the first font should start at 0x20, not 0x21.
ben [Sun, 7 Jan 2007 00:20:25 +0000 (00:20 +0000)]
Our standard mapping for the first font should start at 0x20, not 0x21.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7067 cda61777-01e9-0310-a592-d414129be87e

17 years agoSupport for getting ligature information from AFM files, which was the
ben [Sun, 7 Jan 2007 00:15:52 +0000 (00:15 +0000)]
Support for getting ligature information from AFM files, which was the
whole point of the glyph renumbering.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7066 cda61777-01e9-0310-a592-d414129be87e

17 years agoMake ps_glyph_to_unicode() take a glyph index instead of a glyph name.
ben [Sat, 6 Jan 2007 17:47:34 +0000 (17:47 +0000)]
Make ps_glyph_to_unicode() take a glyph index instead of a glyph name.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7062 cda61777-01e9-0310-a592-d414129be87e

17 years agoOverhaul of glyph-name handling in the paper backends. Before, we had
ben [Sat, 6 Jan 2007 17:32:34 +0000 (17:32 +0000)]
Overhaul of glyph-name handling in the paper backends.  Before, we had
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7061 cda61777-01e9-0310-a592-d414129be87e

17 years agoI've worked out why ligation was being (correctly) suppressed in code
ben [Sat, 6 Jan 2007 16:05:28 +0000 (16:05 +0000)]
I've worked out why ligation was being (correctly) suppressed in code
paragraphs and found some cases where it isn't.  Add test cases for these
to remind me to deal with them later.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7060 cda61777-01e9-0310-a592-d414129be87e

17 years agoJames should apparently have been removed from this file years ago. Fix that.
ben [Tue, 2 Jan 2007 22:38:23 +0000 (22:38 +0000)]
James should apparently have been removed from this file years ago.  Fix that.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7051 cda61777-01e9-0310-a592-d414129be87e

17 years agoFix the behaviour of constructions like \e{index \i{term}} -- the index tag
jacob [Mon, 1 Jan 2007 21:27:39 +0000 (21:27 +0000)]
Fix the behaviour of constructions like \e{index \i{term}} -- the index tag
was causing emphasis to be broken (particularly noticeable in text-like
backends). There are some instances of this in the PuTTY manual, for instance.

Unfortunately, \k references in similar situations still aren't quite right,
but fixing that will be more involved, and I haven't found any instances
yet.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7049 cda61777-01e9-0310-a592-d414129be87e

17 years agoBump copyright dates, and change the one at the start of the manual to be
ben [Mon, 1 Jan 2007 15:40:57 +0000 (15:40 +0000)]
Bump copyright dates, and change the one at the start of the manual to be
a range rather than a single year.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7047 cda61777-01e9-0310-a592-d414129be87e

17 years agoGenerate ligature information from the standard AFM files rather than
ben [Mon, 1 Jan 2007 15:32:32 +0000 (15:32 +0000)]
Generate ligature information from the standard AFM files rather than
hard-coding it.  No practical gain, since the hard-coded entries were correct,
but aesthetically better.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7046 cda61777-01e9-0310-a592-d414129be87e

17 years agoInitial ligature support. This adds support for emitting ligatures, and adds
ben [Sun, 31 Dec 2006 21:38:46 +0000 (21:38 +0000)]
Initial ligature support.  This adds support for emitting ligatures, and adds
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7045 cda61777-01e9-0310-a592-d414129be87e

17 years agoFix segfault in info backend when invoked with inputs/test.but
jacob [Sun, 31 Dec 2006 18:01:08 +0000 (18:01 +0000)]
Fix segfault in info backend when invoked with inputs/test.but
(which triggers err_infonodechar with fpos==NULL).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7044 cda61777-01e9-0310-a592-d414129be87e

17 years agoEmit lots of odd characters so as to test the paper backends' ability to
ben [Sun, 31 Dec 2006 14:36:13 +0000 (14:36 +0000)]
Emit lots of odd characters so as to test the paper backends' ability to
use two encodings of the same font.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7042 cda61777-01e9-0310-a592-d414129be87e

17 years agoTweak /OUT pdfmark generation -- PLRM suggests that constructing a large
ben [Tue, 12 Dec 2006 21:51:33 +0000 (21:51 +0000)]
Tweak /OUT pdfmark generation -- PLRM suggests that constructing a large
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6995 cda61777-01e9-0310-a592-d414129be87e

17 years agoThese HHP window dimensions seem to be rubbish. Better off without
simon [Tue, 12 Dec 2006 21:36:08 +0000 (21:36 +0000)]
These HHP window dimensions seem to be rubbish. Better off without
any, I reckon.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6994 cda61777-01e9-0310-a592-d414129be87e

17 years agoRough-and-ready line wrapping for PostScript, to keep us below the DSC-mandated
ben [Tue, 12 Dec 2006 00:13:59 +0000 (00:13 +0000)]
Rough-and-ready line wrapping for PostScript, to keep us below the DSC-mandated
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).

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6993 cda61777-01e9-0310-a592-d414129be87e

17 years agoActually, the separator in the "NAME" section really ought to be an
ben [Mon, 11 Dec 2006 23:28:51 +0000 (23:28 +0000)]
Actually, the separator in the "NAME" section really ought to be an
EN DASH, falling back to MINUS and then HYPHEN-MINUS.  Make it so.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6992 cda61777-01e9-0310-a592-d414129be87e

17 years agoSupport for the MS HTML Help system in the HTML back end. As yet I
simon [Mon, 11 Dec 2006 19:43:10 +0000 (19:43 +0000)]
Support for the MS HTML Help system in the HTML back end. As yet I
don't know how to write out a .CHM directly, but I am at least able
to have the HTML back end write out the three auxiliary files which
enable a .CHM to be generated using the MS HTML Help compiler.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6991 cda61777-01e9-0310-a592-d414129be87e

17 years agoJust noticed that Ben missed another PostScript/PDF inversion.
simon [Mon, 11 Dec 2006 14:15:15 +0000 (14:15 +0000)]
Just noticed that Ben missed another PostScript/PDF inversion.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6990 cda61777-01e9-0310-a592-d414129be87e

17 years agoFix amusing cut-and-paste error in section keywords :-)
simon [Mon, 11 Dec 2006 09:54:06 +0000 (09:54 +0000)]
Fix amusing cut-and-paste error in section keywords :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6989 cda61777-01e9-0310-a592-d414129be87e

17 years agoMake the title a bit scarier to test the PostScript backend some more,
ben [Sun, 10 Dec 2006 23:18:15 +0000 (23:18 +0000)]
Make the title a bit scarier to test the PostScript backend some more,
including testing some bug fixes it doesn't have yet.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6988 cda61777-01e9-0310-a592-d414129be87e

17 years agoExplicitly set the title via pdfmark, since that allows us to put
ben [Sun, 10 Dec 2006 22:11:35 +0000 (22:11 +0000)]
Explicitly set the title via pdfmark, since that allows us to put
in Unicode, which we can't (reliably) in %%Title.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6987 cda61777-01e9-0310-a592-d414129be87e

17 years agoRemove accidentally-committed deflate-debugging code.
ben [Sun, 10 Dec 2006 00:34:21 +0000 (00:34 +0000)]
Remove accidentally-committed deflate-debugging code.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6985 cda61777-01e9-0310-a592-d414129be87e

17 years agoPut all the pieces together: introduce a secondary test mode for
simon [Sat, 9 Dec 2006 20:25:00 +0000 (20:25 +0000)]
Put all the pieces together: introduce a secondary test mode for
winhelp.c which uses all my new library code to import an arbitrary
PNG and embed it into the test help file.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6984 cda61777-01e9-0310-a592-d414129be87e

17 years agoRemember to initialise the bmp array for AFM fonts, or Unicode fallbacks
ben [Sat, 9 Dec 2006 20:12:30 +0000 (20:12 +0000)]
Remember to initialise the bmp array for AFM fonts, or Unicode fallbacks
won't work properly.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6982 cda61777-01e9-0310-a592-d414129be87e

17 years agoSupport, in the winhelp module only, for adding pictures to .HLP
simon [Sat, 9 Dec 2006 18:03:18 +0000 (18:03 +0000)]
Support, in the winhelp module only, for adding pictures to .HLP
files. Halibut does not make use of this feature, but I hope that
one day it might.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6980 cda61777-01e9-0310-a592-d414129be87e

17 years agoUpdate copyright dates.
ben [Sat, 9 Dec 2006 16:11:21 +0000 (16:11 +0000)]
Update copyright dates.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6979 cda61777-01e9-0310-a592-d414129be87e

17 years agoSome documentation of Halibut's font-embedding support, now that it works.
ben [Sat, 9 Dec 2006 15:21:53 +0000 (15:21 +0000)]
Some documentation of Halibut's font-embedding support, now that it works.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6977 cda61777-01e9-0310-a592-d414129be87e

17 years agoThis somehow got missed in my "put PDF before PostScript" sweep.
ben [Sat, 9 Dec 2006 15:21:07 +0000 (15:21 +0000)]
This somehow got missed in my "put PDF before PostScript" sweep.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6976 cda61777-01e9-0310-a592-d414129be87e

17 years agoMention PDF before PostScript everywhere, partly because PDF is the
ben [Sat, 9 Dec 2006 15:02:32 +0000 (15:02 +0000)]
Mention PDF before PostScript everywhere, partly because PDF is the
dominant format for print-oriented documents, but mostly because it's
hard to mention pdfmark without having mentioned PDF already.

Also mention pdfmark.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6975 cda61777-01e9-0310-a592-d414129be87e

17 years agoCorrect embedding of Type 1 fonts in PDF. Error cases (e.g. invalid Type 1
ben [Sat, 9 Dec 2006 14:44:47 +0000 (14:44 +0000)]
Correct embedding of Type 1 fonts in PDF.  Error cases (e.g. invalid Type 1
fonts) may not be well handled, and may emit invalid PDF.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6974 cda61777-01e9-0310-a592-d414129be87e

17 years agoI've just noticed some unacceptably long lines in code paragraphs in
simon [Thu, 7 Dec 2006 18:09:37 +0000 (18:09 +0000)]
I've just noticed some unacceptably long lines in code paragraphs in
the Halibut manual. They turn out to be \cfg directives with
multiple braced sections after them. The obvious thing to do for
legibility would be to wrap those sections by putting newlines
between } and {, but that isn't legal in the Halibut syntax.

Therefore, it is now :-) For paragraph types which don't have any
body text (such as \cfg), we are now lenient about whitespace
between multiple keywords. So I can fix the docs so they don't go
over the limit, and be confident that the fixed version is still
technically accurate.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6970 cda61777-01e9-0310-a592-d414129be87e

17 years agoFix typo in limit test in deflate_buildhuf(). (The only two limit
simon [Thu, 7 Dec 2006 18:07:45 +0000 (18:07 +0000)]
Fix typo in limit test in deflate_buildhuf(). (The only two limit
values ever used are 15 and 7, so testing against 16 is silly.)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6969 cda61777-01e9-0310-a592-d414129be87e

17 years agoSpecify the /Border of /ANN pdfmarks correctly.
ben [Thu, 7 Dec 2006 14:00:12 +0000 (14:00 +0000)]
Specify the /Border of /ANN pdfmarks correctly.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6968 cda61777-01e9-0310-a592-d414129be87e

17 years agoUpdate deflate.c to include nearly all the changes I've been making
simon [Wed, 6 Dec 2006 19:12:44 +0000 (19:12 +0000)]
Update deflate.c to include nearly all the changes I've been making
in the main version. The one missing thing is the fancy new LZ77
compressor in misc/libcode/lz77.c, in whose stability I'm not yet
confident enough to consider it ready for prime-time.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6967 cda61777-01e9-0310-a592-d414129be87e

17 years agoDistingush font files from other input by magic number rather than name.
ben [Tue, 5 Dec 2006 00:04:18 +0000 (00:04 +0000)]
Distingush font files from other input by magic number rather than name.
This prevents one having Halibut files that begin "StartFontMetrics",
"%!FontType1-", or "%!PS-AdobeFont-", but I doubt that will be a great
hardship.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6960 cda61777-01e9-0310-a592-d414129be87e

17 years agoTwo of the bugs listed in the man page are out of date: Unicode and
simon [Mon, 4 Dec 2006 14:51:39 +0000 (14:51 +0000)]
Two of the bugs listed in the man page are out of date: Unicode and
character set support, and the HTML back end, have both been
extensively revamped since that section was written, and I think
neither of them is shoddy enough to warrant this sort of
self-disparagement any more.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6959 cda61777-01e9-0310-a592-d414129be87e

17 years agoPaging through the newly compressed PDF manual to make sure it
simon [Mon, 4 Dec 2006 14:50:36 +0000 (14:50 +0000)]
Paging through the newly compressed PDF manual to make sure it
worked, I happened to notice this typo. I think Wikipedia might have
permanently removed my ability to read any document for any purpose
without spotting at least one error in it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6958 cda61777-01e9-0310-a592-d414129be87e

17 years agoTweak prologue so that it works correctly on interpreters that don't support
ben [Sun, 3 Dec 2006 13:23:55 +0000 (13:23 +0000)]
Tweak prologue so that it works correctly on interpreters that don't support
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6956 cda61777-01e9-0310-a592-d414129be87e

17 years agoSupport for emitting outlines using pdfmark.
ben [Sat, 2 Dec 2006 16:33:22 +0000 (16:33 +0000)]
Support for emitting outlines using pdfmark.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6952 cda61777-01e9-0310-a592-d414129be87e

17 years agoPDF outlines already do use PDFDocEncoding or Unicode, so remove that from
ben [Sat, 2 Dec 2006 14:23:17 +0000 (14:23 +0000)]
PDF outlines already do use PDFDocEncoding or Unicode, so remove that from
the TODO list.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6951 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdjust ps_string so that it escapes characters above 126. This makes
ben [Sat, 2 Dec 2006 14:02:35 +0000 (14:02 +0000)]
Adjust ps_string so that it escapes characters above 126.  This makes
Halibut's output 7-bit clean, which seems the best approach in PostScript.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6950 cda61777-01e9-0310-a592-d414129be87e

17 years agoRough pdfmark support. Links are implemented, but not outlines.
ben [Sat, 2 Dec 2006 13:25:23 +0000 (13:25 +0000)]
Rough pdfmark support.  Links are implemented, but not outlines.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6949 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd a procedure to our prologue to draw filled rectangles, and use it.
ben [Fri, 1 Dec 2006 23:43:55 +0000 (23:43 +0000)]
Add a procedure to our prologue to draw filled rectangles, and use it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6938 cda61777-01e9-0310-a592-d414129be87e

17 years agoFactor out printing a destination (in either an annotation or an outline)
ben [Fri, 1 Dec 2006 22:15:36 +0000 (22:15 +0000)]
Factor out printing a destination (in either an annotation or an outline)
into its own function.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6937 cda61777-01e9-0310-a592-d414129be87e

17 years agoIncrease page-tree branching factor from two to eight, since two was obviously
ben [Fri, 1 Dec 2006 21:15:51 +0000 (21:15 +0000)]
Increase page-tree branching factor from two to eight, since two was obviously
silly, and eight isn't.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6936 cda61777-01e9-0310-a592-d414129be87e

17 years agoAdd support for compressed PDF streams, using Simon's new deflate library.
ben [Thu, 30 Nov 2006 23:19:00 +0000 (23:19 +0000)]
Add support for compressed PDF streams, using Simon's new deflate library.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6931 cda61777-01e9-0310-a592-d414129be87e

17 years agoSmall tweak: add a /ProcSet array to the top-level /Resources dictionary,
ben [Sun, 26 Nov 2006 00:24:09 +0000 (00:24 +0000)]
Small tweak: add a /ProcSet array to the top-level /Resources dictionary,
as recommended by the PDF spec.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6923 cda61777-01e9-0310-a592-d414129be87e

17 years agoExplicitly explain the meaning of each HTML variant.
ben [Sat, 18 Nov 2006 21:39:58 +0000 (21:39 +0000)]
Explicitly explain the meaning of each HTML variant.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6913 cda61777-01e9-0310-a592-d414129be87e

17 years agoEmit a PageLabels dictionary to make it clear what page numbering scheme
ben [Sat, 18 Nov 2006 21:26:04 +0000 (21:26 +0000)]
Emit a PageLabels dictionary to make it clear what page numbering scheme
Halibut uses.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6912 cda61777-01e9-0310-a592-d414129be87e

17 years ago`man', at least on Debian 3.1, will treat a paragraph beginning with
simon [Wed, 11 Oct 2006 11:13:30 +0000 (11:13 +0000)]
`man', at least on Debian 3.1, will treat a paragraph beginning with
a period specially _even_ if there's an \fB or similar escape
sequence before the period. Therefore, man_rdaddctrl() now doesn't
clear the QUOTE_INITCTRL flag just because it generated some text;
instead, its call sites clear the flag when the _type_ of generated
text is appropriate for this. This should remove an error from the
`lns' man page (utils/lns/lns.but), which was where I noticed the
problem.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6871 cda61777-01e9-0310-a592-d414129be87e

17 years agoIntroduce global (cross-backend) \cfg{contents} and \cfg{index}
simon [Fri, 2 Jun 2006 19:19:12 +0000 (19:19 +0000)]
Introduce global (cross-backend) \cfg{contents} and \cfg{index}
commands, allowing the fixed words "Contents" and "Index" generated
in various output formats to be reconfigured into other languages.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6724 cda61777-01e9-0310-a592-d414129be87e

18 years agoAbout time I fixed this: allow for some people's md5sum utilities
simon [Fri, 19 May 2006 13:08:29 +0000 (13:08 +0000)]
About time I fixed this: allow for some people's md5sum utilities
producing output on stdout even in -c mode.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6707 cda61777-01e9-0310-a592-d414129be87e

18 years agoMissing error handling: the HTML and WinHelp back ends would both
simon [Thu, 18 May 2006 08:38:41 +0000 (08:38 +0000)]
Missing error handling: the HTML and WinHelp back ends would both
segfault if they were unable to open their output files.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6704 cda61777-01e9-0310-a592-d414129be87e

18 years agoOn Level 2 implementations, use setpagedevice to select the correct page size.
ben [Tue, 16 May 2006 22:55:46 +0000 (22:55 +0000)]
On Level 2 implementations, use setpagedevice to select the correct page size.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6689 cda61777-01e9-0310-a592-d414129be87e

18 years agoTighten formatting of PDF annotations, making them direct rather than indirect
ben [Sun, 14 May 2006 23:00:13 +0000 (23:00 +0000)]
Tighten formatting of PDF annotations, making them direct rather than indirect
objects and removing some surplus whitespace.  This saves 40K in the Halibut
manual.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6688 cda61777-01e9-0310-a592-d414129be87e

18 years agoGenerate rather more compact /Differences tables for font encodings, mostly
ben [Sun, 14 May 2006 18:32:08 +0000 (18:32 +0000)]
Generate rather more compact /Differences tables for font encodings, mostly
so I don't have to press SPACE so much to get to the interesting part of the
file.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6687 cda61777-01e9-0310-a592-d414129be87e

18 years agoThere's no need to reset the font every line if it hasn't changed. This saves
ben [Sun, 14 May 2006 18:27:34 +0000 (18:27 +0000)]
There's no need to reset the font every line if it hasn't changed.  This saves
a few K and a lot of calls to scalefont and setfont, which is probably good.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6686 cda61777-01e9-0310-a592-d414129be87e

18 years agoFairly ropey font-embedding support. In particular, the PDF output is
ben [Sun, 14 May 2006 13:42:48 +0000 (13:42 +0000)]
Fairly ropey font-embedding support.  In particular, the PDF output is
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6685 cda61777-01e9-0310-a592-d414129be87e

18 years agoGenerate a more-or-less valid /FontDescriptor dictionary for non-standard
ben [Sat, 13 May 2006 15:52:03 +0000 (15:52 +0000)]
Generate a more-or-less valid /FontDescriptor dictionary for non-standard
fonts in PDF output.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6684 cda61777-01e9-0310-a592-d414129be87e

18 years agoNow that we've got definitive metrics for the standard fonts, there's no need
ben [Sat, 13 May 2006 14:36:15 +0000 (14:36 +0000)]
Now that we've got definitive metrics for the standard fonts, there's no need
to embed /FirstChar, /LastChar, /Widths or (soon) /FontDescriptor for them.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6683 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd Adobe copyright notice and licence text here too.
ben [Sat, 13 May 2006 14:21:00 +0000 (14:21 +0000)]
Add Adobe copyright notice and licence text here too.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6682 cda61777-01e9-0310-a592-d414129be87e

18 years agoInitial support for adding fonts at run-time. Currently we only support
ben [Sat, 13 May 2006 13:56:05 +0000 (13:56 +0000)]
Initial support for adding fonts at run-time.  Currently we only support
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.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6681 cda61777-01e9-0310-a592-d414129be87e

18 years agoMake /Widths arrays for fonts more compact by using FirstChar and LastChar
ben [Wed, 10 May 2006 19:30:21 +0000 (19:30 +0000)]
Make /Widths arrays for fonts more compact by using FirstChar and LastChar
to skip unused code points.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6673 cda61777-01e9-0310-a592-d414129be87e