@@ 7,7 7,6 @@
/* entry has 1 byte in widtab + 8 bytes per tile */
#define ufxlen(n) ((n)*(n)*8)
-#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define warn(fmt, ...) fprint(2, "%s: " fmt "\n", argv0, __VA_ARGS__)
@@ 780,11 779,13 @@ makenoholessubfont(void)
char *file;
for(i = 0; i < nglyphs; i++){
+ if(glyphs[i].width == 0)
+ continue;
width += glyphs[i].width;
n++;
}
- s = allocrawsubfont(n, width);
+ s = allocrawsubfont(n+1, width);
j = 0;
for(i = 0; i < nglyphs; i++){
@@ 795,8 796,8 @@ makenoholessubfont(void)
j++;
}
- setsubfontparams(s, x, 0, i);
- file = saverawsubfont(s, "noholes", 0, n);
+ setsubfontparams(s, x, 0, j);
+ file = saverawsubfont(s, "noholes", 0, nglyphs);
freerawsubfont(s);
return file;
@@ 818,10 819,8 @@ makenoholes(void)
j += n;
n = 0;
}
- continue;
- }
-
- n++;
+ }else
+ n++;
}
if(n != 0)
appendfont(fd, i-n, i-1, j, subfont);
@@ 906,7 905,7 @@ makesinglemapping(struct Mapping *m, int fd, char *base)
copyglyph(m->idx, &x, s->img);
setsubfontparams(s, x, 0, 1);
- file = saverawsubfont(s, base, m->start, m->start);
+ file = saverawsubfont(s, base, m->start, m->start+1);
appendfont(fd, m->start, m->start, 0, file);
freerawsubfont(s);
@@ 922,6 921,8 @@ makeonemapped(struct MapFile *mf)
base = strrchr(mf->file, '/');
if(base == nil)
base = mf->file;
+ else
+ base++;
p = seprint(fontfile, fontfile+sizeof(fontfile)-5, "%s", base);
strcpy(p, ".font");
@@ 1028,4 1029,6 @@ main(int argc, char **argv)
makenoholes();
makemapped();
+
+ exits(nil);
}