From dc7e8a136131b16c86a16910275f908140ee2a56 Mon Sep 17 00:00:00 2001 From: Laurence Bank Date: Wed, 22 May 2024 13:44:55 +0100 Subject: [PATCH] fixed fontconvert for MacOS homebrew and the GFXglyph structure to correctly handle large fonts --- fontconvert/Makefile | 4 ++-- gfxfont.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fontconvert/Makefile b/fontconvert/Makefile index 47f5a0e1..11008f9f 100644 --- a/fontconvert/Makefile +++ b/fontconvert/Makefile @@ -1,8 +1,8 @@ all: fontconvert CC = gcc -CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include -LIBS = -lfreetype +CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include -I/opt/homebrew/include/freetype2 +LIBS = -L/opt/homebrew/lib -lfreetype fontconvert: fontconvert.c $(CC) $(CFLAGS) $< $(LIBS) -o $@ diff --git a/gfxfont.h b/gfxfont.h index 175bad63..cfc16f3e 100644 --- a/gfxfont.h +++ b/gfxfont.h @@ -10,11 +10,11 @@ /// Font data stored PER GLYPH typedef struct { uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap - uint8_t width; ///< Bitmap dimensions in pixels - uint8_t height; ///< Bitmap dimensions in pixels - uint8_t xAdvance; ///< Distance to advance cursor (x axis) - int8_t xOffset; ///< X dist from cursor pos to UL corner - int8_t yOffset; ///< Y dist from cursor pos to UL corner + uint16_t width; ///< Bitmap dimensions in pixels + uint16_t height; ///< Bitmap dimensions in pixels + uint16_t xAdvance; ///< Distance to advance cursor (x axis) + int16_t xOffset; ///< X dist from cursor pos to UL corner + int16_t yOffset; ///< Y dist from cursor pos to UL corner } GFXglyph; /// Data stored for FONT AS A WHOLE @@ -23,7 +23,7 @@ typedef struct { GFXglyph *glyph; ///< Glyph array uint16_t first; ///< ASCII extents (first char) uint16_t last; ///< ASCII extents (last char) - uint8_t yAdvance; ///< Newline distance (y axis) + uint16_t yAdvance; ///< Newline distance (y axis) } GFXfont; #endif // _GFXFONT_H_