mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2025-12-06 03:31:59 +01:00
chore: shrink 5x7 font
This commit is contained in:
parent
1cf19fa50a
commit
dcbcfe162c
|
|
@ -338,12 +338,12 @@ void
|
|||
ili9341_drawchar_5x7(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg)
|
||||
{
|
||||
uint16_t *buf = spi_buffer;
|
||||
uint16_t bits;
|
||||
uint8_t bits;
|
||||
int c, r;
|
||||
for(c = 0; c < 7; c++) {
|
||||
bits = x5x7_bits[(ch * 7) + c];
|
||||
for (r = 0; r < 5; r++) {
|
||||
*buf++ = (0x8000 & bits) ? fg : bg;
|
||||
*buf++ = (0x80 & bits) ? fg : bg;
|
||||
bits <<= 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -364,12 +364,12 @@ void
|
|||
ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size)
|
||||
{
|
||||
uint16_t *buf = spi_buffer;
|
||||
uint16_t bits;
|
||||
uint8_t bits;
|
||||
int c, r;
|
||||
for(c = 0; c < 7*size; c++) {
|
||||
bits = x5x7_bits[(ch * 7) + (c / size)];
|
||||
for (r = 0; r < 5*size; r++) {
|
||||
*buf++ = (0x8000 & bits) ? fg : bg;
|
||||
*buf++ = (0x80 & bits) ? fg : bg;
|
||||
if (r % size == (size-1)) {
|
||||
bits <<= 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ extern int area_height;
|
|||
|
||||
// font
|
||||
|
||||
extern const uint16_t x5x7_bits [];
|
||||
extern const uint8_t x5x7_bits [];
|
||||
extern const uint32_t numfont20x24[][24];
|
||||
|
||||
#define S_PI "\034"
|
||||
|
|
|
|||
6
plot.c
6
plot.c
|
|
@ -1056,7 +1056,7 @@ draw_marker(int w, int h, int x, int y, int c, int ch)
|
|||
int cc = c;
|
||||
if (j <= 9 && j > 2 && i >= -1 && i <= 3) {
|
||||
uint16_t bits = x5x7_bits[(ch * 7) + (9-j)];
|
||||
if (bits & (0x8000>>(i+1)))
|
||||
if (bits & (0x80>>(i+1)))
|
||||
cc = 0;
|
||||
}
|
||||
if (y0 >= 0 && y0 < h && x0 >= 0 && x0 < w)
|
||||
|
|
@ -1355,7 +1355,7 @@ request_to_draw_cells_behind_numeric_input(void)
|
|||
void
|
||||
cell_drawchar_5x7(int w, int h, uint8_t ch, int x, int y, uint16_t fg, int invert)
|
||||
{
|
||||
uint16_t bits;
|
||||
uint8_t bits;
|
||||
int c, r;
|
||||
if (y <= -7 || y >= h || x <= -5 || x >= w)
|
||||
return;
|
||||
|
|
@ -1366,7 +1366,7 @@ cell_drawchar_5x7(int w, int h, uint8_t ch, int x, int y, uint16_t fg, int inver
|
|||
if (invert)
|
||||
bits = ~bits;
|
||||
for (r = 0; r < 5; r++) {
|
||||
if ((x+r) >= 0 && (x+r) < w && (0x8000 & bits))
|
||||
if ((x+r) >= 0 && (x+r) < w && (0x80 & bits))
|
||||
spi_buffer[(y+c)*w + (x+r)] = fg;
|
||||
bits <<= 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue