Skip to content

Commit

Permalink
fixed fontconvert for MacOS homebrew and the GFXglyph structure to co…
Browse files Browse the repository at this point in the history
…rrectly handle large fonts
  • Loading branch information
Laurence Bank authored and Laurence Bank committed May 22, 2024
1 parent 77d05f5 commit dc7e8a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions fontconvert/Makefile
Original file line number Diff line number Diff line change
@@ -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 $@
Expand Down
12 changes: 6 additions & 6 deletions gfxfont.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_

0 comments on commit dc7e8a1

Please sign in to comment.