diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 21:50:04 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-04 21:50:04 +0200 |
commit | efc46353676c27b24f2933dce78305796951a01e (patch) | |
tree | c8275b31cf280fa9489cde2b10c605bdbc2ee351 | |
parent | 05a6d9c992ebac6ec7a382c6f124e0e4f817a1ca (diff) | |
download | mupdf-efc46353676c27b24f2933dce78305796951a01e.tar.xz |
fontdump: Dump font data sources in a more compact format.
-rw-r--r-- | pdf/fontdump.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pdf/fontdump.c b/pdf/fontdump.c index efda0b01..b40558dd 100644 --- a/pdf/fontdump.c +++ b/pdf/fontdump.c @@ -12,16 +12,18 @@ hexdump(FILE *fo, FILE *fi) c = fgetc(fi); while (c != -1) { - fprintf(fo, "0x%02x,", c); - if (n % 16 == 15) + n += fprintf(fo, "%d,", c); + if (n > 72) { fprintf(fo, "\n"); + n = 0; + } c = fgetc(fi); - n ++; } return n; } + int main(int argc, char **argv) { @@ -92,7 +94,7 @@ main(int argc, char **argv) fprintf(fo, "const unsigned char pdf_font_%s_buf[%d] = {\n", name, len); hexdump(fo, fi); fprintf(fo, "};\n"); - fprintf(fo, "#endif\n"); + fprintf(fo, "#endif\n\n"); fclose(fi); } |