From 559c56905e1208264e87ff3bbc2049eb054f95c8 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 13 Dec 2009 11:07:40 +0000 Subject: Font improvements: Fix bug that caused some fonts to be rendered garbled on custom builds with MAX_FONT_SIZE > 64k (closes FS#10844). Simplify version check. Use void pointer and explicit casting for the offsets to make it clearer that they may be of different sizes, add a comment too. Use uint16_t in stead of short in some places for consistency. Replace magic number with meaningful define. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23969 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/font.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'firmware/export/font.h') diff --git a/firmware/export/font.h b/firmware/export/font.h index 75b012d722..0fe6c30f2c 100644 --- a/firmware/export/font.h +++ b/firmware/export/font.h @@ -33,24 +33,6 @@ #include "sysfont.h" #endif -/* max static loadable font buffer size */ -#ifndef MAX_FONT_SIZE -#if LCD_HEIGHT > 64 -#if MEM > 2 -#define MAX_FONT_SIZE 60000 -#else -#define MAX_FONT_SIZE 10000 -#endif -#else -#define MAX_FONT_SIZE 4000 -#endif -#endif - -#ifndef FONT_HEADER_SIZE -#define FONT_HEADER_SIZE 36 -#endif - -#define GLYPH_CACHE_FILE ROCKBOX_DIR"/.glyphcache" /* * Fonts are specified by number, and used for display @@ -102,7 +84,8 @@ struct font { int firstchar; /* first character in bitmap*/ int size; /* font size in glyphs*/ const unsigned char *bits; /* 8-bit column bitmap data*/ - const unsigned short *offset; /* offsets into bitmap data*/ + const void *offset; /* offsets into bitmap data, + uint16_t if bits_size < 0xFFDB else uint32_t*/ const unsigned char *width; /* character widths or NULL if fixed*/ int defaultchar; /* default char (not glyph index)*/ int32_t bits_size; /* # bytes of glyph bits*/ -- cgit v1.2.3