diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-08-27 00:34:15 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-08-27 00:34:15 +0000 |
commit | b4920271ba414d1a91e2209f3b07c4506980ba3b (patch) | |
tree | 4ab165989ab2b62167ad2479189128cd7466b245 /tools | |
parent | ac84357fa59718f5f9e63a1e219673ca861e7998 (diff) | |
download | rockbox-b4920271ba414d1a91e2209f3b07c4506980ba3b.tar.gz rockbox-b4920271ba414d1a91e2209f3b07c4506980ba3b.zip |
Fixed new font format: necessity of offset table generation, output of fonts without one
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5018 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r-- | tools/convbdf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/convbdf.c b/tools/convbdf.c index 14561869a2..16af43f3b8 100644 --- a/tools/convbdf.c +++ b/tools/convbdf.c | |||
@@ -393,7 +393,7 @@ int bdf_read_header(FILE *fp, struct font* pf) | |||
393 | fprintf(stderr, "Error: bad 'ENCODING'\n"); | 393 | fprintf(stderr, "Error: bad 'ENCODING'\n"); |
394 | return 0; | 394 | return 0; |
395 | } | 395 | } |
396 | if (encoding >= 0 && | 396 | if (encoding >= 0 && |
397 | encoding <= limit_char && | 397 | encoding <= limit_char && |
398 | encoding >= start_char) { | 398 | encoding >= start_char) { |
399 | 399 | ||
@@ -595,6 +595,16 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf) | |||
595 | } | 595 | } |
596 | 596 | ||
597 | /* determine whether font doesn't require encode table*/ | 597 | /* determine whether font doesn't require encode table*/ |
598 | #ifdef ROTATE | ||
599 | l = 0; | ||
600 | for (i=0; i<pf->size; ++i) { | ||
601 | if (pf->offrot[i] != l) { | ||
602 | encodetable = 1; | ||
603 | break; | ||
604 | } | ||
605 | l += pf->maxwidth * (pf->height + 7) / 8; | ||
606 | } | ||
607 | #else | ||
598 | l = 0; | 608 | l = 0; |
599 | for (i=0; i<pf->size; ++i) { | 609 | for (i=0; i<pf->size; ++i) { |
600 | if (pf->offset[i] != l) { | 610 | if (pf->offset[i] != l) { |
@@ -603,6 +613,7 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf) | |||
603 | } | 613 | } |
604 | l += BITMAP_WORDS(pf->width[i]) * pf->height; | 614 | l += BITMAP_WORDS(pf->width[i]) * pf->height; |
605 | } | 615 | } |
616 | #endif | ||
606 | if (!encodetable) { | 617 | if (!encodetable) { |
607 | free(pf->offset); | 618 | free(pf->offset); |
608 | pf->offset = NULL; | 619 | pf->offset = NULL; |