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

4
drw.h
View File

@ -6,7 +6,6 @@
struct drw {
struct wl_shm *shm;
PangoFontDescription *font_description;
};
struct drwsurf {
uint32_t width, height, size;
@ -41,7 +40,8 @@ void drw_over_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h);
void drw_draw_text(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
uint32_t w, uint32_t h, uint32_t b, const char *label);
uint32_t w, uint32_t h, uint32_t b, const char *label,
PangoFontDescription *font_description);
uint32_t setup_buffer(struct drwsurf *drwsurf);