terminal: Bitmap font can use uint8_t

The baked Deja Vu Sans Mono is 8 pixels wide, so we don't need
to use uint16_t to hold rows of pixel data. Also, splash-log
doesn't render text anymore (it defers to the kernel console),
so we don't need to include the font there any more.
This commit is contained in:
K. Lange 2022-12-13 15:08:56 +09:00
parent cb3432ebcf
commit 940d82f0f4
6 changed files with 5 additions and 7 deletions

View File

@ -39,8 +39,6 @@
#include <toaru/pex.h>
#include <toaru/hashmap.h>
#include "terminal-font.h"
#define TIMEOUT_SECS 2
static FILE * console;

View File

@ -48,7 +48,7 @@
#define LARGE_FONT_CELL_WIDTH 8
#define LARGE_FONT_CELL_HEIGHT 17
#define LARGE_FONT_MASK 7
uint16_t large_font[][17] = {
uint8_t large_font[][17] = {
/* 0 32 */
{
/* */

View File

@ -860,7 +860,7 @@ static void term_write_char(uint32_t val, uint16_t x, uint16_t y, uint32_t fg, u
val = ununicode(val);
}
/* Draw using the bitmap font. */
uint16_t * c = large_font[val];
uint8_t * c = large_font[val];
for (uint8_t i = 0; i < char_height; ++i) {
for (uint8_t j = 0; j < char_width; ++j) {
if (c[i] & (1 << (LARGE_FONT_MASK-j))) {

View File

@ -180,7 +180,7 @@ static void write_char(int x, int y, int val, int attr) {
uint32_t colors[] = {bg_color, fg_color};
uint16_t * c = large_font[val];
uint8_t * c = large_font[val];
for (uint8_t i = 0; i < char_height; ++i) {
for (uint8_t j = 0; j < char_width; ++j) {
set_point(x+j,y+i,colors[!!(c[i] & (1 << LARGE_FONT_MASK-j))]);

View File

@ -54,7 +54,7 @@ static void fb_write_char(int _x, int _y, int val, uint32_t color) {
int x = 1 + _x * char_width;
int y = _y * char_height;
uint16_t * c = large_font[val];
uint8_t * c = large_font[val];
for (uint8_t i = 0; i < char_height; ++i) {
for (uint8_t j = 0; j < char_width; ++j) {
if (c[i] & (1 << (LARGE_FONT_MASK-j))) {

View File

@ -64,7 +64,7 @@ static void fb_write_char(int _x, int _y, int val, uint32_t color) {
int x = 1 + _x * char_width;
int y = _y * char_height;
uint16_t * c = large_font[val];
uint8_t * c = large_font[val];
for (uint8_t i = 0; i < char_height; ++i) {
for (uint8_t j = 0; j < char_width; ++j) {
if (c[i] & (1 << (LARGE_FONT_MASK-j))) {