aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-10-30 00:42:57 +0200
committerMattias Andrée <maandree@kth.se>2021-10-30 00:47:12 +0200
commitc944b102ae83acb343b677a9ce8f9ba288170188 (patch)
tree1135c16f830408f7e475adc9167c46fb199c0524
parentSecond commit (diff)
downloadlibparsepcf-1.0.tar.gz
libparsepcf-1.0.tar.bz2
libparsepcf-1.0.tar.xz
Add readme, let use know the demo makes an assumption about the encoding, and remove old testing code1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--README1
-rw-r--r--demo.c6
2 files changed, 3 insertions, 4 deletions
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");