summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/font.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 4fd7325..2be9035 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -172,9 +172,12 @@ static int32_t readlong(struct font *pf)
static int glyph_bytes( struct font *pf, int width )
{
- return pf->depth ?
- (pf->height * width + 1) / 2:
- width * ((pf->height + 7) / 8);
+ int ret;
+ if (pf->depth)
+ ret = ( pf->height * width + 1 ) / 2;
+ else
+ ret = width * ((pf->height + 7) / 8);
+ return (ret + 1) & ~1;
}
static struct font* font_load_header(struct font *pf)