labwc/include/common/font.h

42 lines
1 KiB
C
Raw Normal View History

2021-11-13 21:56:53 +00:00
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __LABWC_FONT_H
#define __LABWC_FONT_H
struct lab_data_buffer;
struct font {
char *name;
int size;
};
2020-08-07 20:21:14 +01:00
/**
* font_height - get font vertical extents
* @font: description of font including family name and size
*/
int font_height(struct font *font);
2022-06-15 01:16:32 +02:00
/**
* font_width - get font horizontal extents
* @font: description of font including family name and size
*/
int font_width(struct font *font, const char *string);
/**
* font_buffer_create - Create ARGB8888 lab_data_buffer using pango
* @buffer: buffer pointer
* @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_buffer_create(struct lab_data_buffer **buffer, int max_width,
2022-06-12 21:16:44 +02:00
const char *text, struct font *font, float *color, double scale);
/**
* font_finish - free some font related resources
* Note: use on exit
*/
void font_finish(void);
#endif /* __LABWC_FONT_H */