bdf2sfd

BDF to SFD converter, allowing to vectorize bitmap fonts
Log | Files | Refs | README | LICENSE

commit 7134fb822d6be14630fd1b7d0abe5395fc18f024
parent db83b54d9945f29f3c07a3f0a5198798885b19e9
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 28 Jan 2020 21:25:38 +0100

Use font stride and not width to compute mask.

Diffstat:
Msrc/bdftosfd.c | 2+-
Msrc/config.h | 10+++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/bdftosfd.c b/src/bdftosfd.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) xlength = 512 / width; ylength = 1024 / height; - mask = 1 << (width - 1); + mask = 1 << (stride[width] * 8 - 1); continue; } diff --git a/src/config.h b/src/config.h @@ -4,7 +4,7 @@ * https://github.com/fcambus/bdftosfd * * Created: 2019-11-21 - * Last Updated: 2019-12-03 + * Last Updated: 2020-01-28 * * bdftosfd is released under the BSD 2-Clause license * See LICENSE file for details @@ -19,4 +19,12 @@ enum { LINE_LENGTH_MAX = 65536 }; +int stride[] = { + 0, + 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4 +}; + #endif /* CONFIG_H */