summaryrefslogtreecommitdiff
path: root/tools/convbdf.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2005-11-14 19:52:04 +0000
committerMagnus Holmgren <magnushol@gmail.com>2005-11-14 19:52:04 +0000
commita199aef53a58686bf200c3f61579bf7df0e30e7d (patch)
tree2c151a259591cc0155f83e18628e909b550ba6e3 /tools/convbdf.c
parent3b0e8f89ab443c8d07b94165e6a301066b8e7ea1 (diff)
downloadrockbox-a199aef53a58686bf200c3f61579bf7df0e30e7d.zip
rockbox-a199aef53a58686bf200c3f61579bf7df0e30e7d.tar.gz
rockbox-a199aef53a58686bf200c3f61579bf7df0e30e7d.tar.bz2
rockbox-a199aef53a58686bf200c3f61579bf7df0e30e7d.tar.xz
Applied patch 1342470: Support fonts wider than 16 pixels in convbdf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7874 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/convbdf.c')
-rw-r--r--tools/convbdf.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c
index ace2e1b..05f2c83 100644
--- a/tools/convbdf.c
+++ b/tools/convbdf.c
@@ -528,11 +528,6 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf)
maxwidth = width;
pf->width[encoding-pf->firstchar] = width;
- if(maxwidth > 16) {
- fprintf(stderr, "Error: Too wide characters (>16 pixels)\n");
- return 0;
- }
-
/* clear bitmap*/
memset(ch_bitmap, 0, BITMAP_BYTES(width) * pf->height);
@@ -607,7 +602,7 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf)
encodetable = 1;
break;
}
- l += pf->maxwidth * (pf->height + 7) / 8;
+ l += pf->maxwidth * ((pf->height + 7) / 8);
}
#else
l = 0;
@@ -741,15 +736,17 @@ int rotleft(unsigned char *dst, bitmap_t *src, unsigned int width,
/* for each input column...*/
for(j=0; j < width; j++) {
+ if (src_mask == 0) /* input word done? */
+ {
+ src_mask = 1 << (sizeof (bitmap_t) * 8 - 1);
+ i++; /* next input word */
+ }
+
/* if set in input, set in rotated output */
if (src[i] & src_mask)
dst[j] |= dst_mask;
src_mask >>= 1; /* next input bit */
- if (src_mask == 0) /* input word done? */
- {
- continue;
- }
}
dst_mask <<= 1; /* next output bit (row) */