git.shiar.nl
/
unifont.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
129c4e0
)
unibdf2hex: preserve line width
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 16 Jul 2015 06:20:24 +0000
(08:20 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 16 Jul 2015 08:10:38 +0000
(10:10 +0200)
src/unibdf2hex.c
patch
|
blob
|
history
diff --git
a/src/unibdf2hex.c
b/src/unibdf2hex.c
index bbd4dc1def37ab1848d714d488dfc51b0efb5a4b..17fd83ddc3317a7313e19919f750da472ff660cc 100644
(file)
--- a/
src/unibdf2hex.c
+++ b/
src/unibdf2hex.c
@@
-42,13
+42,19
@@
main()
int descent=2; /* font descent wrt baseline */
int startrow; /* row to start glyph */
int descent=2; /* font descent wrt baseline */
int startrow; /* row to start glyph */
- int rowlen
=4;
/* number of digits per row */
+ int rowlen
;
/* number of digits per row */
unsigned rowout;
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (strncmp (inbuf, "ENCODING ", 9)) continue;
sscanf (&inbuf[9], "%d", &thispoint); /* get code point */
unsigned rowout;
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (strncmp (inbuf, "ENCODING ", 9)) continue;
sscanf (&inbuf[9], "%d", &thispoint); /* get code point */
+ while (fgets (inbuf, MAXBUF - 1, stdin)) {
+ if (!strncmp (inbuf, "DWIDTH ", 7)) break;
+ }
+ sscanf (&inbuf[7], "%d", &rowlen);
+ rowlen >>= 2;
+
/* Read bounding box values from BBX line */
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "BBX ", 4)) break;
/* Read bounding box values from BBX line */
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "BBX ", 4)) break;
@@
-74,8
+80,7
@@
main()
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "END", 3)) break;
sscanf (inbuf, "%X", &rowout);
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "END", 3)) break;
sscanf (inbuf, "%X", &rowout);
- /* Now force glyph to a 16x16 grid even if they'd fit in 8x16 */
- if (bbxx <= 8) rowout <<= 8; /* shift left for 16x16 glyph */
+ if (rowlen >= 4 && bbxx <= 8) rowout <<= 8; /* force 8x16 input to 16x16 grid */
rowout >>= bbxxoff;
fprintf (stdout, "%0*X", rowlen, rowout);
rownum++;
rowout >>= bbxxoff;
fprintf (stdout, "%0*X", rowlen, rowout);
rownum++;