diff options
-rw-r--r-- | tools/convbdf.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c index ace2e1bd62..05f2c83209 100644 --- a/tools/convbdf.c +++ b/tools/convbdf.c | |||
@@ -528,11 +528,6 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf) | |||
528 | maxwidth = width; | 528 | maxwidth = width; |
529 | pf->width[encoding-pf->firstchar] = width; | 529 | pf->width[encoding-pf->firstchar] = width; |
530 | 530 | ||
531 | if(maxwidth > 16) { | ||
532 | fprintf(stderr, "Error: Too wide characters (>16 pixels)\n"); | ||
533 | return 0; | ||
534 | } | ||
535 | |||
536 | /* clear bitmap*/ | 531 | /* clear bitmap*/ |
537 | memset(ch_bitmap, 0, BITMAP_BYTES(width) * pf->height); | 532 | memset(ch_bitmap, 0, BITMAP_BYTES(width) * pf->height); |
538 | 533 | ||
@@ -607,7 +602,7 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf) | |||
607 | encodetable = 1; | 602 | encodetable = 1; |
608 | break; | 603 | break; |
609 | } | 604 | } |
610 | l += pf->maxwidth * (pf->height + 7) / 8; | 605 | l += pf->maxwidth * ((pf->height + 7) / 8); |
611 | } | 606 | } |
612 | #else | 607 | #else |
613 | l = 0; | 608 | l = 0; |
@@ -741,15 +736,17 @@ int rotleft(unsigned char *dst, bitmap_t *src, unsigned int width, | |||
741 | /* for each input column...*/ | 736 | /* for each input column...*/ |
742 | for(j=0; j < width; j++) { | 737 | for(j=0; j < width; j++) { |
743 | 738 | ||
739 | if (src_mask == 0) /* input word done? */ | ||
740 | { | ||
741 | src_mask = 1 << (sizeof (bitmap_t) * 8 - 1); | ||
742 | i++; /* next input word */ | ||
743 | } | ||
744 | |||
744 | /* if set in input, set in rotated output */ | 745 | /* if set in input, set in rotated output */ |
745 | if (src[i] & src_mask) | 746 | if (src[i] & src_mask) |
746 | dst[j] |= dst_mask; | 747 | dst[j] |= dst_mask; |
747 | 748 | ||
748 | src_mask >>= 1; /* next input bit */ | 749 | src_mask >>= 1; /* next input bit */ |
749 | if (src_mask == 0) /* input word done? */ | ||
750 | { | ||
751 | continue; | ||
752 | } | ||
753 | } | 750 | } |
754 | 751 | ||
755 | dst_mask <<= 1; /* next output bit (row) */ | 752 | dst_mask <<= 1; /* next output bit (row) */ |