common/font: add scaled_font_buffer_create_for_titlebar()

Co-authored-by: tokyo4j <hrak1529@gmail.com>
This commit is contained in:
John Lindgren 2025-05-29 12:34:03 -04:00
parent 3ca7adace0
commit 54b236e027
4 changed files with 76 additions and 18 deletions

View file

@ -1,6 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_FONT_H
#define LABWC_FONT_H
#include <cairo.h>
#include <pango/pango-font.h>
struct lab_data_buffer;
@ -36,14 +38,15 @@ void font_get_buffer_size(int max_width, const char *text, struct font *font,
* font_buffer_create - Create ARGB8888 lab_data_buffer using pango
* @buffer: buffer pointer
* @max_width: max allowable width; will be ellipsized if longer
* @height: buffer height or -1 to compute from font
* @text: text to be generated as texture
* @font: font description
* @color: foreground color in rgba format
* @bg_color: background color in rgba format
* @bg_pattern: background pattern
*/
void font_buffer_create(struct lab_data_buffer **buffer, int max_width,
const char *text, struct font *font, const float *color,
const float *bg_color, double scale);
int height, const char *text, struct font *font, const float *color,
cairo_pattern_t *bg_pattern, double scale);
/**
* font_finish - free some font related resources