summaryrefslogtreecommitdiff
path: root/bk_ps.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2007-01-27 20:47:41 +0000
committerBen Harris <bjh21@bjh21.me.uk>2007-01-27 20:47:41 +0000
commit72d22e8a1a1b47635e1b8da49ae703bde01228f2 (patch)
tree64b4c37716491d55c10c4287c473e6d6715da7dd /bk_ps.c
parent2641476245d6cb1e9e85d37c6c539741aff2800d (diff)
downloadhalibut-72d22e8a1a1b47635e1b8da49ae703bde01228f2.zip
halibut-72d22e8a1a1b47635e1b8da49ae703bde01228f2.tar.gz
halibut-72d22e8a1a1b47635e1b8da49ae703bde01228f2.tar.bz2
halibut-72d22e8a1a1b47635e1b8da49ae703bde01228f2.tar.xz
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. [originally from svn r7175]
Diffstat (limited to 'bk_ps.c')
-rw-r--r--bk_ps.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/bk_ps.c b/bk_ps.c
index 5d1a951..7afde34 100644
--- a/bk_ps.c
+++ b/bk_ps.c
@@ -68,12 +68,12 @@ void ps_backend(paragraph *sourceform, keywordlist *keywords,
fprintf(fp, "%%%%DocumentNeededResources:\n");
for (fe = doc->fonts->head; fe; fe = fe->next)
/* XXX This may request the same font multiple times. */
- if (!fe->font->info->fp)
+ if (!fe->font->info->fontfile)
fprintf(fp, "%%%%+ font %s\n", fe->font->info->name);
fprintf(fp, "%%%%DocumentSuppliedResources: procset Halibut 0 3\n");
for (fe = doc->fonts->head; fe; fe = fe->next)
/* XXX This may request the same font multiple times. */
- if (fe->font->info->fp)
+ if (fe->font->info->fontfile)
fprintf(fp, "%%%%+ font %s\n", fe->font->info->name);
fprintf(fp, "%%%%EndComments\n");
@@ -198,15 +198,9 @@ void ps_backend(paragraph *sourceform, keywordlist *keywords,
for (fe = doc->fonts->head; fe; fe = fe->next) {
/* XXX This may request the same font multiple times. */
- if (fe->font->info->fp) {
- char buf[512];
- size_t len;
+ if (fe->font->info->fontfile) {
fprintf(fp, "%%%%BeginResource: font %s\n", fe->font->info->name);
- rewind(fe->font->info->fp);
- do {
- len = fread(buf, 1, sizeof(buf), fe->font->info->fp);
- fwrite(buf, 1, len, fp);
- } while (len == sizeof(buf));
+ pf_writeps(fe->font->info, fp);
fprintf(fp, "%%%%EndResource\n");
} else {
fprintf(fp, "%%%%IncludeResource: font %s\n",