From 888c2a043444a5e0037823054049ca575b282818 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Tue, 31 May 2022 11:29:10 +0100 Subject: [PATCH] Font macro updates for adding font utilities --- common/defines.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/defines.h b/common/defines.h index ce680d91..1b5384cc 100644 --- a/common/defines.h +++ b/common/defines.h @@ -91,8 +91,10 @@ b = (c) & 0xff; \ } /* font macros */ -#define FONT_DATASIZE(f) \ - ((((f)->height * (((f)->width + 7) / 8)) + 3) & ~3); +#define FONT_DATASIZE_FROM_GEOMETRY(width,height) \ + ((((height) * (((width) + 7) / 8)) + 3) & ~3) +#define FONT_DATASIZE(f) FONT_DATASIZE_FROM_GEOMETRY((f->width), (f->height)) + /* use crc for bitmap cache lookups */ #define USE_CRC