src/common/font.c: Add font_width()

This commit is contained in:
Consolatis 2022-06-15 01:16:32 +02:00 committed by Johan Malm
parent 5f30773a6e
commit d309df6f87
2 changed files with 13 additions and 0 deletions

View file

@ -49,6 +49,13 @@ font_height(struct font *font)
return rectangle.height;
}
int
font_width(struct font *font, const char *string)
{
PangoRectangle rectangle = font_extents(font, string);
return rectangle.width;
}
void
font_buffer_update(struct lab_data_buffer **buffer, int max_width,
const char *text, struct font *font, float *color, double scale)