2020-08-05 20:14:17 +01:00
|
|
|
#ifndef __LABWC_FONT_H
|
|
|
|
|
#define __LABWC_FONT_H
|
|
|
|
|
|
2021-08-07 08:35:46 +01:00
|
|
|
struct server;
|
|
|
|
|
struct wlr_texture;
|
|
|
|
|
struct wlr_box;
|
|
|
|
|
|
2021-08-20 20:20:49 +01:00
|
|
|
struct font {
|
|
|
|
|
char *name;
|
|
|
|
|
int size;
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-07 20:21:14 +01:00
|
|
|
/**
|
2020-08-05 20:14:17 +01:00
|
|
|
* font_height - get font vertical extents
|
2021-08-20 20:20:49 +01:00
|
|
|
* @font: description of font including family name and size
|
2020-08-05 20:14:17 +01:00
|
|
|
*/
|
2021-08-20 20:20:49 +01:00
|
|
|
int font_height(struct font *font);
|
2020-08-05 20:14:17 +01:00
|
|
|
|
2021-08-07 08:35:46 +01:00
|
|
|
/**
|
|
|
|
|
* texture_create - Create ARGB8888 texture using pango
|
|
|
|
|
* @server: context (for wlr_renderer)
|
|
|
|
|
* @texture: texture pointer; existing pointer will be freed
|
|
|
|
|
* @max_width: max allowable width; will be ellipsized if longer
|
|
|
|
|
* @text: text to be generated as texture
|
|
|
|
|
* @font: font description
|
|
|
|
|
* @color: foreground color in rgba format
|
|
|
|
|
*/
|
|
|
|
|
void font_texture_create(struct server *server, struct wlr_texture **texture,
|
2021-08-20 20:20:49 +01:00
|
|
|
int max_width, const char *text, struct font *font, float *color);
|
2021-08-07 08:35:46 +01:00
|
|
|
|
2020-10-31 15:41:06 +00:00
|
|
|
/**
|
|
|
|
|
* font_finish - free some font related resources
|
|
|
|
|
* Note: use on exit
|
|
|
|
|
*/
|
|
|
|
|
void font_finish(void);
|
|
|
|
|
|
2020-08-05 20:14:17 +01:00
|
|
|
#endif /* __LABWC_FONT_H */
|