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:
parent
cb3432ebcf
commit
940d82f0f4
@ -39,8 +39,6 @@
|
||||
#include <toaru/pex.h>
|
||||
#include <toaru/hashmap.h>
|
||||
|
||||
#include "terminal-font.h"
|
||||
|
||||
#define TIMEOUT_SECS 2
|
||||
|
||||
static FILE * console;
|
||||
|
@ -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 */
|
||||
{
|
||||
/* */
|
||||
|
@ -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))) {
|
||||
|
@ -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))]);
|
||||
|
@ -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))) {
|
||||
|
@ -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))) {
|
||||
|
Loading…
Reference in New Issue
Block a user