From 299682d3f1610faf99a525500c2d9db801119176 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 5 Nov 2012 19:37:51 +0100 Subject: [PATCH] fix incorrect font handling --- drivers/displays/bitmap/sharpmem/sharpmem.c | 2 +- drivers/displays/bitmap/ssd1306/ssd1306.c | 2 +- drivers/displays/bitmap/st7565/st7565.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/displays/bitmap/sharpmem/sharpmem.c b/drivers/displays/bitmap/sharpmem/sharpmem.c index 43e4821..9a81667 100644 --- a/drivers/displays/bitmap/sharpmem/sharpmem.c +++ b/drivers/displays/bitmap/sharpmem/sharpmem.c @@ -153,7 +153,7 @@ static void sharpmemDrawChar(uint16_t x, uint16_t y, const char c, struct FONT_D // Retrieve appropriate columns from font data for (col = 0; col < font.u8Width; col++) { - column[col] = font.au8FontTable[((c - 32) * font.u8Width) + col]; // Get first column of appropriate character + column[col] = font.au8FontTable[((c - font.u8FirstChar) * font.u8Width) + col]; // Get first column of appropriate character } } else diff --git a/drivers/displays/bitmap/ssd1306/ssd1306.c b/drivers/displays/bitmap/ssd1306/ssd1306.c index 6812b34..304d1ec 100644 --- a/drivers/displays/bitmap/ssd1306/ssd1306.c +++ b/drivers/displays/bitmap/ssd1306/ssd1306.c @@ -216,7 +216,7 @@ static void ssd1306DrawChar(uint16_t x, uint16_t y, uint8_t c, struct FONT_DEF f // Retrieve appropriate columns from font data for (col = 0; col < font.u8Width; col++) { - column[col] = font.au8FontTable[((c - 32) * font.u8Width) + col]; // Get first column of appropriate character + column[col] = font.au8FontTable[((c - font.u8FirstChar) * font.u8Width) + col]; // Get first column of appropriate character } } else diff --git a/drivers/displays/bitmap/st7565/st7565.c b/drivers/displays/bitmap/st7565/st7565.c index d8b125e..96d5540 100644 --- a/drivers/displays/bitmap/st7565/st7565.c +++ b/drivers/displays/bitmap/st7565/st7565.c @@ -134,7 +134,7 @@ void drawChar(uint16_t x, uint16_t y, uint8_t c, struct FONT_DEF font) // Retrieve appropriate columns from font data for (col = 0; col < font.u8Width; col++) { - column[col] = font.au8FontTable[((c - 32) * font.u8Width) + col]; // Get first column of appropriate character + column[col] = font.au8FontTable[((c - font.u8FirstChar) * font.u8Width) + col]; // Get first column of appropriate character } } else -- 2.20.1