*/
int font_height(struct font *font);
+/**
+ * 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
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)