diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-11-09 14:17:00 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-12-11 12:11:31 +0100 |
commit | c22e6a6dc2bf6acbac955bd5fbdd896329dfd725 (patch) | |
tree | d9d84d3a6a74ed74c9d470b532097769545e8dc6 /source/pdf/pdf-font.c | |
parent | 95b928431f233052e4bbbd1b2bf9fc705657b5a7 (diff) | |
download | mupdf-c22e6a6dc2bf6acbac955bd5fbdd896329dfd725.tar.xz |
Use fz_output instead of FILE* for most of our output needs.
Use fz_output in debug printing functions.
Use fz_output in pdfshow.
Use fz_output in fz_trace_device instead of stdout.
Use fz_output in pdf-write.c.
Rename fz_new_output_to_filename to fz_new_output_with_path.
Add seek and tell to fz_output.
Remove unused functions like fz_fprintf.
Fix typo in pdf_print_obj.
Diffstat (limited to 'source/pdf/pdf-font.c')
-rw-r--r-- | source/pdf/pdf-font.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index 2f3fa13f..542393fc 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -799,13 +799,11 @@ hail_mary_cmp_key(fz_context *ctx, void *k0, void *k1) return k0 == k1; } -#ifndef NDEBUG static void -hail_mary_debug_key(fz_context *ctx, FILE *out, void *key_) +hail_mary_print_key(fz_context *ctx, fz_output *out, void *key_) { - fprintf(out, "hail mary "); + fz_printf(ctx, out, "hail mary "); } -#endif static fz_store_type hail_mary_store_type = { @@ -813,9 +811,7 @@ static fz_store_type hail_mary_store_type = hail_mary_keep_key, hail_mary_drop_key, hail_mary_cmp_key, -#ifndef NDEBUG - hail_mary_debug_key -#endif + hail_mary_print_key }; pdf_font_desc * @@ -1275,39 +1271,37 @@ pdf_load_font(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, i return fontdesc; } -#ifndef NDEBUG void -pdf_print_font(fz_context *ctx, pdf_font_desc *fontdesc) +pdf_print_font(fz_context *ctx, fz_output *out, pdf_font_desc *fontdesc) { int i; - printf("fontdesc {\n"); + fz_printf(ctx, out, "fontdesc {\n"); if (fontdesc->font->ft_face) - printf("\tfreetype font\n"); + fz_printf(ctx, out, "\tfreetype font\n"); if (fontdesc->font->t3procs) - printf("\ttype3 font\n"); + fz_printf(ctx, out, "\ttype3 font\n"); - printf("\twmode %d\n", fontdesc->wmode); - printf("\tDW %d\n", fontdesc->dhmtx.w); + fz_printf(ctx, out, "\twmode %d\n", fontdesc->wmode); + fz_printf(ctx, out, "\tDW %d\n", fontdesc->dhmtx.w); - printf("\tW {\n"); + fz_printf(ctx, out, "\tW {\n"); for (i = 0; i < fontdesc->hmtx_len; i++) - printf("\t\t<%04x> <%04x> %d\n", + fz_printf(ctx, out, "\t\t<%04x> <%04x> %d\n", fontdesc->hmtx[i].lo, fontdesc->hmtx[i].hi, fontdesc->hmtx[i].w); - printf("\t}\n"); + fz_printf(ctx, out, "\t}\n"); if (fontdesc->wmode) { - printf("\tDW2 [%d %d]\n", fontdesc->dvmtx.y, fontdesc->dvmtx.w); - printf("\tW2 {\n"); + fz_printf(ctx, out, "\tDW2 [%d %d]\n", fontdesc->dvmtx.y, fontdesc->dvmtx.w); + fz_printf(ctx, out, "\tW2 {\n"); for (i = 0; i < fontdesc->vmtx_len; i++) - printf("\t\t<%04x> <%04x> %d %d %d\n", fontdesc->vmtx[i].lo, fontdesc->vmtx[i].hi, + fz_printf(ctx, out, "\t\t<%04x> <%04x> %d %d %d\n", fontdesc->vmtx[i].lo, fontdesc->vmtx[i].hi, fontdesc->vmtx[i].x, fontdesc->vmtx[i].y, fontdesc->vmtx[i].w); - printf("\t}\n"); + fz_printf(ctx, out, "\t}\n"); } } -#endif fz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, int len, fz_rect *acc) { |