X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/1cd00fea71fa0387d591710a08fa89b240f46d64..26c8c119efd44804c7b27f8637c69eda63f0c189:/bk_pdf.c diff --git a/bk_pdf.c b/bk_pdf.c index d69e833..525e7d9 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -232,7 +232,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, continue; idx = sfnt_glyphtoindex(fe->font->info->fontfile, fe->vector[i]); - if (start >= 0 && idx - startidx == i - start) { + if (start >= 0 && idx - startidx == (unsigned)(i - start)) { if (ranges[start] == 1) { nranges++; nchars--; } @@ -303,7 +303,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(cidfont, "/FontDescriptor "); objref(cidfont, fontdesc); objtext(cidfont, "\n/W[0["); - for (i = 0; i < sfnt_nglyphs(fe->font->info->fontfile); i++) { + for (i = 0; i < (int)sfnt_nglyphs(fe->font->info->fontfile); i++) { char buf[20]; double width; width = find_width(fe->font, @@ -665,7 +665,10 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, * Write out the PDF file. */ - fp = fopen(filename, "wb"); + if (!strcmp(filename, "-")) + fp = stdout; + else + fp = fopen(filename, "wb"); if (!fp) { error(err_cantopenw, filename); return; @@ -712,7 +715,8 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, olist.tail->number + 1, cat->number, info->number); fprintf(fp, "startxref\n%d\n%%%%EOF\n", fileoff); - fclose(fp); + if (fp != stdout) + fclose(fp); sfree(filename); }