* @color: foreground color in rgba format
*/
void font_buffer_create(struct lab_data_buffer **buffer, int max_width,
- const char *text, struct font *font, float *color);
+ const char *text, struct font *font, float *color, double scale);
/**
* font_buffer_update - Wrapper around font_buffer_create
* wlr_buffer_drop() will be called on the buffer.
*/
void font_buffer_update(struct lab_data_buffer **buffer, int max_width,
- const char *text, struct font *font, float *color);
+ const char *text, struct font *font, float *color, double scale);
/**
* font_finish - free some font related resources
void
font_buffer_update(struct lab_data_buffer **buffer, int max_width,
- const char *text, struct font *font, float *color)
+ const char *text, struct font *font, float *color, double scale)
{
if (*buffer) {
wlr_buffer_drop(&(*buffer)->base);
*buffer = NULL;
}
- font_buffer_create(buffer, max_width, text, font, color);
+ font_buffer_create(buffer, max_width, text, font, color, scale);
}
void
font_buffer_create(struct lab_data_buffer **buffer, int max_width,
- const char *text, struct font *font, float *color)
+ const char *text, struct font *font, float *color, double scale)
{
if (!text || !*text) {
return;
if (max_width && rect.width > max_width) {
rect.width = max_width;
}
- /* TODO: scale */
- *buffer = buffer_create_cairo(rect.width, rect.height, 1, true);
+ *buffer = buffer_create_cairo(rect.width, rect.height, scale, true);
if (!*buffer) {
wlr_log(WLR_ERROR, "Failed to create font buffer of size %dx%d",
rect.width, rect.height);
/* Font buffer */
font_buffer_create(&menuitem->normal.buffer, item_max_width,
- text, &font, theme->menu_items_text_color);
+ text, &font, theme->menu_items_text_color, 1);
font_buffer_create(&menuitem->selected.buffer, item_max_width,
- text, &font, theme->menu_items_active_text_color);
+ text, &font, theme->menu_items_active_text_color, 1);
if (!menuitem->normal.buffer || !menuitem->selected.buffer) {
wlr_log(WLR_ERROR, "Failed to create menu item '%s'", text);
if (menuitem->normal.buffer) {
}
/* Generate and update the lab_data_buffer, drops the old buffer */
- font_buffer_update(&part->buffer, title_bg_width, title, &font, text_color);
+ font_buffer_update(&part->buffer, title_bg_width, title, &font,
+ text_color, 1);
if (!part->buffer) {
/* This can happen for example by defining a font size of 0 */
wlr_log(WLR_ERROR, "Failed to create title buffer");