Commit 51471e78 authored by Daniel Willmann's avatar Daniel Willmann

Add support for 6x7 fonts

For the moment the 6x7 font is simply the 6x8 font with the last line
cut off.
parent 2b70773f
......@@ -75,6 +75,8 @@
#include "drv_generic_graphic.h"
#include "font_6x8.h"
#include "font_6x8_bold.h"
#include "font_6x7.h"
#include "font_6x7_bold.h"
#ifdef WITH_DMALLOC
#include <dmalloc.h>
......@@ -261,16 +263,24 @@ static void drv_generic_graphic_render(const int layer, const int row, const int
continue;
}
if (bold || strstr(style, "bold") != NULL) {
chr = Font_6x8_bold[(int) *(unsigned char *) txt];
if (YRES == 8) {
chr = Font_6x8_bold[(int) *(unsigned char *) txt];
} else {
chr = Font_6x7_bold[(int) *(unsigned char *) txt];
}
} else {
chr = Font_6x8[(int) *(unsigned char *) txt];
if (YRES == 8) {
chr = Font_6x8[(int) *(unsigned char *) txt];
} else {
chr = Font_6x7[(int) *(unsigned char *) txt];
}
}
for (y = 0; y < YRES; y++) {
for (x = 0; x < XRES; x++) {
int mask = 1 << 6;
mask >>= ((x * 6) / (XRES)) + 1;
if (chr[(y * 8) / (YRES)] & mask)
if (chr[(y * YRES) / (YRES)] & mask)
drv_generic_graphic_FB[layer][(r + y) * LCOLS + c + x] = fg;
else
drv_generic_graphic_FB[layer][(r + y) * LCOLS + c + x] = bg;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment