current since 1990. The only obvious change from this is that gv now displays
the document title.
There's a slight bug here at the moment in that the backend emits
%%DocumentNeededResource and %%IncludeResource for each subfont of a
PostScript font, even if that PostScript font has been requested already.
This is wasteful but, as far as I can see, not actually disallowed, and
is easier than de-duping the font list.
git-svn-id: svn://svn.tartarus.org/sgt/halibut@4551
cda61777-01e9-0310-a592-
d414129be87e
#include "halibut.h"
#include "paper.h"
#include "halibut.h"
#include "paper.h"
-static void ps_versionid(FILE *fp, word *words);
+static void ps_comment(FILE *fp, char const *leader, word *words);
paragraph *ps_config_filename(char *filename)
{
paragraph *ps_config_filename(char *filename)
{
- fprintf(fp, "%%!PS-Adobe-1.0\n");
+ fprintf(fp, "%%!PS-Adobe-3.0\n");
+ fprintf(fp, "%%%%Creator: Halibut, %s\n", version);
+ fprintf(fp, "%%%%DocumentData: Clean8Bit\n");
+ fprintf(fp, "%%%%LanguageLevel: 1\n");
for (pageno = 0, page = doc->pages; page; page = page->next)
pageno++;
fprintf(fp, "%%%%Pages: %d\n", pageno);
for (pageno = 0, page = doc->pages; page; page = page->next)
pageno++;
fprintf(fp, "%%%%Pages: %d\n", pageno);
+ for (p = sourceform; p; p = p->next)
+ if (p->type == para_Title)
+ ps_comment(fp, "%%Title: ", p->words);
+ fprintf(fp, "%%%%DocumentNeededResources:\n");
+ for (fe = doc->fonts->head; fe; fe = fe->next)
+ /* XXX This may request the same font multiple times. */
+ fprintf(fp, "%%%%+ font %s\n", fe->font->name);
+ fprintf(fp, "%%%%DocumentSuppliedResources: procset Halibut 0 0\n");
fprintf(fp, "%%%%EndComments\n");
fprintf(fp, "%%%%BeginProlog\n");
fprintf(fp, "%%%%EndComments\n");
fprintf(fp, "%%%%BeginProlog\n");
+ fprintf(fp, "%%%%BeginResource: procset Halibut 0 0\n");
/*
* Supply a prologue function which allows a reasonably
* compressed representation of the text on the pages.
/*
* Supply a prologue function which allows a reasonably
* compressed representation of the text on the pages.
" } forall\n"
"} def\n");
" } forall\n"
"} def\n");
+ fprintf(fp, "%%%%EndResource\n");
fprintf(fp, "%%%%EndProlog\n");
fprintf(fp, "%%%%BeginSetup\n");
fprintf(fp, "%%%%EndProlog\n");
fprintf(fp, "%%%%BeginSetup\n");
*/
for (p = sourceform; p; p = p->next)
if (p->type == para_VersionID)
*/
for (p = sourceform; p; p = p->next)
if (p->type == para_VersionID)
- ps_versionid(fp, p->words);
+ ps_comment(fp, "% ", p->words);
+
+ for (fe = doc->fonts->head; fe; fe = fe->next)
+ /* XXX This may request the same font multiple times. */
+ fprintf(fp, "%%%%IncludeResource: font %s\n", fe->font->name);
/*
* Re-encode and re-metric the fonts.
/*
* Re-encode and re-metric the fonts.
pageno++;
fprintf(fp, "%%%%Page: %d %d\n", pageno, pageno);
pageno++;
fprintf(fp, "%%%%Page: %d %d\n", pageno, pageno);
- fprintf(fp, "%%%%BeginPageSetup\n");
- fprintf(fp, "%%%%EndPageSetup\n");
-static void ps_versionid(FILE *fp, word *words)
+static void ps_comment(FILE *fp, char const *leader, word *words)
+ fprintf(fp, "%s", leader);
for (; words; words = words->next) {
char *text;
for (; words; words = words->next) {
char *text;