From c944b102ae83acb343b677a9ce8f9ba288170188 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 30 Oct 2021 00:42:57 +0200 Subject: Add readme, let use know the demo makes an assumption about the encoding, and remove old testing code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- README | 1 + demo.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..2a195c1 --- /dev/null +++ b/README @@ -0,0 +1 @@ +libparsepcf is a C library for interpreting PCF (Portable Compiled Format) font files. diff --git a/demo.c b/demo.c index 35a0d65..3181455 100644 --- a/demo.c +++ b/demo.c @@ -471,9 +471,6 @@ print_glyph(size_t glyph) } printf("\n"); - font_ascent = 15; - font_descent = 5; - extra_left = mtx.left_side_bearing > 0 ? (size_t)mtx.left_side_bearing : 0; extra_right = mtx.character_width > mtx.right_side_bearing ? (size_t)(mtx.character_width - mtx.right_side_bearing) : 0; print_width = extra_left + width + extra_right; @@ -722,7 +719,7 @@ print_line(const char *str) lo -= (size_t)font.encoding.min_byte2; glyph = hi * (size_t)(font.encoding.max_byte2 - font.encoding.min_byte2 + 1) + lo; } - /* TODO we are assuming ASCII/UCS-2 */ + /* For the purpose of the demo we are assuming ASCII/UCS-2 */ if (libparsepcf_get_glyph_indices(file, len, font.enc_table, &font.encoding, &glyph, glyph, 1)) { perror("libparsepcf_get_glyph_indices"); exit(1); @@ -772,6 +769,7 @@ main(int argc, char *argv[]) glyph = (size_t)strtoul(argv[1], NULL, 16); print_glyph(glyph); } else { + printf("This demo assumes the font uses ASCII or UCS-2 encoding\n"); for (; argc--; argv++) { print_line(*argv); printf("\n"); -- cgit v1.2.3-70-g09d2