Make font selection scheme specific

Add the members font and font_descriptor to struct clr_scheme, so that
it is possible to specify a font for each scheme.

During initialization create the font descriptors for each scheme.

Instead of initially setting the font descriptor when setting up the
buffer, set the font descriptor when drawing the text.

Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Frank Oltmanns
2023-10-23 13:59:31 +02:00
committed by Maarten van Gompel
parent 6e52be343d
commit d6439afcb9
6 changed files with 28 additions and 14 deletions

View File

@ -1,7 +1,7 @@
#ifndef config_def_h_INCLUDED
#define config_def_h_INCLUDED
static const char *default_font = "Sans 14";
#define DEFAULT_FONT "Sans 14"
static const int transparency = 255;
struct clr_scheme schemes[] = {
@ -12,6 +12,7 @@ struct clr_scheme schemes[] = {
.high = {.bgra = {100, 100, 100, transparency}},
.swipe = {.bgra = {100, 255, 100, 64}},
.text = {.color = UINT32_MAX},
.font = DEFAULT_FONT,
},
{
/* colors */
@ -20,6 +21,7 @@ struct clr_scheme schemes[] = {
.high = {.bgra = {100, 100, 100, transparency}},
.swipe = {.bgra = {100, 255, 100, 64}},
.text = {.color = UINT32_MAX},
.font = DEFAULT_FONT,
}
};