sgt/halibut
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

18 years agoAdd a /Info dictionary to PDF output, containing the title and producer
ben [Wed, 10 May 2006 18:31:07 +0000 (18:31 +0000)]
Add a /Info dictionary to PDF output, containing the title and producer
of the document.  This means that (e.g.) gv displays the title correctly.

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

18 years agoA page's MediaBox, like its Resources, is inheritable, so rather than
ben [Wed, 10 May 2006 12:55:16 +0000 (12:55 +0000)]
A page's MediaBox, like its Resources, is inheritable, so rather than
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.

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

18 years ago297mm is closer to 842pt than to 841pt, and the former seems to be the
ben [Tue, 9 May 2006 22:43:09 +0000 (22:43 +0000)]
297mm is closer to 842pt than to 841pt, and the former seems to be the
accepted length of A4 paper in the PostScript/PDF world, so use it as
our default.

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

18 years agoWhen setting up a font, if we've done that font already, return the
ben [Tue, 9 May 2006 22:13:58 +0000 (22:13 +0000)]
When setting up a font, if we've done that font already, return the
existing instance.  This saves outputting each font several times.

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

18 years agoAdd font-selection mechanism to the paper backend. Since we have no way to
ben [Mon, 8 May 2006 22:54:19 +0000 (22:54 +0000)]
Add font-selection mechanism to the paper backend.  Since we have no way to
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.

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

18 years agoNow that I've found the core AFMs, I notice that they have a perfectly
ben [Mon, 8 May 2006 20:25:21 +0000 (20:25 +0000)]
Now that I've found the core AFMs, I notice that they have a perfectly
good free licence.  Abide by its terms even though I'm not sure Halibut
is a derived work in law.

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

18 years agoUpdate URLs for PostScript data files.
ben [Mon, 8 May 2006 18:11:59 +0000 (18:11 +0000)]
Update URLs for PostScript data files.

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

18 years agoIt's conventional to use a minus sign rather than a hyphen to separate
ben [Mon, 8 May 2006 00:08:48 +0000 (00:08 +0000)]
It's conventional to use a minus sign rather than a hyphen to separate
the description from the name in the NAME section of a manpage.  Halibut
can do that now, so make use of that ability.

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

18 years agoNew configuration directives need new aliases in the index too.
ben [Sun, 7 May 2006 23:59:02 +0000 (23:59 +0000)]
New configuration directives need new aliases in the index too.

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

18 years agoFactor out another routine from man_rdaddwc(), this one to add a control
ben [Sun, 7 May 2006 12:55:32 +0000 (12:55 +0000)]
Factor out another routine from man_rdaddwc(), this one to add a control
string to the output.  This incidentally fixes a bug whereby font changes
at the start of a line weren't resetting QUOTE_INITCTRL.

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

18 years agoPull the code to reset the output charset state out of man_rdaddwc() into
ben [Sun, 7 May 2006 12:44:53 +0000 (12:44 +0000)]
Pull the code to reset the output charset state out of man_rdaddwc() into
its own function, since it's called so many times.  Also call it in two places
I'd missed.

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

18 years agoWhen we want a printed backslash, use \e rather than \\, since the former
ben [Sun, 7 May 2006 11:35:51 +0000 (11:35 +0000)]
When we want a printed backslash, use \e rather than \\, since the former
works correctly inside macro arguments.

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

18 years agoAdd support for nonbreaking hyphens to the "man" backend. man_rdaddwc() is beginning
ben [Sat, 6 May 2006 22:58:26 +0000 (22:58 +0000)]
Add support for nonbreaking hyphens to the "man" backend.  man_rdaddwc() is beginning
to get ugly.

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

18 years agoDisplay the "breaks" flag when generating a debugging dump.
ben [Sat, 6 May 2006 22:16:38 +0000 (22:16 +0000)]
Display the "breaks" flag when generating a debugging dump.

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

18 years agoSupport for non-breaking spaces in the "man" backend. This has the odd side-effect
ben [Sat, 6 May 2006 22:04:29 +0000 (22:04 +0000)]
Support for non-breaking spaces in the "man" backend.  This has the odd side-effect
that breaking spaces are now forces to be ASCII spaces in output, whatever output
charset is in force.  I doubt this will inconvenience anyone.

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

18 years agoImprove rule generation in the "man" backend so that if the output
ben [Sat, 6 May 2006 20:01:09 +0000 (20:01 +0000)]
Improve rule generation in the "man" backend so that if the output
is processed by nroff, the rule is made up of \cfg{man-rule}
characters (same defaults as \cfg{text-rule}).

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

18 years agoSupport for TROFF named characters, so we can have proper bullets in our lists,
ben [Sat, 6 May 2006 19:24:29 +0000 (19:24 +0000)]
Support for TROFF named characters, so we can have proper bullets in our lists,
and incidentally proper (single) quotation marks too.  This reworks a lot of
man_convert, but I think the result is correct.

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

18 years agoAdd tests of ` and ' characters, since they need special handling in the man backend.
ben [Sat, 6 May 2006 19:18:52 +0000 (19:18 +0000)]
Add tests of ` and ' characters, since they need special handling in the man backend.

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

18 years agobetter para_Rule implementation for "man" backend, using TROFF's built-in
ben [Sat, 6 May 2006 13:59:03 +0000 (13:59 +0000)]
better para_Rule implementation for "man" backend, using TROFF's built-in
line-drawing function.

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

18 years agoIt's a new year.
jacob [Sun, 8 Jan 2006 18:18:11 +0000 (18:18 +0000)]
It's a new year.

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

18 years agoJust to be on the safe side about avoiding other portability hazards
simon [Sun, 13 Nov 2005 13:07:52 +0000 (13:07 +0000)]
Just to be on the safe side about avoiding other portability hazards
in future, add `-ansi -pedantic' to the Halibut default compile
options and fix the few resulting warnings (mostly signed/unsigned
char mismatches and commas at the ends of enums). The one remaining
warning I'm still seeing is `missing initializer' for the big table
in charset/iso2022.c, but I think the code genuinely is more
readable this way, and I haven't found a gcc option to disable that
specific warning.

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

18 years ago`version' needs to be declared `extern'.
simon [Sun, 13 Nov 2005 12:56:10 +0000 (12:56 +0000)]
`version' needs to be declared `extern'.

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

18 years agoRevert to "C" locale for LC_NUMERIC, so that PDFs won't be corrupted
simon [Sun, 13 Nov 2005 12:52:13 +0000 (12:52 +0000)]
Revert to "C" locale for LC_NUMERIC, so that PDFs won't be corrupted
by the use of a comma as a decimal separator.

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

18 years ago`style.c' appears to have been around since 1999 and never had
simon [Sat, 12 Nov 2005 15:17:53 +0000 (15:17 +0000)]
`style.c' appears to have been around since 1999 and never had
anything in it! In its current form it presents the portability
hazards of an empty structure and an empty source file. Therefore,
I'm removing it; if I ever have a clear idea of what a user style
mechanism ought to look like, it might make a reappearance, but
don't hold your breath.

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

18 years agoRemove the error message `no text found in paragraph'. Aaron Brown
simon [Thu, 29 Sep 2005 13:04:26 +0000 (13:04 +0000)]
Remove the error message `no text found in paragraph'. Aaron Brown
points out that it's perfectly possible to generate an empty
paragraph using legal Halibut syntax: a paragraph containing nothing
but a \#{...} comment will do the job, and is quite likely to happen
if you've commented out a load of Halibut code. Therefore, an empty
paragraph is now silently ignored rather than being an error
condition in itself; if you create an empty paragraph due to it
containing an unrecognised directive, then you'll get an error for
_that_ and only that.

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

18 years agoBen Hutchings points out that `.UC', which I think I must have
simon [Fri, 29 Jul 2005 11:23:52 +0000 (11:23 +0000)]
Ben Hutchings points out that `.UC', which I think I must have
copied mindlessly from whatever man page I read when working out the
format of man pages, has the function of putting `3rd Berkely
Distribution' in one of the footer slots and therefore is probably
inaccurate...

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

19 years agoThe heading depth of a para_Subsect is p->aux+1, not p->aux+2.
ben [Wed, 18 May 2005 12:09:06 +0000 (12:09 +0000)]
The heading depth of a para_Subsect is p->aux+1, not p->aux+2.
Spotted (indirectly) by Damien Miller.

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

19 years agoinput.c was capable of generating a paragraph structure with no text
simon [Tue, 12 Apr 2005 08:38:28 +0000 (08:38 +0000)]
input.c was capable of generating a paragraph structure with no text
in it, if the input paragraph contained (say) an unrecognised
control command and nothing else. Such paragraphs can confuse back
ends later on, so input.c should refrain from generating them. Added
a check and a polite error message (just in case the user manages to
generate an empty paragraph using otherwise legal syntax).

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

19 years agoAlso, while I'm wandering past here, I've just noticed that
simon [Thu, 10 Mar 2005 10:42:18 +0000 (10:42 +0000)]
Also, while I'm wandering past here, I've just noticed that
`anonfrag' should be a char[] rather than a char *, or else lenof()
will give the wrong answer.

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

19 years agoExplicitly constify a bunch of static data declarations which were
simon [Thu, 10 Mar 2005 10:20:36 +0000 (10:20 +0000)]
Explicitly constify a bunch of static data declarations which were
conceptually const but not declared as such. Halibut is now back to
the practically-speaking-pointless but rather satisfying status of
having no global writable data whatsoever :-)

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

19 years agoAbility to specify multiple arguments to \cfg{html-template-fragment};
jacob [Tue, 8 Mar 2005 01:55:34 +0000 (01:55 +0000)]
Ability to specify multiple arguments to \cfg{html-template-fragment};
Halibut will output fragment names in all specified formats. (I forget now
precisely why I thought this was necessary, but it seems potentially useful.)

Also ensure that legal fragment names are generated even if none of the
characters from the original turn out to be legal (e.g., %k with an entirely
numeric keyword), and correct an untruth I inserted in the documentation of
this.

(This commit hits more than just the HTML backend as I've generalised an error
message, and fixed a fault in the info backend's error handling while there.)

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

19 years agoMove contact details inside <address> to make validator.w3.org happy.
jacob [Mon, 7 Mar 2005 20:08:55 +0000 (20:08 +0000)]
Move contact details inside <address> to make validator.w3.org happy.

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

19 years agoIn contents lists, put <ul> inside <li> to make validator.w3.org happier (for
jacob [Mon, 7 Mar 2005 20:00:18 +0000 (20:00 +0000)]
In contents lists, put <ul> inside <li> to make validator.w3.org happier (for
all HTML flavours).
Also add newlines to the contents output so that the source is vaguely
legible.
Couple of extra comments in the code.

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

19 years agoFormatting fix if no index
jacob [Fri, 18 Feb 2005 20:44:05 +0000 (20:44 +0000)]
Formatting fix if no index

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

19 years agoOops, overzealous search-and-replace
jacob [Fri, 18 Feb 2005 20:40:49 +0000 (20:40 +0000)]
Oops, overzealous search-and-replace

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