~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for PFB files. This seems to have caused me to completely
[sgt/halibut]
/
bk_ps.c
diff --git
a/bk_ps.c
b/bk_ps.c
index
46652e9
..
7afde34
100644
(file)
--- 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. */
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->f
p
)
+ if (!fe->font->info->f
ontfile
)
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. */
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->f
p
)
+ if (fe->font->info->f
ontfile
)
fprintf(fp, "%%%%+ font %s\n", fe->font->info->name);
fprintf(fp, "%%%%EndComments\n");
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. */
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);
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",
fprintf(fp, "%%%%EndResource\n");
} else {
fprintf(fp, "%%%%IncludeResource: font %s\n",
@@
-230,8
+224,7
@@
void ps_backend(paragraph *sourceform, keywordlist *keywords,
ps_token(fp, &cc, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
ps_token(fp, &cc, "/Encoding [\n");
for (i = 0; i < 256; i++)
ps_token(fp, &cc, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
ps_token(fp, &cc, "/Encoding [\n");
for (i = 0; i < 256; i++)
- ps_token(fp, &cc, "/%s",
- fe->vector[i] ? fe->vector[i] : ".notdef");
+ ps_token(fp, &cc, "/%s", glyph_extern(fe->vector[i]));
ps_token(fp, &cc, "] def\n");
ps_token(fp, &cc, "currentdict end\n");
ps_token(fp, &cc, "/fontname-%s exch definefont /%s exch def\n",
ps_token(fp, &cc, "] def\n");
ps_token(fp, &cc, "currentdict end\n");
ps_token(fp, &cc, "/fontname-%s exch definefont /%s exch def\n",