From: Ben Harris Date: Wed, 27 Nov 2024 10:41:17 +0000 (+0000) Subject: Stop using %stdout for writing BDF files X-Git-Tag: bedstead-3.251~83 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=8070fb130034e91645c3bf96f2fa9951f721a218;p=bedstead.git Stop using %stdout for writing BDF files Instead, pass the destination filename to the bdf.ps program and have it open the file itself. This avoids capturing Ghostscript's own diagnostics in the output file. --- diff --git a/Makefile b/Makefile index 104220d..d12182f 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ bedstead-bold-%.bdf.ps: bedstead # Dependency of all of OTFFILES could be narrowed to just the relevant # one. %.bdf: %.bdf.ps $(OTFFILES) Fontmap - gs -q -P -dSAFER -dNODISPLAY -dBATCH $< > $@ + gs -P -q -dSAFER --permit-file-write=$@ -dNODISPLAY -dBATCH -- $< $@ %.otf: %.ttx ttx --no-recalc-timestamp -o $@ $< diff --git a/bedstead.c b/bedstead.c index 31b3f0e..1176a87 100644 --- a/bedstead.c +++ b/bedstead.c @@ -4567,7 +4567,7 @@ bdf_gen(int px_height) printf("d setdevice\n"); printf("/%s findfont %d scalefont setfont\n", fullname_to_fontname(get_fullname()), px_height); - printf("/f (%%stdout) (w) file def\n"); + printf("/f ARGUMENTS 0 get (w) file def\n"); printf("/buf %d string def\n", (px_width + 7) / 8); printf("(\\\n"); printf("STARTFONT 2.1\n"); @@ -4600,8 +4600,8 @@ bdf_gen(int px_height) printf("RELATIVE_SETWIDTH %d\n", width->ttfwidth * 10); printf("RELATIVE_WEIGHT %d\n", weight->ttfweight / 10); printf("FACE_NAME \"%s\"\n", get_fullname()); - printf("FONT_VERSION \") print\n"); - printf("currentfont /FontInfo get /version get print\n"); + printf("FONT_VERSION \") f exch writestring\n"); + printf("currentfont /FontInfo get /version get f exch writestring\n"); printf("(\"\n"); printf("FONT_ASCENT %d\n", px_height - base); printf("FONT_DESCENT %d\n", base); @@ -4616,17 +4616,17 @@ bdf_gen(int px_height) printf("DWIDTH %d 0\n", px_width); printf("BBX %d %d 0 %d\n", px_width, px_height, -base); printf("BITMAP\n"); - printf(") print\n"); + printf(") f exch writestring\n"); printf("erasepage\n"); printf("0 %d moveto\n", base); printf("/%s glyphshow\n", g->name); printf("%d -1 0 {\n", px_height - 1); printf(" d exch buf copyscanlines\n"); - printf(" f exch writehexstring (\n) print\n"); + printf(" f exch writehexstring (\n) f exch writestring\n"); printf("} for\n"); printf("(\\\n"); printf("ENDCHAR\n"); } printf("ENDFONT\n"); - printf(") print\n"); + printf(") f exch writestring\n"); }