commit
bc693011b3
@ -1,19 +1,34 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
struct charDesc_s {
|
struct Glyph {
|
||||||
|
// Glyph representation
|
||||||
char c;
|
char c;
|
||||||
int x, y, w, h, xo, yo, xa;
|
|
||||||
|
// x and y origin of the character.
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
// width and height in pixels.
|
||||||
|
int w, h;
|
||||||
|
|
||||||
|
// x and y offset
|
||||||
|
int xo, yo;
|
||||||
|
|
||||||
|
// Pixels after this character to begin
|
||||||
|
// drawing the next one.
|
||||||
|
int xa;
|
||||||
|
|
||||||
|
// Glyph data.
|
||||||
u8* data;
|
u8* data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct font_s {
|
struct font_s {
|
||||||
u8* data;
|
u8* data;
|
||||||
charDesc_s* desc;
|
Glyph* desc;
|
||||||
u8 height;
|
u8 height;
|
||||||
u8 color[3];
|
u8 color[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
extern u8 font1Data[];
|
extern u8 font1Data[];
|
||||||
extern charDesc_s font1Desc[];
|
extern Glyph font1Desc[];
|
||||||
|
|
||||||
extern font_s fontDefault;
|
extern font_s fontDefault;
|
||||||
|
514
source/font1.cpp
514
source/font1.cpp
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@
|
|||||||
//this code is not meant to be readable
|
//this code is not meant to be readable
|
||||||
int drawCharacter(u8* fb, font_s* font, char c, s16 x, s16 y, u16 w, u16 h)
|
int drawCharacter(u8* fb, font_s* font, char c, s16 x, s16 y, u16 w, u16 h)
|
||||||
{
|
{
|
||||||
charDesc_s* cd = &font->desc[(int)c];
|
Glyph* cd = &font->desc[(int)c];
|
||||||
|
|
||||||
if (!cd->data)
|
if (!cd->data)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user